⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmixerthread.h

📁 手机游戏:Symbian S60俄罗斯方块(Tetris)的源代码
💻 H
字号:
#ifndef __CMIXERTHREAD_H
#define __CMIXERTHREAD_H

#include "TAudioShared.h"

#include <E32Base.h>
#include <mdaaudiooutputStream.h>
#include <mda\common\audio.h>


class CMixerThread : CBase, MMdaAudioOutputStreamCallback
{
// Construct and destruct 
public:
	static TInt ThreadFunction( TAny* aData);	// Thread entry point
	~CMixerThread();
private:
	CMixerThread(TAny* aData);
	TInt Construct();
	void ConstructL();

//////////////////////////////////////////////////////////////////////
// Other Method
private:
	static CMixerThread* Create(TAny* aData);

	static void ExcHandler(TExcType aExc);	
	void HandleException(TExcType aExc);

	void StartMixer();
	void StopMixer();

	// MMdaAudioOutputStreamCallback
	void MaoscPlayComplete( TInt aError );
	void MaoscBufferCopied( TInt aError, const TDesC8& aBuffer );
	void MaoscOpenComplete( TInt aError );

	//
	void FillBuffer();

//////////////////////////////////////////////////////////////////////
// Data

private:
	CTrapCleanup*			iCleanupStack;
	CActiveScheduler*		iActiveScheduler;
	CMdaAudioOutputStream*	iStream;
	TMdaAudioDataSettings	iSet;

	TInt16*					iBuffer;	// buffer to CMdaAudioOutput
	TInt*					iMixBuffer;	// 32-bit buffer to mixing
	TPtrC8					iBufferPtr;	// pointer to iBuffer
		
	TInt					iError;		// contains CMdaAudioOutput errors

	TAudioShared&			iShared;	// reference to shared data with client
		
	TInt16* iAudioData[ KMaxChannels ];	// current sample data pointers
	
	TInt iAudioPos[ KMaxChannels ];		// These are shifted by KAudioShift
	TInt iAudioEnd[ KMaxChannels ];
	TInt iRepStart[ KMaxChannels ];
	TInt iRepEnd[ KMaxChannels ];	

};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -