Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
244 chris 1
#ifndef __FMODMUSICINTERFACE_H__
2
#define __FMODMUSICINTERFACE_H__
3
 
4
#include "MusicInterface.h"
5
#include "fmod.h"
6
 
7
namespace Sexy
8
{
9
 
10
class SexyAppBase;
11
 
12
class FModMusicInfo
13
{
14
public:
15
        FSOUND_SAMPLE*                  mHSample;
16
        FMUSIC_MODULE*                  mHMusic;
17
        double                                  mVolume;
18
        double                                  mVolumeAdd;            
19
        double                                  mVolumeCap;            
20
        bool                                    mStopOnFade;
21
        bool                                    mRepeats;
22
 
23
public:
24
        FModMusicInfo();
25
};
26
 
27
typedef std::map<int, FModMusicInfo> FModMusicMap;
28
 
29
class FModMusicInterface : public MusicInterface
30
{
31
public:
32
        FModMusicMap                    mMusicMap;
33
        double                                  mMasterVolume;
34
        int                                             mMaxMusicVolume;
35
        int                                             mMaxSampleVolume;
36
 
37
public:
38
        FSOUND_SAMPLE*                  LoadFMODSample(const std::string& theFileName);
39
 
40
public:
41
        FModMusicInterface(HWND theHWnd);
42
        virtual ~FModMusicInterface();
43
 
44
        virtual bool                    LoadMusic(int theSongId, const std::string& theFileName);
45
        virtual bool                    LoadSample(int theSongId, const std::string& theFileName, bool repeat);
46
        virtual bool                    LoadSample(int theSongId, const std::string& theIntroFileName, const std::string& theRepeatFileName, bool repeat);
47
        virtual void                    PlayMusic(int theSongId, int theOffset = 0, bool noLoop = false);      
48
        virtual void                    StopMusic(int theSongId);
49
        virtual void                    PauseMusic(int theSongId);
50
        virtual void                    ResumeMusic(int theSongId);
51
        virtual void                    StopAllMusic();        
52
        virtual void                    FadeIn(int theSongId, int theOffset = -1, double theSpeed = 0.002, bool noLoop = false);
53
        virtual void                    FadeOut(int theSongId, bool stopSong = true, double theSpeed = 0.004);
54
        virtual void                    FadeOutAll(bool stopSong = true, double theSpeed = 0.004);
55
        virtual void                    SetSongVolume(int theSongId, double theVolume);
56
        virtual bool                    IsPlaying(int theSongId);
57
 
58
        virtual void                    SetVolume(double theVolume);
59
        virtual void                    Update();
60
};
61
 
62
}
63
 
64
#endif //__FMODMUSICINTERFACE_H__