summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2SoundPlayer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/T2DLL/T2SoundPlayer.h')
-rw-r--r--src/T2DLL/T2SoundPlayer.h85
1 files changed, 57 insertions, 28 deletions
diff --git a/src/T2DLL/T2SoundPlayer.h b/src/T2DLL/T2SoundPlayer.h
index 8d3d7c6..7e9a5b4 100644
--- a/src/T2DLL/T2SoundPlayer.h
+++ b/src/T2DLL/T2SoundPlayer.h
@@ -2,55 +2,84 @@
#include "common.h"
enum PLAYMODE {
- PlayMode_0
+ PlayMode_0,
+ PlayMode_1,
+ PlayMode_2,
+ PlayMode_3
};
enum SOUNDPRIORITY {
- SoundPriority_0
+ SoundPriority_0,
+ SoundPriority_1
};
-class T2SoundPlayer {
-//protected:
-// static const AFX_MSGMAP* __stdcall _GetBaseMessageMap();
-// virtual const AFX_MSGMAP* GetMessageMap() const;
+enum {
+ SoundMask_10 = 0x10
+};
+
+enum {
+ SoundFlags_10 = 0x10,
+ SoundFlags_10000 = 0x10000
+};
+
+class AFX_EXT_CLASS T2SoundPlayer : public CWnd {
+ DECLARE_MESSAGE_MAP()
+
public:
- T2SoundPlayer(CWnd*, IDirectSound*);
+ T2SoundPlayer(CWnd* inParentWnd, IDirectSound* inDirectSound);
virtual ~T2SoundPlayer();
- void AddSound(const CString&, SOUNDPRIORITY, const CString&);
- void AddSound(const CString&, SOUNDPRIORITY, unsigned int, HINSTANCE);
-private:
- int LoadSound(T2SoundObjItem*, const CString&, CWave&, int);
-public:
- void DeleteSound(const CString&);
+ void AddSound(const CString& inName, SOUNDPRIORITY inPriority, const CString& inPath);
+ void AddSound(const CString& inName, SOUNDPRIORITY inPriority, unsigned int inResID, HINSTANCE inModule);
+ void DeleteSound(const CString& inName);
void DeleteSoundAll();
- void Play(const CString&, unsigned int, unsigned int, POINT*, PLAYMODE, int);
- void Stop(const CString&);
+ void Play(const CString& inName, unsigned int inMask, unsigned int inFlags, POINT* inPt, PLAYMODE inPlayMode, int inVolume);
+ void Stop(const CString& inName);
void StopAll();
- void SetVolume(const CString&, int);
- void SetSoundOn(int);
+ void SetVolume(const CString& inName, int inVolume);
+ void SetSoundOn(BOOL inSoundOn);
void FadeOut();
void FadeIn();
- void PlayCDTrack(int, int);
+ void PlayCDTrack(int inTrack, BOOL inFlag);
void StopCD();
+ unsigned int GetSEMask() const { return mSEMask; }
+ void SetSEMask(unsigned int inMask) { mSEMask = inMask; }
+ BOOL IsSoundOn() const { return mIsSoundOn; }
+
protected:
- long OnMCINotify(unsigned int, long);
-// static const AFX_MSGMAP messageMap;
-//private:
-// static const AFX_MSGMAP_ENTRY* const _messageEntries;
+ LRESULT OnMCINotify(WPARAM wParam, LPARAM lParam);
-public:
- unsigned int GetSEMask() const { return 0; }
- void SetSEMask(unsigned int) {}
- int IsSoundOn() const { return 0; }
+private:
+ BOOL LoadSound(T2SoundObjItem* inItem, const CString& inName, CWave& inWave, BOOL inReloadFlag);
+
+ IDirectSound *mDirectSound;
+ T2SoundObjItemList *mItemList;
+ int mCurrentCDTrack;
+ unsigned int mSEMask;
+ BOOL mIsSoundOn;
+ BOOL mIsFadeOut;
};
-class T2SoundObjItem {
+class AFX_EXT_CLASS T2SoundObjItem {
public:
T2SoundObjItem();
~T2SoundObjItem();
+
+ enum {
+ FileSource = 1,
+ ResSource = 2
+ };
+
+ CString mName;
+ SOUNDPRIORITY mPriority;
+ LPDIRECTSOUNDBUFFER mDSBuffers[4];
+ DWORD mPlayedAt[4];
+ int mSourceKind;
+ CString mPath;
+ unsigned int mResID;
+ HINSTANCE mModuleHandle;
};
-class T2SoundObjItemList {
+class AFX_EXT_CLASS T2SoundObjItemList : public CList<T2SoundObjItem *, T2SoundObjItem *> {
public:
T2SoundObjItemList();
virtual ~T2SoundObjItemList();