File: AudiereMusicInterface.h

package info (click to toggle)
libtuxcap 1.4.0.dfsg2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,172 kB
  • ctags: 5,897
  • sloc: cpp: 43,203; ansic: 3,095; python: 774; objc: 242; makefile: 100; xml: 87
file content (76 lines) | stat: -rw-r--r-- 1,832 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* Original Audiere Music Interface by Rheenen 2005 */

#ifndef __AudiereMUSICINTERFACE_H__
#define __AudiereMUSICINTERFACE_H__

#include "MusicInterface.h"
#include "audiere.h"

#ifndef WIN32
#define HWND void*
#endif

using namespace audiere;

namespace Sexy
{

class SexyAppBase;

class AudiereMusicInfo
{
public:
	OutputStreamPtr			mStream;
	MIDIStreamPtr			mMIDIStream;
	float					mVolume;
	float					mVolumeAdd;		
	float					mVolumeCap;		
	bool					mStopOnFade;
	bool					mRepeats;
	int						mPosition;

 public:
	AudiereMusicInfo();
};

 typedef std::map<int, AudiereMusicInfo> AudiereMusicMap;

 class AudiereMusicInterface : public MusicInterface
 {
 public:	
   AudioDevicePtr			mDevice;
   MIDIDevicePtr			mMIDIDevice;
   AudiereMusicMap			mMusicMap;
   float					mMasterVolume;

public:
	AudiereMusicInterface(HWND theHWnd);
	virtual ~AudiereMusicInterface();
		
	virtual bool			LoadMusic(int theSongId, const std::string& theFileName);

	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			UnloadMusic(int theSongId);
	virtual void			UnloadAllMusic();
	virtual void			PauseAllMusic();
	virtual void			ResumeAllMusic();

	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 //__AudiereMUSICINTERFACE_H__