Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields

sdl4gcj::mixer::Mixer Class Reference

Inheritance diagram for sdl4gcj::mixer::Mixer:

Inheritance graph
[legend]
Collaboration diagram for sdl4gcj::mixer::Mixer:

Collaboration graph
[legend]

Public Member Functions

native void closeAudio ()
 Close mixer.
native int getFrequency ()
 Get the actual frequency of opened audio device .
native int getFormat ()
 Get the actual format of opened audio device .
native int getChannels ()
 Get the actual number of audio channels.
native int groupChannel (int channel, int tag)
 Add which channel to group tag.
native int groupChannels (int fromChannel, int toChannel, int tag)
 Add which channel to group tag.
native int groupAvailable (int tag)
 Find the first available (not playing) channel in group tag.
native int groupCount (int tag)
 Count the number of channels in group tag.
native int groupOldest (int tag)
 Find the oldest actively playing channel in group tag.
native int groupNewer (int tag)
 Find the newest, most recently started, actively playing channel in group tag.
native int allocateChannels (int numberOfChannels)
 Set the number of channels for this mixer.
native boolean playing (int channel)
 Check the status of specified channel.
boolean playing ()
 Check the status of all channels.
native boolean playingMusic ()
 Check the status of music playing.
native int playChannel (int channel, Chunk chunk, int loops, int ticks)
 Play an audio chunk on a specific channel.
int playChannel (Chunk chunk, int loops, int ticks)
 Play an audio chunk on a first free channel.
int playChannel (int channel, Chunk chunk, int loops)
 Play an audio chunk on a specified channel.
int playChannel (Chunk chunk, int loops)
 Play an audio chunk on a first free channel.
int playChannel (Chunk chunk)
 Play an audio chunk on a first free channel.
native int fadeInChannel (int channel, Chunk chunk, int loops, int fadeTime, int ticks)
 Play an audio chunk on a specific channel.
int fadeInChannel (int channel, Chunk chunk, int loops, int fadeTime)
 Play an audio chunk on a specific channel.
int fadeInChannel (int channel, Chunk chunk, int fadeTime)
 Play an audio chunk on a specific channel.
int fadeInChannel (Chunk chunk, int fadeTime)
 Play an audio chunk on a specific channel.
native void playMusic (Music music, int loops)
 Play an audio chunk on a first free channel.
void playMusic (Music music)
 Play the music.
native void fadeInMusic (Music music, int loops, int ticks)
 Play the music with fadein effect.
void fadeInMusic (Music music, int ticks)
 Play the music with fadein effect.
native void fadeInMusicPos (Music music, int loops, int ticks, double position)
 Play the music with fadein effect.
void fadeInMusicPos (Music music, int ticks, double position)
 Play the music with Fadein effect.
native void pause (int channel)
 Pause specified channel.
native void resume (int channel)
 Resume specified channel.
native boolean paused (int channel)
 Get pause status of a specified channel.
native void pauseMusic ()
 Pause music stream.
native void resumeMusic ()
 Resume music stream.
native void rewindMusic ()
 Rewind music stream.
native boolean pausedMusic ()
 Get pause status of music stream.
native void setMusicPosition (double position)
 Set position of playback in stream.
native int volume (int channel, int volume)
 Set channel volume.
int getVolume (int channel)
 Get channel volume.
void setVolume (int volume)
 Set volume for all channels.
native int volumeMusic (int volume)
 Set music volume.
void setVolumeMusic (int volume)
 Set music volume.
int getVolumeMusic ()
 Get current music volume.
native int haltChannel (int channel)
 Halt playing of a specified channel.
native int haltGroup (int tag)
 Halt playing of a specified group.
native int haltMusic ()
 Halt music playing.
native int expireChannel (int channel, int ticks)
 Change the expiration delay for a particular channel.
native int fadeOutChannel (int channel, int ms)
 Set fade out effect for a particular channel.
native int fadeOutGroup (int tag, int ms)
 Set fade out effect for a particular group.
native int fadeOutMusic (int ms)
 Set fade out effect music stream.
