www.pudn.com > Tetris.rar > CSoundMixer.h


#ifndef __CSOUNDMIXER_H 
#define __CSOUNDMIXER_H 
 
#include "TSample.h" 
#include "TAudioShared.h" 
 
#include  
 
class CSoundMixer : public CBase 
{ 
// Construct and destruct 
public: 
	static CSoundMixer* NewL(); 
	~CSoundMixer(); 
 
private: 
	CSoundMixer(); 
	void ConstructL(); 
 
///////////////////////////////////////////////////////////////// 
// Other Method 
public: 
	void Pause(); 
	void Resume(); 
	void Play( const TSample& aSample, TInt aChannel, TInt aFrequency, TInt aVolume = 256 ); 
	void Stop( TInt aChannel ); 
 
	void SetVolume(TInt aVolume); 
	TInt Volume(); 
private: 
	void SendCmd(TMixerCmd aCmd); 
 
//////////////////////////////////////////////////////////////// 
// Data 
private: 
	TAudioShared		iShared;		// shared data with mixer thread 
	RThread				iMixerThread;	// handle to mixer thread 
	TSample				iEmptySample;	// empty sample, used to stop channel 
	TBool				iPaused; 
}; 
#endif