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

📄 soundcontext.h

📁 这个是symbian下的一个蛮庞大的3D游戏源代码!对于学习3D开发的人有很大的帮助!
💻 H
字号:
#ifndef _SOUNDCONTEXT_H
#define _SOUNDCONTEXT_H


#include "stdint.h"
#include <lang/Array.h>
#include <lang/String.h>


class SoundContext
{
public:
	enum 
	{ 
		MAX_SAMPLES = 128
	};

	enum ChannelType
	{
		CHANNEL_AMBIENT,
		CHANNEL_OTHER,
		CHANNEL_COUNT
	};

	enum SoundFlags
	{
		SOUND_LOOP	= 1
	};

	class Sample
	{
	public:
		lang::Array<int8_t>	data;
		lang::String		name;
		int					flags;
	};

	class Channel
	{
	public:
		Sample*		sample;
		int			pos;

		Channel() : sample(0), pos(0) {}
	};

	SoundContext();

	void	addSample( const char* filename, int flags=0 );
	void	playSound( const char* basename, int channel );
	void	stopSound( const char* basename );
	void	mix( int16_t* out, int size );

	const Channel&	getChannel( int i ) const	{return m_channels[i];}

protected:
	Sample		m_samplelist[MAX_SAMPLES];
	int			m_samples;
	Channel		m_channels[CHANNEL_COUNT];

	Sample*	findSample( const char* basename );
};


#endif // _SOUNDCONTEXT_H

⌨️ 快捷键说明

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