Added runtime functions
This commit is contained in:
@@ -22,6 +22,8 @@ public:
|
||||
void Reset();
|
||||
|
||||
SoundState GetState();
|
||||
float GetTotalRuntime();
|
||||
float GetRuntime();
|
||||
void SetPosition(Magnum::Vector3 position);
|
||||
Magnum::Vector3 GetPosition();
|
||||
void SetVolume(float value);
|
||||
|
@@ -27,6 +27,17 @@ Sound::Sound(Engine *engine, std::function<void(Sound *)> setupFunction,
|
||||
Sound::~Sound() { ma_sound_uninit(&maSound); }
|
||||
Sound::SoundState Sound::GetState() { return state; }
|
||||
|
||||
float Sound::GetTotalRuntime() {
|
||||
float time;
|
||||
ma_sound_get_length_in_seconds(&this->maSound, &time);
|
||||
return time;
|
||||
}
|
||||
|
||||
float Sound::GetRuntime() {
|
||||
float time;
|
||||
ma_sound_get_cursor_in_seconds(&this->maSound, &time);
|
||||
return time;
|
||||
}
|
||||
// Controls
|
||||
void Sound::Play() {
|
||||
ma_sound_start(&maSound);
|
||||
|
Reference in New Issue
Block a user