File: AudiereSoundManager.h

package info (click to toggle)
libtuxcap 1.4.0.dfsg2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,176 kB
  • sloc: cpp: 43,203; ansic: 3,095; python: 774; objc: 242; makefile: 100; xml: 87
file content (75 lines) | stat: -rw-r--r-- 1,830 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
/* Original Audiere Sound Manager  by Rheenen 2005 */

#ifndef __AudiereSoundMANAGER_H__
#define __AudiereSoundMANAGER_H__

#include "SoundManager.h"
#include "audiere.h"
#include "SDL.h"

#ifndef WIN32
#define HWND void*
#endif

using namespace audiere;

namespace Sexy
{

class AudiereSoundInstance;

class AudiereSoundManager : public SoundManager
{
	friend class AudiereSoundInstance;

protected:
	SampleSourcePtr			mSourceSounds[MAX_SOURCE_SOUNDS];
	float					mBaseVolumes[MAX_SOURCE_SOUNDS];
	int						mBasePans[MAX_SOURCE_SOUNDS];
	float					mBasePitches[MAX_SOURCE_SOUNDS];
	AudiereSoundInstance*	mPlayingSounds[MAX_CHANNELS];	
	float					mMasterVolume;
       Uint32					mLastReleaseTick;

protected:
	int						FindFreeChannel();
	void					ReleaseFreeChannels();

public:
	AudioDevicePtr			mDevice;

public:
	AudiereSoundManager();
	virtual ~AudiereSoundManager();

	virtual bool			Initialized();
	
	virtual bool			LoadSound(unsigned int theSfxID, const std::string& theFilename);		
	virtual int				LoadSound(const std::string& theFilename);		
	virtual void			ReleaseSound(unsigned int theSfxID);
	virtual int				GetFreeSoundId();
	virtual int				GetNumSounds();

	virtual void			SetVolume(double theVolume);
	virtual bool			SetBaseVolume(unsigned int theSfxID, double theBaseVolume);
	virtual bool			SetBasePan(unsigned int theSfxID, int theBasePan);
	virtual bool			SetBasePitch(unsigned int theSfxID, float theBasePitch);

	virtual SoundInstance*	GetSoundInstance(unsigned int theSfxID);

	virtual void			ReleaseSounds();
	virtual void			ReleaseChannels();

	virtual double			GetMasterVolume();
	virtual void			SetMasterVolume(double theVolume);

	virtual void			Flush();

	virtual void			SetCooperativeWindow(HWND theHWnd, bool isWindowed);
	virtual void			StopAllSounds();
};

}

#endif //__AudiereSoundMANAGER_H__