native int fadingMusic ()
 Get fading status of music stream.
native int fadingChannel (int channel)
 Get fading status of specified channel.
native void setPanning (int channel, short left, short right)
 Set panning filer.
native void setPosition (int channel, short angle, short distance)
 Set position filer.
native void setDistance (int channel, short distance)
 Set distance filer.
native void setReverseStereo (int channel, boolean flip)
 Set reverse stereo.
native int reserveChannels (int num)
 Reserve the first channels (0 - n-1) for the application,.

Static Public Member Functions

static native Mixer openAudio (int frequency, int format, int channels, int chunksize)
 Initialize audio device and mixer.
static Mixer openAudio (int chunksize)
 Initialize audio device and mixer.
static Mixer openAudio ()

Private Member Functions

 Mixer ()

Constructor & Destructor Documentation

sdl4gcj::mixer::Mixer::Mixer  )  [inline, private]
 


Member Function Documentation

native int sdl4gcj::mixer::Mixer::allocateChannels int  numberOfChannels  ) 
 

Set the number of channels for this mixer.

Parameters:
numberOfChannels Number of channels to allocate for mixer.
Returns:
The number of channels allocated.

native void sdl4gcj::mixer::Mixer::closeAudio  ) 
 

Close mixer.

native int sdl4gcj::mixer::Mixer::expireChannel int  channel,
int  ticks
 

Change the expiration delay for a particular channel.

The sample will stop playing after the 'ticks' milliseconds have elapsed, or remove the expiration if 'ticks' is -1 Mix_ExpireChannel(int channel, int ticks);

Parameters:
channel Target channel, or -1 to fade all channels out.
ticks new expiration ticks
Returns:
Number of channels set to expire. Whether or not they are active.

int sdl4gcj::mixer::Mixer::fadeInChannel Chunk  chunk,
int  fadeTime
[inline]
 

Play an audio chunk on a specific channel.

Same as fadeInChannel(-1, chunk, -1, fadeTime, -1);

Parameters:
chunk a chunk data
fadeTime fade in time (milisecond)

int sdl4gcj::mixer::Mixer::fadeInChannel int  channel,
Chunk  chunk,
int  fadeTime
[inline]
 

Play an audio chunk on a specific channel.

Same as fadeInChannel(channel, chunk, -1, fadeTime, -1);

Parameters:
channel a channel number, if channel is -1, paly on the first free channel.
chunk a chunk data
fadeTime fade in time (milisecond)

int sdl4gcj::mixer::Mixer::fadeInChannel int  channel,
Chunk  chunk,
int  loops,
int  fadeTime
[inline]
 

Play an audio chunk on a specific channel.

Same as fadeInChannel(channel, chunk, loops, fadeTime, -1);

Parameters:
channel a channel number, if channel is -1, paly on the first free channel.
chunk a chunk data
loops loop count. if loops is -1, infinity loop.
fadeTime fade in time (milisecond)

native int sdl4gcj::mixer::Mixer::fadeInChannel int  channel,
Chunk  chunk,
int  loops,
int  fadeTime,
int  ticks
 

Play an audio chunk on a specific channel.

Parameters:
channel a channel number, if channel is -1, paly on the first free channel.
chunk a chunk data
loops loop count. if loops is -1, infinity loop.
fadeTime fade in time (milisecond)
ticks playing time (milisecond)

void sdl4gcj::mixer::Mixer::fadeInMusic Music  music,
int  ticks
[inline]
 

Play the music with fadein effect.

same as fadeInMusic(music, -1, ticks) loop inifinitely

Parameters:
music music data
ticks milisecond

native void sdl4gcj::mixer::Mixer::fadeInMusic Music  music,
int  loops,
int  ticks
 

Play the music with fadein effect.

Parameters:
music music data
loops loop count
ticks milisecond

void sdl4gcj::mixer::Mixer::fadeInMusicPos Music  music,
int  ticks,
double  position
[inline]
 

Play the music with Fadein effect.

