◆ DecrementCount()
| virtual GReturn GW::AUDIO::GMusic::DecrementCount |
( |
| ) |
|
|
pure virtual |
Decrease the total number of active references to this object.
Once the internal count reaches zero this object will be deallocated and your pointer will become invalid.
- Return values
-
| SUCCESS | Successfully decremented the internal reference count. |
| FAILURE | Decrementing of internal reference count would underflow the value. |
Implements GW::CORE::GInterface.
◆ GetCount()
| virtual GReturn GW::AUDIO::GMusic::GetCount |
( |
unsigned int & |
_outCount | ) |
|
|
pure virtual |
Return the total number of active references to this object.
- Parameters
-
| [out] | _outCount | The total number of active references of this object. |
- Return values
-
| SUCCESS | Successfully ran. |
| FAILURE | Either class does not exist or the internal reference count is corrupt. |
Implements GW::CORE::GInterface.
◆ GetStreamOutputChannels()
| virtual GReturn GW::AUDIO::GMusic::GetStreamOutputChannels |
( |
unsigned int & |
returnedChannelNum | ) |
|
|
pure virtual |
Stores the number of specified outputs into the passed in unsigned int.
This value is obtained from the GAudio that created this GMusic. By default the number of output channels is 2 unless GAudio was created with a different amount.
- Parameters
-
| [out] | The | unsigned int which will be stored with the value. |
- Return values
-
| FAILURE | GAudio has not filled out this object with GAudio's fuunction: "CreateMusicStream". |
| SUCCESS | Successfully ran without running into any of the above issues. |
◆ GetStreamSourceChannels()
| virtual GReturn GW::AUDIO::GMusic::GetStreamSourceChannels |
( |
unsigned int & |
returnedChannelNum | ) |
|
|
pure virtual |
Stores the .wav files internal amount of channels the sound was recorded with into the passed in unsigned int.
This value is read and stored upon creation of GMusic.
- Parameters
-
| [out] | The | unsigned int which will be stored with the value. |
- Return values
-
| FAILURE | GAudio has not filled out this object with GAudio's fuunction: "CreateMusicStream". |
| SUCCESS | Successfully ran without running into any of the above issues. |
◆ IncrementCount()
| virtual GReturn GW::AUDIO::GMusic::IncrementCount |
( |
| ) |
|
|
pure virtual |
Increase the total number of active references to this object.
End users should only call this operation if they are familiar with reference counting behavior.
- Return values
-
| SUCCESS | Successfully incremented the internal reference count. |
| FAILURE | Incrementation of internal reference count would overflow the value. |
Implements GW::CORE::GInterface.
◆ isStreamPlaying()
| virtual GReturn GW::AUDIO::GMusic::isStreamPlaying |
( |
bool & |
_returnedBool | ) |
|
|
pure virtual |
Fills out the passed in bool with information as to if the music stream is playing or not.
GMusic internally keeps track of whether or not it playing via the launched thread, as well as the Start/Pause/Resume/Stop functions.
- Parameters
-
| [out] | The | bool which will be stored with the value. |
- Return values
-
| SUCCESS | Always, boolean passed in will tell you if music is playing or not. |
◆ PauseStream()
| virtual GReturn GW::AUDIO::GMusic::PauseStream |
( |
| ) |
|
|
pure virtual |
Attempts to pause a currently playing music stream.
Currenntly only supports .wav files. If a stream is currently paused, will not attempt to pause playback without returning an error.
- Parameters
-
◆ RequestInterface()
| virtual GReturn GW::AUDIO::GMusic::RequestInterface |
( |
const GUUIID & |
_interfaceID, |
|
|
void ** |
_outputInterface |
|
) |
| |
|
pure virtual |
Requests an interface that may or may not be supported by this object.
Can be used by the end-user to query for a new interface using the unique ID of the interface they want and implement an interface update.
- Parameters
-
| [in] | _interfaceID | The GUUIID of the interface you are requesting. |
| [out] | _outputInterface | Where the interface will be stored if function is successful. |
- Return values
-
| SUCCESS | The interface is supported and function succeded. |
| INTERFACE_UNSUPPORTED | The requested interface is not supported. |
Implements GW::CORE::GInterface.
◆ ResumeStream()
| virtual GReturn GW::AUDIO::GMusic::ResumeStream |
( |
| ) |
|
|
pure virtual |
Attempts to resume a currently paused music stream.
Currenntly only supports .wav files. If a music stream is currently playing, will not attempt to play file without returning an error.
- Return values
-
| FAILURE | GAudio has not filled out this object with GAudio's fuunction: "CreateMusicStream". |
| FAILURE | If internal object incounters an error. Unlikely to occur if GAudio's "CreateMusicStream" did not return an error upon filling out this object. |
| SUCCESS | Successfully ran without running into any of the above issues. |
◆ SetChannelVolumes()
| virtual GReturn GW::AUDIO::GMusic::SetChannelVolumes |
( |
float * |
_values, |
|
|
int |
_numChannels |
|
) |
| |
|
pure virtual |
Attempts to set the output volume for the specified number of outputs to the passed in values.
The amount of values in _values that will be used is based on _numChannels. If you attempt to set the volume of an output your hardware does not support, it will be ignored. If you attempt to set a volume higher that GAudio's master volume, it will be set to the master volume without an error message.
Channels: Supports up to 6 channels AKA 5.1 Audio: INDEX[0] = Left, INDEX[1] = Right, INDEX[2] = Front Center, INDEX[3] = LFE, INDEX[4] = Rear Left, INDEX[5] = Rear Right,
- Parameters
-
| [in] | _values | The output volumes to be set. |
| [in] | _numChannels | The number of channels affected. |
- Return values
-
| FAILURE | _numChannels is less than 1. |
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateMusicStream". |
| FAILURE | If internal object incounters an error. Could occur if GAudio's number of outputs changed durring runtime. |
| FAILURE | _values is NULL |
| FAILURE | _values tried to read garbadge data - (_numChannels > amoutn of values in _values) |
| SUCCESS | Successfully ran without running into any of the above issues. |
◆ SetVolume()
| virtual GReturn GW::AUDIO::GMusic::SetVolume |
( |
float |
_newVolume | ) |
|
|
pure virtual |
Attempts to change the overall volume.
If you attempt to set a volume higher that GAudio's master volume, it will be set to the master volume without an error message.
- Parameters
-
| [in] | _newVolume | The output volume to be set. |
- Return values
-
| FAILURE | GAudio has not filled out this object with GAudio's fuunction: "CreateMusicStream". |
| FAILURE | _newVolume is less than Zero. |
| FAILURE | If internal object incounters an error. Unlikely to occur if GAudio's "CreateMusicStream" did not return an error upon filling out this object. * |
| SUCCESS | Successfully ran without running into any of the above issues. |
| SUCCESS | Successfully ran without running into any of the above issues. |
◆ StopStream()
| virtual GReturn GW::AUDIO::GMusic::StopStream |
( |
| ) |
|
|
pure virtual |
Attempts to stop playback of a music stream and reset it to begining for future use.
Currenntly only supports .wav files. Tells the previously launched thread to stop, calls join on it, and resets thread for future use. Will attempt to comppletely stop playback regaurdless of whether or not music is playing or paused.
- Return values
-
| FAILURE | GAudio has not filled it out this object with GAudio's fuunction: "CreateMusicStream". |
| FAILURE | If internal object incounters an error. Unlikely to occur if GAudio's "CreateMusicStream" did not return an error upon filling out this object. |
| SUCCESS | Successfully ran without running into any of the above issues. |
◆ StreamStart()
| virtual GReturn GW::AUDIO::GMusic::StreamStart |
( |
bool |
_loop = false | ) |
|
|
pure virtual |
Attempts to start a music stream.
Currenntly only supports .wav files. Upon Succession will launch a new thread that will continously read in audio data from file. If a thread already has been launched, will not attempt to launch new thread without returning an error.
- Return values
-
| FAILURE | GAudio has not filled out this object with GAudio's fuunction: "CreateMusicStream". |
| FAILURE | If specified .wav file could not be found or encountered an error upon reading in data (This happens when "CreateMusicStream" fills out data). |
| FAILURE | If internal object incounters an error. Unlikely to occur if GAudio's "CreateMusicStream" did not return an error upon filling out this object. |
| SUCCESS | Successfully ran without running into any of the above issues. |
The documentation for this class was generated from the following file: