summaryrefslogtreecommitdiff
path: root/osframework/source/SexyAppFramework/FModMusicInterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'osframework/source/SexyAppFramework/FModMusicInterface.h')
-rw-r--r--osframework/source/SexyAppFramework/FModMusicInterface.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/osframework/source/SexyAppFramework/FModMusicInterface.h b/osframework/source/SexyAppFramework/FModMusicInterface.h
new file mode 100644
index 0000000..a3f2940
--- /dev/null
+++ b/osframework/source/SexyAppFramework/FModMusicInterface.h
@@ -0,0 +1,64 @@
+#ifndef __FMODMUSICINTERFACE_H__
+#define __FMODMUSICINTERFACE_H__
+
+#include "MusicInterface.h"
+#include "fmod.h"
+
+namespace Sexy
+{
+
+class SexyAppBase;
+
+class FModMusicInfo
+{
+public:
+ FSOUND_SAMPLE* mHSample;
+ FMUSIC_MODULE* mHMusic;
+ double mVolume;
+ double mVolumeAdd;
+ double mVolumeCap;
+ bool mStopOnFade;
+ bool mRepeats;
+
+public:
+ FModMusicInfo();
+};
+
+typedef std::map<int, FModMusicInfo> FModMusicMap;
+
+class FModMusicInterface : public MusicInterface
+{
+public:
+ FModMusicMap mMusicMap;
+ double mMasterVolume;
+ int mMaxMusicVolume;
+ int mMaxSampleVolume;
+
+public:
+ FSOUND_SAMPLE* LoadFMODSample(const std::string& theFileName);
+
+public:
+ FModMusicInterface(HWND theHWnd);
+ virtual ~FModMusicInterface();
+
+ virtual bool LoadMusic(int theSongId, const std::string& theFileName);
+ virtual bool LoadSample(int theSongId, const std::string& theFileName, bool repeat);
+ virtual bool LoadSample(int theSongId, const std::string& theIntroFileName, const std::string& theRepeatFileName, bool repeat);
+ virtual void PlayMusic(int theSongId, int theOffset = 0, bool noLoop = false);
+ virtual void StopMusic(int theSongId);
+ virtual void PauseMusic(int theSongId);
+ virtual void ResumeMusic(int theSongId);
+ virtual void StopAllMusic();
+ virtual void FadeIn(int theSongId, int theOffset = -1, double theSpeed = 0.002, bool noLoop = false);
+ virtual void FadeOut(int theSongId, bool stopSong = true, double theSpeed = 0.004);
+ virtual void FadeOutAll(bool stopSong = true, double theSpeed = 0.004);
+ virtual void SetSongVolume(int theSongId, double theVolume);
+ virtual bool IsPlaying(int theSongId);
+
+ virtual void SetVolume(double theVolume);
+ virtual void Update();
+};
+
+}
+
+#endif //__FMODMUSICINTERFACE_H__