Same as fadeInMusicPos(music, -1, ticks, position);

Parameters:
music music data
ticks milisecond
position position
Returns:
0 on success, or -1 on error.

native void sdl4gcj::mixer::Mixer::fadeInMusicPos Music  music,
int  loops,
int  ticks,
double  position
 

Play the music with fadein effect.

Parameters:
music music data
loops loop count
ticks milisecond
position position
Returns:
0 on success, or -1 on error.

native int sdl4gcj::mixer::Mixer::fadeOutChannel int  channel,
int  ms
 

Set fade out effect for a particular channel.

Mix_FadeOutChannel(int channel, int ms);

Parameters:
channel Channel to fade out, or -1 to fade all channels out.
ms Milliseconds of time that the fade-out effect should take to go to silence, starting now.
Returns:
The number of channels set to fade out.

native int sdl4gcj::mixer::Mixer::fadeOutGroup int  tag,
int  ms
 

Set fade out effect for a particular group.

Mix_FadeOutGroup(int tag, int ms);

Parameters:
tag Group to fade out.
ms Milliseconds of time that the fade-out effect should take to go to silence, starting now.
Returns:
The number of channels set to fade out.

native int sdl4gcj::mixer::Mixer::fadeOutMusic int  ms  ) 
 

Set fade out effect music stream.

Mix_FadeOutMusic(int ms);

Parameters:
ms Milliseconds of time that the fade-out effect should take to go to silence, starting now.
Returns:
1 on success, 0 on failure.

native int sdl4gcj::mixer::Mixer::fadingChannel int  channel  ) 
 

Get fading status of specified channel.

Mix_FadingChannel(int channel)

Parameters:
channel Target channel
Returns:
Status of fading effect. It is one of the following.
  • MIX_NO_FADING
  • MIX_FADING_OUT
  • MIX_FADING_I

native int sdl4gcj::mixer::Mixer::fadingMusic  ) 
 

Get fading status of music stream.

Mix_FadingMusic(void)

Returns:

native int sdl4gcj::mixer::Mixer::getChannels  ) 
 

Get the actual number of audio channels.

This may or may not match the parameters you passed to openAudio().

Returns:
frequency of audio device.

native int sdl4gcj::mixer::Mixer::getFormat  ) 
 

Get the actual format of opened audio device .

This may or may not match the parameters you passed to openAudio().

Returns:
frequency of audio device.

native int sdl4gcj::mixer::Mixer::getFrequency  ) 
 

Get the actual frequency of opened audio device .

This may or may not match the parameters you passed to openAudio().

Returns:
frequency of audio device.

int sdl4gcj::mixer::Mixer::getVolume int  channel  )  [inline]
 

Get channel volume.

Parameters:
channel target channel
Returns:
current volume (0 - 128)

int sdl4gcj::mixer::Mixer::getVolumeMusic  )  [inline]
 

Get current music volume.

Same as volumeMusic(-1)

Returns:
current volume (0 - 128)

native int sdl4gcj::mixer::Mixer::groupAvailable int  tag  ) 
 

Find the first available (not playing) channel in group tag.

Parameters:
tag A group number Any positive numbers (including zero). -1 is the default group. Use -1 to remove a group tag essentially.
Returns:
The channel found on success. -1 is returned when no channels in the group are available.

native int sdl4gcj::mixer::Mixer::groupChannel int  channel,
int  tag
 

Add which channel to group tag.

Parameters:
channel Channel number of channels to assign tag to.
tag A group number Any positive numbers (including zero). -1 is the default group. Use -1 to remove a group tag essentially.
Returns:
1 on success. 0 is returned when the channel specified is invalid.

native int sdl4gcj::mixer::Mixer::groupChannels int  fromChannel,
int  toChannel,
int  tag
 

Add which channel to group tag.

Parameters:
fromChannel First Channel number of channels to assign tag to. Must be less or equal to to.
toChannel Last Channel number of channels to assign tag to. Must be greater or equal to from.
tag A group number Any positive numbers (including zero). -1 is the default group. Use -1 to remove a group tag essentially.
Returns:
1 on success. 0 is returned when the channel specified is invalid.

