The sdl2-mixer Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The sdl2-mixer Reference Manual

This is the sdl2-mixer Reference Manual, version 1.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 15:18:37 2021 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

cl-sdl2-mixer

This is a brief but usuable wrapper for SDL2_Mixer.

Usage

The following functions are currently available to the users

Examples

A simple example program has been provided. Ogg support is required to run it however. Press the space bar to play the sound effect/song, the up directional key to increase the volume by 20 and the down directional key to decrease the volume by 20. The current volume is displayed in standard-output.

Issues

If you cannot load libSDL2_mixer, please ensure that you have SDL_mixer 2.0, installed and not just 1.2. If you receive errors concerning unknown file types, please ensure that libSDL2_mixer is linked against the appropriate sound library, e.g. libVorbis for ogg support. As of writing (05-31-2015) the SDL_mixer 2.0 provided by brew on OSX does not link libVorbis correctly, please build it from source.

If you are sure all of this is correct, and it still will not load, please file an issue and specify:


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 sdl2-mixer

Author

Ryan Pavlik <rpavlik@gmail.com>

License

MIT

Description

Bindings for sdl2_mixer using autowrap

Version

1.0

Dependencies
Source

sdl2-mixer.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 sdl2-mixer/autowrap-spec

Dependency

general.lisp (file)

Parent

sdl2-mixer (system)

Location

spec/

Component

sdl_mixer.h (file)


Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Next: , Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 sdl2-mixer.asd

Location

/home/quickref/quicklisp/dists/quicklisp/software/cl-sdl2-mixer-20201220-git/sdl2-mixer.asd

Systems

