The server tree of https://code.moenext.com/nanahira/ygopro.git, branch server, commit 52c868ce071ea0f2fcb0cf39bf2fb4151d12b90c, stock: gframe/, premake5.lua, .ci/, LICENSE, and gframe/ygopro.rc + .ico (upstream keeps them in resource/ and copies them in before building). No game assets, no scripts, no ocgcore submodule: the core is ../core. The third-party sources upstream's Windows CI downloads are vendored here at the positions its premake expects, each with its premake fragment from upstream's premake/ folder inside it: lua 5.4.8, sqlite 3.53.3, libevent 2.1.13-stable (tests, samples and autotools helpers left out; the files its Windows prebuild copies into include/ left out), zlib 1.3.2 (contrib and examples left out), xz 5.8.3 (src/liblzma + src/common only), and irrlicht 1.9 from mycard at 20f86d25: include/ plus the source/Irrlicht headers and the 11 .cpp files the server's zip reader project compiles. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
100 lines
2.2 KiB
C++
100 lines
2.2 KiB
C++
#ifndef SOUNDMANAGER_H
|
|
#define SOUNDMANAGER_H
|
|
|
|
#include <random>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace irr {
|
|
namespace gui {
|
|
class IGUIElement;
|
|
}
|
|
}
|
|
|
|
namespace ygo {
|
|
|
|
class SoundManager {
|
|
private:
|
|
std::vector<std::wstring> BGMList[9];
|
|
int bgm_scene{ -1 };
|
|
int previous_bgm_scene{ -1 };
|
|
bool bgm_process { false };
|
|
std::mt19937 rnd;
|
|
#ifdef YGOPRO_USE_MINIAUDIO
|
|
struct MiniAudioImpl;
|
|
MiniAudioImpl* miniAudio{};
|
|
#endif
|
|
void RefreshBGMDir(std::wstring path, int scene);
|
|
|
|
public:
|
|
SoundManager() = default;
|
|
SoundManager(const SoundManager&) = delete;
|
|
SoundManager& operator=(const SoundManager&) = delete;
|
|
~SoundManager();
|
|
|
|
bool Init();
|
|
void RefreshBGMList();
|
|
void PlaySound(wchar_t* sound);
|
|
void PlaySoundEffect(int sound);
|
|
void PlayDialogSound(irr::gui::IGUIElement * element);
|
|
bool IsPlayingMusic(wchar_t* music = 0);
|
|
void PlayMusic(wchar_t* music, bool loop);
|
|
void PlayBGM(int scene);
|
|
void PlayCustomBGM(wchar_t* BGMName);
|
|
void PlayCustomSound(wchar_t* SoundName);
|
|
void StopBGM();
|
|
void StopSound();
|
|
void SetSoundVolume(int volume);
|
|
void SetMusicVolume(int volume);
|
|
};
|
|
|
|
extern SoundManager soundManager;
|
|
|
|
#define SOUND_SUMMON 101
|
|
#define SOUND_SPECIAL_SUMMON 102
|
|
#define SOUND_ACTIVATE 103
|
|
#define SOUND_SET 104
|
|
#define SOUND_FLIP 105
|
|
#define SOUND_REVEAL 106
|
|
#define SOUND_EQUIP 107
|
|
#define SOUND_DESTROYED 108
|
|
#define SOUND_BANISHED 109
|
|
#define SOUND_TOKEN 110
|
|
#define SOUND_NEGATE 111
|
|
|
|
#define SOUND_ATTACK 201
|
|
#define SOUND_DIRECT_ATTACK 202
|
|
#define SOUND_DRAW 203
|
|
#define SOUND_SHUFFLE 204
|
|
#define SOUND_DAMAGE 205
|
|
#define SOUND_RECOVER 206
|
|
#define SOUND_COUNTER_ADD 207
|
|
#define SOUND_COUNTER_REMOVE 208
|
|
#define SOUND_COIN 209
|
|
#define SOUND_DICE 210
|
|
#define SOUND_NEXT_TURN 211
|
|
#define SOUND_PHASE 212
|
|
|
|
#define SOUND_MENU 301
|
|
#define SOUND_BUTTON 302
|
|
#define SOUND_INFO 303
|
|
#define SOUND_QUESTION 304
|
|
#define SOUND_CARD_PICK 305
|
|
#define SOUND_CARD_DROP 306
|
|
#define SOUND_PLAYER_ENTER 307
|
|
#define SOUND_CHAT 308
|
|
|
|
#define BGM_ALL 0
|
|
#define BGM_DUEL 1
|
|
#define BGM_MENU 2
|
|
#define BGM_DECK 3
|
|
#define BGM_ADVANTAGE 4
|
|
#define BGM_DISADVANTAGE 5
|
|
#define BGM_WIN 6
|
|
#define BGM_LOSE 7
|
|
#define BGM_CUSTOM 8
|
|
|
|
}
|
|
|
|
#endif //SOUNDMANAGER_H
|