native int sdl4gcj::mixer::Mixer::groupCount int  tag  ) 
 

Count the number of channels in group tag.

Parameters:
tag A group number Any positive numbers (including zero). -1 is the default group. Use -1 to remove a group tag essentially.
Returns:
The number of channels found in the group. This function never fails.

native int sdl4gcj::mixer::Mixer::groupNewer int  tag  ) 
 

Find the newest, most recently started, actively playing channel in group tag.

Parameters:
tag A group number Any positive numbers (including zero). -1 is the default group. Use -1 to remove a group tag essentially.
Returns:
The channel found on success. -1 is returned when no channels in the group are playing or the group is empty.

native int sdl4gcj::mixer::Mixer::groupOldest int  tag  ) 
 

Find the oldest actively playing channel in group tag.

Parameters:
tag A group number Any positive numbers (including zero). -1 is the default group. Use -1 to remove a group tag essentially.
Returns:
The channel found on success. -1 is returned when no channels in the group are playing or the group is empty.

native int sdl4gcj::mixer::Mixer::haltChannel int  channel  ) 
 

Halt playing of a specified channel.

Parameters:
channel target channel
Returns:
??

native int sdl4gcj::mixer::Mixer::haltGroup int  tag  ) 
 

Halt playing of a specified group.

Parameters:
tag target group
Returns:
??

native int sdl4gcj::mixer::Mixer::haltMusic  ) 
 

Halt music playing.

Returns:
??

static Mixer sdl4gcj::mixer::Mixer::openAudio  )  [inline, static]
 

static Mixer sdl4gcj::mixer::Mixer::openAudio int  chunksize  )  [inline, static]
 

Initialize audio device and mixer.

Same as Mixer.openAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, chunksize);

Parameters:
chunksize Bytes used per output sample.
Returns:
mixer object.

static native Mixer sdl4gcj::mixer::Mixer::openAudio int  frequency,
int  format,
int  channels,
int  chunksize
[static]
 

Initialize audio device and mixer.

Parameters:
frequency Output sampling frequency in samples per second (Hz).
format Output sample format. Use one of following constants.
  • AUDIO_U8
  • AUDIO_S8
  • AUDIO_U16LSB
  • AUDIO_S16LSB
  • AUDIO_U16MSB
  • AUDIO_S16MSB
  • AUDIO_U16
  • AUDIO_S16
channels 1(mono) or 2(stereo)
chunksize Bytes used per output sample.
Returns:
mixer object.

native void sdl4gcj::mixer::Mixer::pause int  channel  ) 
 

Pause specified channel.

Parameters:
channel target channel

native boolean sdl4gcj::mixer::Mixer::paused int  channel  ) 
 

Get pause status of a specified channel.

Parameters:
channel target channel
Returns:
Return the pause status of a specified channel

native boolean sdl4gcj::mixer::Mixer::pausedMusic  ) 
 

Get pause status of music stream.

Returns:
Return the pause status of music stream.

native void sdl4gcj::mixer::Mixer::pauseMusic  ) 
 

Pause music stream.

int sdl4gcj::mixer::Mixer::playChannel Chunk  chunk  )  [inline]
 

Play an audio chunk on a first free channel.

Same as playChannel(-1, chunk, 0, -1);

Parameters:
chunk chunk data

int sdl4gcj::mixer::Mixer::playChannel Chunk  chunk,
int  loops
[inline]
 

Play an audio chunk on a first free channel.

Same as playChannel(-1, chunk, loops, -1);

Parameters:
chunk chunk data
loops loop count. if loops is -1, infinity loop.

int sdl4gcj::mixer::Mixer::playChannel int  channel,
Chunk  chunk,
int  loops
[inline]
 

Play an audio chunk on a specified channel.

Same as playChannel(channel, chunk, loops, -1);

Parameters:
channel a channel number, if channel is -1, paly on the first free channel.
chunk chunk data
loops loop count. if loops is -1, infinity loop.

