|
GlistEngine
|
A sound class using miniaudio with ma_engine and ma_sound. More...
#include <gSound.h>


Public Member Functions | |
| gSound () | |
| virtual | ~gSound () |
| int | load (const std::string &fullPath) override |
| Loads a sound file from the full file system path. | |
| int | loadSound (const std::string &soundPath) override |
| Loads the sound file from the given project-relative path. | |
| void | play () override |
| Starts sound playback and resets the position to the beginning. | |
| bool | isLoaded () override |
| bool | isPlaying () override |
| bool | isPaused () override |
| void | setPaused (bool isPaused) override |
| Pauses or resumes the playback. | |
| void | stop () override |
| Stops playback and resets position to the beginning. | |
| void | close () override |
| Unloads and frees the sound resource. | |
| int | getDuration () override |
| Returns the total duration of the sound in milliseconds. | |
| int | getPosition () override |
| Returns the current playback position in milliseconds. | |
| void | setPosition (int position) override |
| Sets the current playback position in milliseconds. | |
| LoopType | getLoopType () override |
| void | setLoopType (LoopType loopType) override |
| Sets the loop type for playback. | |
| float | getVolume () override |
| Gets the current volume level. | |
| void | setVolume (float volume) override |
| Sets the volume level. | |
| const std::string & | getPath () override |
| Gets the path to the currently loaded file. | |
Public Member Functions inherited from gObject | |
| gObject () | |
| void | logi (std::string message) |
| void | logd (std::string message) |
| void | logw (std::string message) |
| void | loge (std::string message) |
| void | logi (std::string tag, std::string message) |
| void | logd (std::string tag, std::string message) |
| void | logw (std::string tag, std::string message) |
| void | loge (std::string tag, std::string message) |
Additional Inherited Members | |
Public Types inherited from gBaseSound | |
| enum | LoopType : int { LOOPTYPE_DEFAULT = 0 , LOOPTYPE_NONE = 1 , LOOPTYPE_NORMAL = 2 } |
Static Public Member Functions inherited from gObject | |
| static std::string | gGetAppDir () |
| static std::string | gGetAssetsDir () |
| static void | gSetAssetsDir (std::string assetsDir) |
| static std::string | gGetFilesDir () |
| static std::string | gGetImagesDir () |
| static std::string | gGetFontsDir () |
| static std::string | gGetModelsDir () |
| static std::string | gGetTexturesDir () |
| static std::string | gGetShadersDir () |
| static std::string | gGetSoundsDir () |
| static std::string | gGetDatabasesDir () |
| static std::string | gGetVideosDir () |
| static void | setCurrentResolution (int scalingNo, int currentResolutionNo) |
Static Public Attributes inherited from gObject | |
| static const int | LOGLEVEL_SILENT |
| static const int | LOGLEVEL_DEBUG |
| static const int | LOGLEVEL_INFO |
| static const int | LOGLEVEL_WARNING |
| static const int | LOGLEVEL_ERROR |
Static Protected Attributes inherited from gObject | |
| static int | renderpassnum |
| static int | renderpassno |
| static int | releasescaling |
| static int | releaseresolution |
A sound class using miniaudio with ma_engine and ma_sound.
This class wraps a miniaudio ma_sound object and provides functions for loading, playing, pausing, stopping, seeking, and controlling volume and looping. Multiple gSound instances can be played simultaneously.
| gSound::gSound | ( | ) |
|
virtual |
|
overridevirtual |
Unloads and frees the sound resource.
Implements gBaseSound.
|
overridevirtual |
Returns the total duration of the sound in milliseconds.
Implements gBaseSound.
|
overridevirtual |
Implements gBaseSound.
|
overridevirtual |
Gets the path to the currently loaded file.
Implements gBaseSound.
|
overridevirtual |
Returns the current playback position in milliseconds.
Implements gBaseSound.
|
overridevirtual |
Gets the current volume level.
Implements gBaseSound.
|
overridevirtual |
Implements gBaseSound.
|
overridevirtual |
Implements gBaseSound.
|
overridevirtual |
Implements gBaseSound.
|
overridevirtual |
Loads a sound file from the full file system path.
| fullPath | Full absolute path to the audio file. |
Implements gBaseSound.
|
overridevirtual |
Loads the sound file from the given project-relative path.
| soundPath | Project-relative path to the sound file. |
Implements gBaseSound.
|
overridevirtual |
Starts sound playback and resets the position to the beginning.
Implements gBaseSound.
|
overridevirtual |
|
overridevirtual |
Pauses or resumes the playback.
| isPaused | True to pause, false to resume. |
Implements gBaseSound.
|
overridevirtual |
Sets the current playback position in milliseconds.
| position | New position in ms. |
Implements gBaseSound.
|
overridevirtual |
Sets the volume level.
| volume | Volume between 0.0 (mute) and 1.0 (max). |
Implements gBaseSound.
|
overridevirtual |
Stops playback and resets position to the beginning.
Implements gBaseSound.