Yukino::Audio Class Reference

Class that manages the audio system. More...

#include <Audio.h>

List of all members.

Public Member Functions

UINT Init (int frequency, word format, int channels, int chunksize)
 Function to initialize the object Audio.
void Release (void)
 Function to finalize the object Audio.
UINT SetNumChannels (int channels)
 Function to change the number of channels of the audio.
int GetNumChannels (void)
 Function to obtain the number of channels of the audio.
word GetFormat (void)
 Function to obtain the format of the audio.
int GetFrequency (void)
 Function to obtain the frequency of the audio.
UINT SetVolume (int volume)
 Function to change the volume of the audio.
int GetVolume (void)
 Function to obtain the volume of the audio.
UINT SetChannelVolume (int channel, int volume)
 Function to change the volume of a channel.
int GetChannelVolume (int channel)
 Function to obtain the volume of a channel.
UINT SetChannelPan (int channel, byte left, byte right)
 Function to change the panning of a channel.
UINT DelChannelPan (int channel)
 Function to delete the panning of a channel.
UINT PlaySound (Sound &snd, int loops=PLAY_ONCE)
 Function to play a sound in a channel.
UINT PlaySound (Sound &snd, int channel, int loops)
 Function to play a sound in a channel.
UINT FadeInSound (Sound &snd, int ms, int loops=PLAY_ONCE)
 Function to play a sound in a channel with fade in.
UINT FadeInSound (Sound &snd, int ms, int channel, int loops)
 Function to play a sound in a channel with fade in.
void PauseSound (Sound &snd)
 Function to pause a sound of a channel.
void PauseChannel (int channel)
 Function to pause a channel.
void PauseAudio (void)
 Function to pause the audio.
void ResumeSound (Sound &snd)
 Function to resume a sound of a channel.
void ResumeChannel (int channel)
 Function to resume a channel.
void ResumeAudio (void)
 Function to resume the audio.
void StopSound (Sound &snd)
 Function to stop a sound of a channel.
void StopChannel (int channel)
 Function to stop a channel.
void StopAudio (void)
 Function to stop the audio.
void FadeOutSound (Sound &snd, int ms)
 Function to stop a sound of a channel with fade out.
void FadeOutChannel (int channel, int ms)
 Function to stop a channel with fade out.
void FadeOutAudio (int ms)
 Function to stop the audio with fade out.
bool IsPlayingSound (Sound &snd)
 Function to ask if a sound is playing.
bool IsPlayingChannel (int channel)
 Function to ask if a channel is playing.
bool IsPausedSound (Sound &snd)
 Function to ask if a sound is paused.
bool IsPausedChannel (int channel)
 Function to ask if a channel is paused.

Static Public Member Functions

static AudioGetInstance (void)
 Function to obtain the instance of Audio.


Detailed Description

Class that manages the audio system.

The Audio class manages the subjects related to the system of audio, such as to handle the channels of the application. Being able to reproduce, to pause or to stop sounds in these channels, and other effects like fade in and fade out.


Member Function Documentation

UINT Yukino::Audio::DelChannelPan ( int  channel  ) 

Function to delete the panning of a channel.

This function serves to delete the panning of a channel.

Parameters:
channel Channel number.
See also:
SetChannelPan().
Returns:
If everything goes well returns 0, on errors returns: AUDIO_ERROR_SETPAN.

UINT Yukino::Audio::FadeInSound ( Sound snd,
int  ms,
int  channel,
int  loops 
)

Function to play a sound in a channel with fade in.

This function serves to play a sound in a channel with fade in.

Parameters:
snd Sound to play.
ms Number of milliseconds for fade in.
channel Channel number.
loops Number of loops.
See also:
PlaySound(), PauseSound(), ResumeSound(), StopSound(), FadeOutSound(), IsPlayingSound(), IsPausedSound().
Returns:
If everything goes well returns 0, on errors returns: AUDIO_ERROR_FADEINSOUND.

UINT Yukino::Audio::FadeInSound ( Sound snd,
int  ms,
int  loops = PLAY_ONCE 
)

Function to play a sound in a channel with fade in.

This function serves to play a sound in a channel with fade in.

Parameters:
snd Sound to play.
ms Number of milliseconds for fade in.
loops Number of loops.
See also:
PlaySound(), PauseSound(), ResumeSound(), StopSound(), FadeOutSound(), IsPlayingSound(), IsPausedSound().
Returns:
If everything goes well returns 0, on errors returns: AUDIO_ERROR_FADEINSOUND.

void Yukino::Audio::FadeOutAudio ( int  ms  )  [inline]

Function to stop the audio with fade out.

This function serves to stop the audio with fade out.

Parameters:
ms Number of milliseconds for fade out.
See also:
PauseAudio(), ResumeAudio(), StopAudio().

void Yukino::Audio::FadeOutChannel ( int  channel,
int  ms 
) [inline]

Function to stop a channel with fade out.

This function serves to stop a channel with fade out.

Parameters:
channel Channel to stop.
ms Number of milliseconds for fade out.
See also:
PauseChannel(), ResumeChannel(), StopChannel(), IsPlayingChannel(), IsPausedChannel().

void Yukino::Audio::FadeOutSound ( Sound snd,
int  ms 
) [inline]

Function to stop a sound of a channel with fade out.

This function serves to stop a sound of a channel with fade out.

Parameters:
snd Sound to stop.
ms Number of milliseconds for fade out.
See also:
PlaySound(), FadeInSound(), PauseSound(), ResumeSound(), StopSound(), IsPlayingSound(), IsPausedSound().

int Yukino::Audio::GetChannelVolume ( int  channel  )  [inline]

Function to obtain the volume of a channel.

This function serves to obtain the volume of a channel.

Parameters:
channel Channel number.
See also:
SetChannelVolume().
Returns:
The volume of a channel.

word Yukino::Audio::GetFormat ( void   )  [inline]

Function to obtain the format of the audio.

This function serves to obtain the format of the audio.

Returns:
The format of the audio.

int Yukino::Audio::GetFrequency ( void   )  [inline]

Function to obtain the frequency of the audio.

This function serves to obtain the frequency of the audio.

Returns:
The frequency of the audio.

Audio * Yukino::Audio::GetInstance ( void   )  [static]

Function to obtain the instance of Audio.

This function creates an instance of Audio, in case of not being created, and gives back a pointer of this if memory is successful requesting.

Returns:
It gives back to a pointer to the object Audio if everything has gone well, if there is no memory for the object, gives back NULL.

int Yukino::Audio::GetNumChannels ( void   )  [inline]

Function to obtain the number of channels of the audio.

This function serves to obtain the number of channels of the audio.

See also:
SetNumChannels().
Returns:
The number of channels of the audio.

int Yukino::Audio::GetVolume ( void   )  [inline]

Function to obtain the volume of the audio.

This function serves to obtain the volume of the audio.

See also:
SetVolume().
Returns:
The volume of the audio.

UINT Yukino::Audio::Init ( int  frequency,
word  format,
int  channels,
int  chunksize 
)

Function to initialize the object Audio.

This function serves to initialize the object Audio, passing to him the frequency, the format, the number of channels and the buffer's size.

Parameters:
frequency Audio's frequency.
format Audio's format.
channels Audio's channels's number.
chunksize Audio's buffer's size.
See also:
Release().
Returns:
If everything goes well returns 0, on errors returns: AUDIO_ERROR_OPEN, AUDIO_ERROR_QUERYSPEC, AUDIO_ERROR_NOTEQU.

bool Yukino::Audio::IsPausedChannel ( int  channel  )  [inline]

Function to ask if a channel is paused.

This function serves to ask if a channel is paused.

Parameters:
channel Channel to ask.
See also:
PauseChannel(), ResumeChannel(), StopChannel(), FadeOutChannel(), IsPlayingChannel().
Returns:
If it gives back true, the channel is paused.

bool Yukino::Audio::IsPausedSound ( Sound snd  )  [inline]

Function to ask if a sound is paused.

This function serves to ask if a sound is paused.

Parameters:
snd Sound to ask.
See also:
PlaySound(), FadeInSound(), PauseSound(), ResumeSound(), StopSound(), FadeOutSound(), IsPlayingSound().
Returns:
If it gives back true, the sound is paused.

bool Yukino::Audio::IsPlayingChannel ( int  channel  )  [inline]

Function to ask if a channel is playing.

This function serves to ask if a channel is playing.

Parameters:
channel Channel to ask.
See also:
PauseChannel(), ResumeChannel(), StopChannel(), FadeOutChannel(), IsPausedChannel().
Returns:
If it gives back true, the channel is playing.

bool Yukino::Audio::IsPlayingSound ( Sound snd  )  [inline]

Function to ask if a sound is playing.

This function serves to ask if a sound is playing.

Parameters:
snd Sound to ask.
See also:
PlaySound(), FadeInSound(), PauseSound(), ResumeSound(), StopSound(), FadeOutSound(), IsPausedSound().
Returns:
If it gives back true, the sound is playing.

void Yukino::Audio::PauseAudio ( void   )  [inline]

Function to pause the audio.

This function serves to pause the audio.

See also:
ResumeAudio(), StopAudio(), FadeOutAudio().

void Yukino::Audio::PauseChannel ( int  channel  )  [inline]

Function to pause a channel.

This function serves to pause a channel.

Parameters:
channel Channel to pause.
See also:
ResumeChannel(), StopChannel(), FadeOutChannel(), IsPlayingChannel(), IsPausedChannel().

