44#include " musyx/musyx.h"
55#include " types.h"
66
7+ #include " dolphin/dtk.h"
8+
79#include " rstl/map.hpp"
810#include " rstl/rc_ptr.hpp"
911#include " rstl/string.hpp"
1012#include " rstl/vector.hpp"
1113
1214#include " Kyoto/Math/CVector3f.hpp"
15+ #include " Kyoto/TToken.hpp"
1316
1417class CAudioGroupSet ;
1518class CSimplePool ;
@@ -20,8 +23,15 @@ enum ETRKSampleRate {
2023 // TODO
2124};
2225
26+ enum ETRKPlayState {
27+ kTPS_Stopped ,
28+ kTPS_Playing ,
29+ };
30+
2331enum ETRKRepeatMode {
24- // TODO
32+ kTRM_NoRepeat ,
33+ kTRM_RepeatOne ,
34+ kTRM_RepeatAll ,
2535};
2636
2737class CAudioSys {
@@ -65,30 +75,58 @@ class CAudioSys {
6575 uchar x29_prio;
6676 };
6777
68- class CTrkData {};
78+ class CTrkData {
79+ public:
80+ CTrkData (const rstl::string& name) : x50_inUse(true ), x54_name(name) {}
81+
82+ bool GetIsTrackInUse () const { return x50_inUse; }
83+ void SetIsTrackInUse (bool v) { x50_inUse = v; }
84+ DTKTrack* GetTrack () { return &x0_track; }
85+ char * GetFileName () { return const_cast < char * >(x54_name.data ()); }
86+
87+ DTKTrack x0_track;
88+ bool x50_inUse;
89+ rstl::string x54_name;
90+ };
6991
7092 CAudioSys (uchar, uchar, uchar, uchar, uint);
7193 ~CAudioSys ();
7294
7395 static void SysSetVolume (uchar, ushort, uchar);
7496 static void SysSetSfxVolume (uchar, ushort, uchar, uchar);
7597 static bool SysLoadGroupSet (CSimplePool*, uint);
98+ static bool SysLoadGroupSet (TLockedToken< CAudioGroupSet >, rstl::string, uint);
7699 static const rstl::string& SysGetGroupSetName (uint);
77100 static bool SysPushGroupIntoARAM (const rstl::string& name, uchar);
78101 static void SysPopGroupFromARAM ();
79102 static void SysUnloadGroupSet (const rstl::string& name);
80- static void SysUnloadSampleData (const rstl::string& name);
103+ static bool SysUnloadSampleData (const rstl::string& name);
104+ static bool SysIsGroupSetLoaded (const rstl::string& name);
105+ static rstl::ncrc_ptr< CAudioGroupSet > FindGroupSet (const rstl::string& name);
106+ static rstl::ncrc_ptr< CTrkData > FindTrack (const rstl::string& name);
81107
82108 static void SetDefaultVolumeScale (short );
83109 static void SetVolumeScale (short );
110+ static void SetVerbose (bool verbose) { mVerbose = verbose; }
111+ static void EnableProLogic2 (bool enabled) { mProLogic2 = enabled; }
112+ static void TrkFlushTracks ();
113+ static void TrkSetState (ETRKPlayState);
114+ static ETRKPlayState TrkGetState ();
115+ static void TrkSetVolume (uchar, uchar);
116+ static void TrkSetRepeatMode (ETRKRepeatMode);
117+ static void TrkNextTrack ();
118+ static int TrkQueueTrack (const rstl::string&, void (*)(unsigned long ), uint);
119+
84120 static void SetStereoMode (const bool mode);
85121 static void SetSurroundMode (const ESurroundModes mode);
122+ static ESurroundModes GetSurroundMode () { return mSurroundMode ; }
86123 static void TrkSetSampleRate (ETRKSampleRate);
87124
88125 static short GetDefaultVolumeScale ();
89126 static bool GetVerbose ();
90127
91- static SND_VOICEID SfxStart (const SND_FXID, const uchar, const uchar, const uchar);
128+ static SND_VOICEID SfxStart (const SND_FXID, const uchar vol, const uchar pan,
129+ const uchar prio);
92130 static void SfxStop (SND_VOICEID handle);
93131 static void SfxCtrl (const SND_VOICEID handle, const uchar ctrl, const uchar val);
94132 static SND_VOICEID SfxCheck (SND_VOICEID handle);
@@ -144,8 +182,8 @@ class CAudioSys {
144182 static uint mMaxAramUsage ;
145183 static uint mCurrentAramUsage ;
146184 static bool mProLogic2 ;
147- static ushort mVolumeScale ;
148- static ushort mDefaultVolumeScale ;
185+ static short mVolumeScale ;
186+ static short mDefaultVolumeScale ;
149187 static const uchar kMaxVolume ;
150188 static const uchar kEmitterMedPriority ;
151189 static const ushort kVolumeTable [];
0 commit comments