int sdl4gcj::mixer::Mixer::playChannel Chunk  chunk,
int  loops,
int  ticks
[inline]
 

Play an audio chunk on a first free channel.

Same as playChannel(-1, chunk, loops, ticks);

Parameters:
chunk chunk data
loops loop count. if loops is -1, infinity loop.
ticks milisecond

native int sdl4gcj::mixer::Mixer::playChannel int  channel,
Chunk  chunk,
int  loops,
int  ticks
 

Play an audio chunk on a specific channel.

Parameters:
channel a channel number, if channel is -1, paly on the first free channel.
chunk a chunk data
loops loop count. if loops is -1, infinity loop.
ticks playing time milisecond

boolean sdl4gcj::mixer::Mixer::playing  )  [inline]
 

Check the status of all channels.

Same as playing(-1)

native boolean sdl4gcj::mixer::Mixer::playing int  channel  ) 
 

Check the status of specified channel.

If the specified channel is -1, check all channels.

Parameters:
channel target channel.
Returns:
status playing status specified channel

native boolean sdl4gcj::mixer::Mixer::playingMusic  ) 
 

Check the status of music playing.

void sdl4gcj::mixer::Mixer::playMusic Music  music  )  [inline]
 

Play the music.

Same as playMusic(music, -1);

Parameters:
music music data

native void sdl4gcj::mixer::Mixer::playMusic Music  music,
int  loops
 

Play an audio chunk on a first free channel.

Parameters:
music music data
loops loop count if loops is -1, infinity loop.

native int sdl4gcj::mixer::Mixer::reserveChannels int  num  ) 
 

Reserve the first channels (0 - n-1) for the application,.

Parameters:
num number of channels

native void sdl4gcj::mixer::Mixer::resume int  channel  ) 
 

Resume specified channel.

Parameters:
channel target channel

native void sdl4gcj::mixer::Mixer::resumeMusic  ) 
 

Resume music stream.

native void sdl4gcj::mixer::Mixer::rewindMusic  ) 
 

Rewind music stream.

native void sdl4gcj::mixer::Mixer::setDistance int  channel,
short  distance
 

Set distance filer.

Parameters:
channel target channel
distance distance value between 0 and 255 that specifies the space between the sound and the listener.

native void sdl4gcj::mixer::Mixer::setMusicPosition double  position  ) 
 

Set position of playback in stream.

native void sdl4gcj::mixer::Mixer::setPanning int  channel,
short  left,
short  right
 

Set panning filer.

Parameters:
channel target channel
left left value (0 - 255)
right right value (0 - 255)

native void sdl4gcj::mixer::Mixer::setPosition int  channel,
short  angle,
short  distance
 

Set position filer.

Parameters:
channel target channel
angle angle 0 - 360
distance distance value between 0 and 255 that specifies the space between the sound and the listener.

native void sdl4gcj::mixer::Mixer::setReverseStereo int  channel,
boolean  flip
 

Set reverse stereo.

Parameters:
channel target channel
flip flip flag

void sdl4gcj::mixer::Mixer::setVolume int  volume  )  [inline]
 

Set volume for all channels.

same as valume(-1, volume);

Parameters:
volume new volume (0 - 128)

void sdl4gcj::mixer::Mixer::setVolumeMusic int  volume  )  [inline]
 

Set music volume.

Same as volumeMusic(volume)

Parameters:
volume new volume (0 - 128)

native int sdl4gcj::mixer::Mixer::volume int  channel,
int  volume
 

Set channel volume.

If the volume is out of range, this method do nothing.

Parameters:
channel target channel
volume new volume (0 - 128)
Returns:
original volume (0 - 128)

native int sdl4gcj::mixer::Mixer::volumeMusic int  volume  ) 
 

Set music volume.

Parameters:
volume new volume (0 - 128)
Returns:
original volume (0 - 128)


The documentation for this class was generated from the following file:
Generated on Sun Oct 16 15:28:56 2005 for sdl4gcj by  doxygen 1.4.3