mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(sound): add SI2::IsPlaying
This commit is contained in:
parent
f64e75a490
commit
4669e306c3
@ -538,6 +538,21 @@ void SESound::CompleteLoad() {
|
||||
}
|
||||
}
|
||||
|
||||
bool SESound::IsPlaying() {
|
||||
if (!this->m_internal) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!this->m_internal->m_fmodChannel) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool isPlaying;
|
||||
this->m_internal->m_fmodChannel->isPlaying(&isPlaying);
|
||||
|
||||
return isPlaying;
|
||||
}
|
||||
|
||||
int32_t SESound::Load(const char* filename, int32_t a3, FMOD::SoundGroup* soundGroup1, FMOD::SoundGroup* soundGroup2, bool a6, bool a7, uint32_t a8, int32_t a9, uint32_t a10) {
|
||||
if (!SESound::s_Initialized) {
|
||||
return 0;
|
||||
|
||||
@ -35,6 +35,7 @@ class SESound {
|
||||
|
||||
// Public member functions
|
||||
void CompleteLoad();
|
||||
bool IsPlaying();
|
||||
int32_t Load(const char* filename, int32_t a3, FMOD::SoundGroup* soundGroup1, FMOD::SoundGroup* soundGroup2, bool a6, bool a7, uint32_t a8, int32_t a9, uint32_t a10);
|
||||
void Play();
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#include "sound/SESound.hpp"
|
||||
#include "sound/SOUNDKITDEF.hpp"
|
||||
#include "sound/SOUNDKITLOOKUP.hpp"
|
||||
#include "sound/SOUNDKITOBJECT.hpp"
|
||||
#include "ui/FrameScript.hpp"
|
||||
|
||||
TSGrowableArray<SOUNDKITDEF*> SI2::s_SoundKitDefs;
|
||||
@ -230,6 +231,10 @@ void SI2::InitSoundKitGroups() {
|
||||
}
|
||||
}
|
||||
|
||||
bool SI2::IsPlaying(SOUNDKITOBJECT* object) {
|
||||
return object->m_sound->IsPlaying();
|
||||
}
|
||||
|
||||
int32_t SI2::PlaySoundKit(int32_t id, int32_t a2, void* handle, SoundKitProperties* properties, int32_t a5, void* a6, int32_t a7, int32_t a8) {
|
||||
// Basic validations
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
|
||||
class SOUNDKITDEF;
|
||||
struct SOUNDKITLOOKUP;
|
||||
class SOUNDKITOBJECT;
|
||||
class SoundKitProperties;
|
||||
|
||||
class SI2 {
|
||||
@ -25,6 +26,7 @@ class SI2 {
|
||||
static int32_t Init(int32_t a1);
|
||||
static void InitSoundKitDefs();
|
||||
static void InitSoundKitGroups();
|
||||
static bool IsPlaying(SOUNDKITOBJECT* object);
|
||||
static int32_t PlaySoundKit(int32_t id, int32_t a2, void* handle, SoundKitProperties* properties, int32_t a5, void* a6, int32_t a7, int32_t a8);
|
||||
static void PlayUISound(int32_t id);
|
||||
static void RegisterCVars();
|
||||
|
||||
14
src/sound/SOUNDKITOBJECT.hpp
Normal file
14
src/sound/SOUNDKITOBJECT.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef SOUND_SOUND_KIT_OBJECT_HPP
|
||||
#define SOUND_SOUND_KIT_OBJECT_HPP
|
||||
|
||||
class SESound;
|
||||
|
||||
class SOUNDKITOBJECT {
|
||||
public:
|
||||
// Member variables
|
||||
// TODO
|
||||
SESound* m_sound;
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user