sdl2-mixer (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 sdl2-mixer/package.lisp

Parent

sdl2-mixer (system)

Location

package.lisp

Packages

sdl2-mixer


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 sdl2-mixer/library.lisp

Dependency

package.lisp (file)

Parent

sdl2-mixer (system)

Location

library.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.4 sdl2-mixer/autowrap.lisp

Dependency

library.lisp (file)

Parent

sdl2-mixer (system)

Location

autowrap.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.5 sdl2-mixer/conditions.lisp

Dependency

autowrap.lisp (file)

Parent

sdl2-mixer (system)

Location

conditions.lisp

Exported Definitions

sdl-mixer-error (condition)

Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

4.1.6 sdl2-mixer/general.lisp

Dependency

conditions.lisp (file)

Parent

sdl2-mixer (system)

Location

general.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Files   [Contents][Index]

4.2 Static


Previous: , Up: Static files   [Contents][Index]

4.2.1 sdl2-mixer/autowrap-spec/SDL_mixer.h

Parent

autowrap-spec (module)

Location

spec/SDL_mixer.h


Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 sdl2-mixer

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Functions

Function: allocate-channels CHANNELS

Set the number of channels to be mixed. Opening too many channels may result in a segfault. This can be called at any time even while samples are playing. Passing a number lower than previous calls will close unused channels. It returns the number of channels allocated. NOTE: Channels are 0 indexed!

Package

sdl2-mixer

Source

general.lisp (file)

Function: close-audio ()

Closes the mixer

Package

sdl2-mixer

Source

general.lisp (file)

Function: free-chunk CHUNK

Free the memory used in the chunk and then free the chunk itself. Do not free the chunk while it is playing; halt the channel it’s playing on using halt-channel prior to freeing the chunk.

Package

sdl2-mixer

Source

general.lisp (file)

Function: free-music MIX-MUSIC-OBJECT
Package

sdl2-mixer

Source

general.lisp (file)

Function: halt-channel CHANNEL

Halt the channel or pass -1 to halt all channels. Always returns 0. NOTE: Channels are 0 indexed!

Package

sdl2-mixer

Source

general.lisp (file)

Function: halt-music ()

Halts the playback of all music

Package

sdl2-mixer

Source

general.lisp (file)

Function: init &rest FLAGS

Initialize the SDL mixer specifying the formats you wish to use. Must be one of these values or a combination thereof :ogg, :wave, :mod, :mp3

Package

sdl2-mixer

Source

general.lisp (file)

Function: linked-version ()

Returns the version number for SDL Mixer 2

Package

sdl2-mixer

Source

general.lisp (file)

Function: load-music MUSIC-FILE-NAME

Loads music from a file. Returns a mix-music object

Package

sdl2-mixer

Source

general.lisp (file)

Function: load-wav SAMPLE-FILE-NAME

Loads the sample specified by the sample-file-name. Returns a mix-chunk. sdl2-mixer must be initialized and open-audio must be called prior to.

Package

sdl2-mixer

Source

general.lisp (file)

Function: open-audio FREQUENCY FORMAT CHANNELS CHUNKSIZE

Initialize the mixer specifiying the output sample format, number of output channels (1 mono or 2 for stereo), and bytes used per output sample. format must be one of the following values, :u8, :s8, :u16lsb, :s16lsb, :u16msb, :s16msb, :u16, :s16, :u16sys, :s16sys

Package

sdl2-mixer

Source

general.lisp (file)

Function: play-channel CHANNEL MIX-CHUNK LOOPS

Plays the mix-chunk (sound effect) loops+1 times on a given channel. Passing -1 for the channel will play it on the first unreserved channel. Returns the channel the sample is played on. NOTE: Channels are 0 indexed!

Package

sdl2-mixer

Source

general.lisp (file)

Function: play-music MIX-MUSIC-OBJECT &optional LOOPS

Play the music as many times as specified by the optional loops argument. By default loops is -1 which makes the music loop indefinitely. Returns 0 on success -1 on error

Package

sdl2-mixer

Source

general.lisp (file)

Function: playing CHANNEL

Checks whether or not a channel is currently playing. It will return a 1 for playing and 0 otherwise. Passing -1 for the channel will specify how many channels are playing.

Package

sdl2-mixer

Source

general.lisp (file)

Function: quit ()

Cleans up SDL Mixer

Package

sdl2-mixer

Source

general.lisp (file)

Function: volume CHANNEL VOLUME

Set the volume on a given channel, pass -1 to set the volume for all channels. The volume may range from 0 to 128. Passing in a number higher than the maximum will automatically set it to the maximum while passing in a negatiev will automatically set it to 0. Returns the current volume of the channel. NOTE: Channels are 0 indexed!

Package

sdl2-mixer

Source

general.lisp (file)

Function: volume-music MUSIC-VOLUME

Adjust the volume of the music. Volume ranges from 0 to 128. The return value is an integer that usually represents the previous volume setting. Passing -1 as the music volume does not change the volume but instead returns the current volume setting

Package

sdl2-mixer

Source

general.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Conditions

Condition: sdl-mixer-error ()
Package

sdl2-mixer

Source

conditions.lisp (file)

Direct superclasses

sdl-rc-error (condition)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Macros

Macro: check-non-zero FORM
Package

sdl2-mixer

Source

conditions.lisp (file)

Macro: check-null FORM
Package

sdl2-mixer

Source

conditions.lisp (file)

Macro: check-rc FORM
Package

sdl2-mixer

Source

conditions.lisp (file)

Macro: check-true FORM
Package

sdl2-mixer

Source

conditions.lisp (file)

Macro: create-sdl-free-function FREE-FUNCTION SDL-OBJECT
Package

sdl2-mixer

Source

general.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Functions

Function: query-format ()

Gets the output format in use by the opened audio device

Package

sdl2-mixer

Source

general.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M   S  
Index Entry  Section

F
File, Lisp, sdl2-mixer.asd: The sdl2-mixer․asd file
File, Lisp, sdl2-mixer/autowrap.lisp: The sdl2-mixer/autowrap․lisp file
File, Lisp, sdl2-mixer/conditions.lisp: The sdl2-mixer/conditions․lisp file
File, Lisp, sdl2-mixer/general.lisp: The sdl2-mixer/general․lisp file
File, Lisp, sdl2-mixer/library.lisp: The sdl2-mixer/library․lisp file
File, Lisp, sdl2-mixer/package.lisp: The sdl2-mixer/package․lisp file
File, static, sdl2-mixer/autowrap-spec/SDL_mixer.h: The sdl2-mixer/autowrap-spec/sdl_mixer․h file

L
Lisp File, sdl2-mixer.asd: The sdl2-mixer․asd file
Lisp File, sdl2-mixer/autowrap.lisp: The sdl2-mixer/autowrap․lisp file
Lisp File, sdl2-mixer/conditions.lisp: The sdl2-mixer/conditions․lisp file
Lisp File, sdl2-mixer/general.lisp: The sdl2-mixer/general․lisp file
Lisp File, sdl2-mixer/library.lisp: The sdl2-mixer/library․lisp file
Lisp File, sdl2-mixer/package.lisp: The sdl2-mixer/package․lisp file

M
Module, sdl2-mixer/autowrap-spec: The sdl2-mixer/autowrap-spec module

S
sdl2-mixer.asd: The sdl2-mixer․asd file
sdl2-mixer/autowrap-spec: The sdl2-mixer/autowrap-spec module
sdl2-mixer/autowrap-spec/SDL_mixer.h: The sdl2-mixer/autowrap-spec/sdl_mixer․h file
sdl2-mixer/autowrap.lisp: The sdl2-mixer/autowrap․lisp file
sdl2-mixer/conditions.lisp: The sdl2-mixer/conditions․lisp file
sdl2-mixer/general.lisp: The sdl2-mixer/general․lisp file
sdl2-mixer/library.lisp: The sdl2-mixer/library․lisp file
sdl2-mixer/package.lisp: The sdl2-mixer/package․lisp file
Static File, sdl2-mixer/autowrap-spec/SDL_mixer.h: The sdl2-mixer/autowrap-spec/sdl_mixer․h file

Jump to:   F   L   M   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   A   C   F   H   I   L   M   O   P   Q   V  
Index Entry  Section

A
allocate-channels: Exported functions

C
check-non-zero: Internal macros
check-null: Internal macros
check-rc: Internal macros
check-true: Internal macros
close-audio: Exported functions
create-sdl-free-function: Internal macros

F
free-chunk: Exported functions
free-music: Exported functions
Function, allocate-channels: Exported functions
Function, close-audio: Exported functions
Function, free-chunk: Exported functions
Function, free-music: Exported functions
Function, halt-channel: Exported functions
Function, halt-music: Exported functions
Function, init: Exported functions
Function, linked-version: Exported functions
Function, load-music: Exported functions
Function, load-wav: Exported functions
Function, open-audio: Exported functions
Function, play-channel: Exported functions
Function, play-music: Exported functions
Function, playing: Exported functions
Function, query-format: Internal functions
Function, quit: Exported functions
Function, volume: Exported functions
Function, volume-music: Exported functions

H
halt-channel: Exported functions
halt-music: Exported functions

I
init: Exported functions

L
linked-version: Exported functions
load-music: Exported functions
load-wav: Exported functions

M
Macro, check-non-zero: Internal macros
Macro, check-null: Internal macros
Macro, check-rc: Internal macros
Macro, check-true: Internal macros
Macro, create-sdl-free-function: Internal macros

O
open-audio: Exported functions

P
play-channel: Exported functions
play-music: Exported functions
playing: Exported functions

Q
query-format: Internal functions
quit: Exported functions

V
volume: Exported functions
volume-music: Exported functions

Jump to:   A   C   F   H   I   L   M   O   P   Q   V  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
Condition, sdl-mixer-error: Exported conditions

P
Package, sdl2-mixer: The sdl2-mixer package

S
sdl-mixer-error: Exported conditions
sdl2-mixer: The sdl2-mixer system
sdl2-mixer: The sdl2-mixer package
System, sdl2-mixer: The sdl2-mixer system

Jump to:   C   P   S