File: AudiereSoundInstance.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 (67 lines) | stat: -rw-r--r-- 1,534 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
/* Original Audiere Sound Instance class  by Rheenen 2005 */

#ifndef __AudiereSoundINSTANCE_H__
#define __AudiereSoundINSTANCE_H__

#include "SoundInstance.h"
#include "audiere.h"

using namespace audiere;

namespace Sexy
{

class AudiereSoundManager;

class AudiereSoundInstance : public SoundInstance
{
	friend class AudiereSoundManager;

protected:
	AudiereSoundManager*	mAudiereSoundManagerP;

	OutputStreamPtr			mStream;
	bool					mAutoRelease;
	bool					mReleased;

	float					mBasePan;
	float					mBaseVolume;
	float					mBasePitch;

	float					mPan;
	float					mVolume;
	float					mPitch;

	bool					mHasPlayed;

protected:
	void					RehupVolume();
	void					RehupPan();
	void					RehupPitch();

public:
	AudiereSoundInstance(AudiereSoundManager* theSoundManager, SampleSourcePtr theSourceSound);
	virtual ~AudiereSoundInstance();	
	
	virtual void			Release();
	
	virtual void			SetBaseVolume(double theBaseVolume); //0.0 to 1.0
	virtual void			SetBasePan(int theBasePan); //-100 to +100
	virtual void			AdjustBasePitch(float thePitch); //+0.5 to +2.0 relative to normal playing speed

	virtual void			SetVolume(double theVolume); //0.0 to 1.0
	virtual void			SetPan(int thePosition); //-100 to +100 = left to right	
	virtual void			AdjustPitch(double thePitch); //+0.5 to +2.0 relative to normal playing speed

	virtual bool			Play(bool looping, bool autoRelease);
	virtual void			Stop();
	virtual bool			IsPlaying();
	virtual bool			IsReleased();
	virtual double			GetVolume();

};

}

#endif //__AudiereSoundINSTANCE_H__