void Yukino::Audio::PauseSound ( Sound snd  )  [inline]

Function to pause a sound of a channel.

This function serves to pause a sound of a channel.

Parameters:
snd Sound to pause.
See also:
PlaySound(), FadeInSound(), ResumeSound(), StopSound(), FadeOutSound(), IsPlayingSound(), IsPausedSound().

UINT Yukino::Audio::PlaySound ( Sound snd,
int  channel,
int  loops 
)

Function to play a sound in a channel.

This function serves to play a sound in a channel.

Parameters:
snd Sound to play.
channel Channel number.
loops Number of loops.
See also:
FadeInSound(), PauseSound(), ResumeSound(), StopSound(), FadeOutSound(), IsPlayingSound(), IsPausedSound().
Returns:
If everything goes well returns 0, on errors returns: AUDIO_ERROR_PLAYSOUND.

UINT Yukino::Audio::PlaySound ( Sound snd,
int  loops = PLAY_ONCE 
)

Function to play a sound in a channel.

This function serves to play a sound in a channel.

Parameters:
snd Sound to play.
loops Number of loops.
See also:
FadeInSound(), PauseSound(), ResumeSound(), StopSound(), FadeOutSound(), IsPlayingSound(), IsPausedSound().
Returns:
If everything goes well returns 0, on errors returns: AUDIO_ERROR_PLAYSOUND.

void Yukino::Audio::Release ( void   ) 

Function to finalize the object Audio.

This function serves to finalize the object Audio.

See also:
Init().

void Yukino::Audio::ResumeAudio ( void   )  [inline]

Function to resume the audio.

This function serves to resume the audio.

See also:
PauseAudio(), StopAudio(), FadeOutAudio().

void Yukino::Audio::ResumeChannel ( int  channel  )  [inline]

Function to resume a channel.

This function serves to resume a channel.

Parameters:
channel Channel to resume.
See also:
PauseChannel(), StopChannel(), FadeOutChannel(), IsPlayingChannel(), IsPausedChannel().

void Yukino::Audio::ResumeSound ( Sound snd  )  [inline]

Function to resume a sound of a channel.

This function serves to resume a sound of a channel.

Parameters:
snd Sound to resume.
See also:
PlaySound(), FadeInSound(), PauseSound(), StopSound(), FadeOutSound(), IsPlayingSound(), IsPausedSound().

UINT Yukino::Audio::SetChannelPan ( int  channel,
byte  left,
byte  right 
)

Function to change the panning of a channel.

This function serves to change the panning of a channel.

Parameters:
channel Channel number.
left Level in the left.
right Level in the right.
See also:
DelChannelPan().
Returns:
If everything goes well returns 0, on errors returns: AUDIO_ERROR_SETPAN.

UINT Yukino::Audio::SetChannelVolume ( int  channel,
int  volume 
)

Function to change the volume of a channel.

This function serves to change the volume of a channel.

Parameters:
channel Channel number.
volume New volume.
See also:
GetChannelVolume().
Returns:
If everything goes well returns 0, on errors returns: AUDIO_ERROR_SETVOLUME.

UINT Yukino::Audio::SetNumChannels ( int  channels  ) 

Function to change the number of channels of the audio.

This function serves to change the number of channels of the audio.

Parameters:
channels Number of new channels.
See also:
GetNumChannels().
Returns:
If everything goes well returns 0, on errors returns: AUDIO_ERROR_ALLOCATE.

UINT Yukino::Audio::SetVolume ( int  volume  ) 

Function to change the volume of the audio.

This function serves to change the volume of the audio.

Parameters:
volume New volume.
See also:
GetVolume().
Returns:
If everything goes well returns 0, on errors returns: AUDIO_ERROR_SETVOLUME.

void Yukino::Audio::StopAudio ( void   )  [inline]

Function to stop the audio.

This function serves to stop the audio.

See also:
PauseAudio(), ResumeAudio(), FadeOutAudio().

void Yukino::Audio::StopChannel ( int  channel  )  [inline]

Function to stop a channel.

This function serves to stop a channel.

Parameters:
channel Channel to stop.
See also:
PauseChannel(), ResumeChannel(), FadeOutChannel(), IsPlayingChannel(), IsPausedChannel().

void Yukino::Audio::StopSound ( Sound snd  )  [inline]

Function to stop a sound of a channel.

This function serves to stop a sound of a channel.

Parameters:
snd Sound to stop.
See also:
PlaySound(), FadeInSound(), PauseSound(), ResumeSound(), FadeOutSound(), IsPlayingSound(), IsPausedSound().


The documentation for this class was generated from the following files:
Generated on Sun Jun 25 03:43:36 2006 for Yukino by  doxygen 1.4.7