The sdl2-mixer Reference Manual

This is the sdl2-mixer Reference Manual, version 1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:41:53 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 sdl2-mixer

Bindings for sdl2_mixer using autowrap

Author

Ryan Pavlik <>

License

MIT

Version

1.0

Dependencies
  • alexandria (system).
  • cl-autowrap (system).
  • sdl2 (system).
  • trivial-garbage (system).
Source

sdl2-mixer.asd.

Child Components

3 Modules

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


3.1 sdl2-mixer/autowrap-spec

Dependency

general.lisp (file).

Source

sdl2-mixer.asd.

Parent Component

sdl2-mixer (system).

Child Component

sdl_mixer.h (file).


4 Files

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


4.1 Lisp


4.1.1 sdl2-mixer/sdl2-mixer.asd

Source

sdl2-mixer.asd.

Parent Component

sdl2-mixer (system).

ASDF Systems

sdl2-mixer.


4.1.2 sdl2-mixer/package.lisp

Source

sdl2-mixer.asd.

Parent Component

sdl2-mixer (system).

Packages

sdl2-mixer.


4.1.3 sdl2-mixer/library.lisp

Dependency

package.lisp (file).

Source

sdl2-mixer.asd.

Parent Component

sdl2-mixer (system).


4.1.4 sdl2-mixer/autowrap.lisp

Dependency

library.lisp (file).

Source

sdl2-mixer.asd.

Parent Component

sdl2-mixer (system).


4.1.5 sdl2-mixer/conditions.lisp

Dependency

autowrap.lisp (file).

Source

sdl2-mixer.asd.

Parent Component

sdl2-mixer (system).

Public Interface

sdl-mixer-error (condition).

Internals

4.1.6 sdl2-mixer/general.lisp

Dependency

conditions.lisp (file).

Source

sdl2-mixer.asd.

Parent Component

sdl2-mixer (system).

Public Interface
Internals

create-sdl-free-function (macro).


4.2 Static


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

Source

sdl2-mixer.asd.

Parent Component

autowrap-spec (module).


5 Packages

Packages are listed by definition order.


5.1 sdl2-mixer

Source

package.lisp.

Use List
  • alexandria.
  • autowrap.minimal.
  • common-lisp.
  • plus-c.
  • sdl2-ffi.functions.
Public Interface
Internals

6 Definitions

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


6.1 Public Interface


6.1.1 Ordinary 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.

Function: close-audio ()

Closes the mixer

Package

sdl2-mixer.

Source

general.lisp.

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.

Function: free-music (mix-music-object)
Package

sdl2-mixer.

Source

general.lisp.

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.

Function: halt-music ()

Halts the playback of all music

Package

sdl2-mixer.

Source

general.lisp.

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.

Function: linked-version ()

Returns the version number for SDL Mixer 2

Package

sdl2-mixer.

Source

general.lisp.

Function: load-music (music-file-name)

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

Package

sdl2-mixer.

Source

general.lisp.

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.

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.

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.

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.

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.

Function: query-spec ()

Gets the output format in use by the opened audio device

Package

sdl2-mixer.

Source

general.lisp.

Function: quit ()

Cleans up SDL Mixer

Package

sdl2-mixer.

Source

general.lisp.

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.

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.


6.1.2 Conditions

Condition: sdl-mixer-error
Package

sdl2-mixer.

Source

conditions.lisp.

Direct superclasses

sdl-rc-error.


6.2 Internals


6.2.1 Macros

Macro: check-non-zero (form)
Package

sdl2-mixer.

Source

conditions.lisp.

Macro: check-null (form)
Package

sdl2-mixer.

Source

conditions.lisp.

Macro: check-rc (form)
Package

sdl2-mixer.

Source

conditions.lisp.

Macro: check-true (form)
Package

sdl2-mixer.

Source

conditions.lisp.

Macro: create-sdl-free-function (free-function sdl-object)
Package

sdl2-mixer.

Source

general.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

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

A
allocate-channels: Public ordinary functions

C
check-non-zero: Private macros
check-null: Private macros
check-rc: Private macros
check-true: Private macros
close-audio: Public ordinary functions
create-sdl-free-function: Private macros

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

H
halt-channel: Public ordinary functions
halt-music: Public ordinary functions

I
init: Public ordinary functions

L
linked-version: Public ordinary functions
load-music: Public ordinary functions
load-wav: Public ordinary functions

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

O
open-audio: Public ordinary functions

P
play-channel: Public ordinary functions
play-music: Public ordinary functions
playing: Public ordinary functions

Q
query-spec: Public ordinary functions
quit: Public ordinary functions

V
volume: Public ordinary functions
volume-music: Public ordinary functions


A.3 Variables