◆ CreateMusicStream()
| virtual GReturn GW::AUDIO::GAudio::CreateMusicStream |
( |
const char * |
_path, |
|
|
GMusic ** |
_outMusic |
|
) |
| |
|
pure virtual |
Fills out a GMusic with data from provided .wav file.
Creates a GMusic to return, attempts to initallize internal variables, and loads header information from .wav file for setup.
- Return values
-
| FAILURE | An error occurred durring loading of header information. |
| FAILURE | Internal objects could not be created. (On Windows these are the source voice and submix voice, on other platforms this is all in GSound's init). |
| FAILURE | Failed to initialize internal variables. See Below for Platform On Linux pa_main_loop or pa_context could not be created, pa_context could not be connected, pa_channel_map could not be created, pa_stream could not be created, or pa_stream could not be connected. On Mac AvAudioPlayerNode could not be created or AvAudioPCMBuffers could not be initialized |
| SUCCESS | None of the above errors occured. |
◆ CreateSound()
| virtual GReturn GW::AUDIO::GAudio::CreateSound |
( |
const char * |
_path, |
|
|
GSound ** |
_outSound |
|
) |
| |
|
pure virtual |
Fills out a GSound with data from provided .wav file.
Creates a GSound to return, attempts to initallize internal variables, and loads audio fully into memeory.
- Return values
-
| FAILURE | An error occurred durring loading of file. |
| FAILURE | Internal objects could not be created. (On Windows these are the source voice and submix voice, on other platforms this is all in GSound's init). |
| FAILURE | Failed to initialize internal variables. See Below for Platform On Linux pa_main_loop or pa_context could not be created, pa_context could not be connected, pa_channel_map could not be created, pa_stream could not be created, or pa_stream could not be connected. On Mac AvAudioPlayerNode could not be created or could not read in file. |
| SUCCESS | None of the above errors occured. |
◆ DecrementCount()
| virtual GReturn GW::AUDIO::GAudio::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::GAudio::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.
◆ IncrementCount()
| virtual GReturn GW::AUDIO::GAudio::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.
◆ Init()
| virtual GReturn GW::AUDIO::GAudio::Init |
( |
int |
_numOfOutputs = 2 | ) |
|
|
pure virtual |
Initializes all neccassary data for GAudio based on platform.
On Windows, initilaizes XAudio2 pointers IXAudio2 and IXAudio2MasteringVoice. On Mac, initilaizes AVAudioEngine and starts the engine.
- Parameters
-
| [in] | _numOfOutputs | The number of outputs (i.e. channels or speakers) GAudio should have control over. Default is two. Will be two on Mac and Linux currently. |
- Return values
-
| FAILURE | on if _numOfOutputs greater than |
| SUCCESS | on Windows if xAudio2 is able to setup correctly. |
| FAILURE | on Windows if it cannot coinitilaize. |
| FAILURE | on Windows if it xAudio2Create fails. |
| FAILURE | on Windows if it xAudio fails to create mastering voice. |
| SUCCESS | on Mac if AVAudioEngine is able to setup correctly. |
| FAILURE | on Mac if AVAudioEngine is able to setup correctly. |
| SUCCESS | on Linux Always. |
| REDUNDANT_OPERATION | tbd |
◆ PauseAll()
| virtual GReturn GW::AUDIO::GAudio::PauseAll |
( |
| ) |
|
|
pure virtual |
Sets Pauses all sounds and music.
Calls each created sound's and music pause function.
- Return values
-
| FAILURE | A sound or Music returned FAILURE
|
| SUCCESS | Successfully ran without running into any of the above issues. |
◆ RequestInterface()
| virtual GReturn GW::AUDIO::GAudio::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.
◆ ResumeAll()
| virtual GReturn GW::AUDIO::GAudio::ResumeAll |
( |
| ) |
|
|
pure virtual |
Resumes all paused/stoped sounds and music.
Calls each created sound's and music resume function.
- Return values
-
| FAILURE | A sound or Music returned FAILURE |
| SUCCESS | Successfully ran without running into any of the above issues. |
◆ SetMasterChannelVolumes()
| virtual GReturn GW::AUDIO::GAudio::SetMasterChannelVolumes |
( |
const float * |
_values, |
|
|
int |
_numChannels |
|
) |
| |
|
pure virtual |
Sets Master Volume for all sounds and music for specifc speakers.
The amount of values in _values that will be used is based on _numChannels. After setting this, created sounds and music will check if their current volumes are higher than passed in values and will set them to the new master volumes if they are above. If you attempt to set the volume of an output your hardware does not support, it will be ignored.
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 | _values is NULL
|
| SUCCESS | Successfully ran without running into any of the above issues. |
◆ SetMasterVolume()
| virtual GReturn GW::AUDIO::GAudio::SetMasterVolume |
( |
float |
_value | ) |
|
|
pure virtual |
Sets Master Volume for all sounds and music.
After setting this, created sounds and music will check if their current volume are higher than passed in value and will set them to the new master volume if they are above.
- Parameters
-
| [in] | _value | The output master volume to be set. |
- Return values
-
| FAILURE | _newVolume is less than Zero. |
| SUCCESS | Successfully ran without running into any of the above issues. |
◆ StopAll()
| virtual GReturn GW::AUDIO::GAudio::StopAll |
( |
| ) |
|
|
pure virtual |
Stops all paused/playing sounds and music.
Calls each created sound's and music stop function.
- Return values
-
| FAILURE | A sound or Music returned FAILURE |
| SUCCESS | Successfully ran without running into any of the above issues. |
The documentation for this class was generated from the following file: