/* Made Dec 1998 by Claes Löfqvist */



#include <MediaKit.h>

#include "Converter.h"

#define MAX_STREAMS 1000 // Streams are in fact without limit!!
#define MAX_SAMPLES 32

class BeosMameSound
{
public:
	BeosMameSound();
	~BeosMameSound();
	void Play16BitsSample (int channel,signed short *data,int len,int freq,int volume,int loop);
	void Play8BitsSample  (int channel,signed char *data,int len,int freq,int volume,int loop);
	void Play16BitsStream (int channel,signed short *data,int len,int freq,int volume);
	void Play8BitsStream  (int channel,signed char *data,int len,int freq,int volume);
//	void AdjustSample    (int channel,int freq,int volume);
	void AdjustSampleFrequency (int channel,int freq);
	void AdjustSampleVolume    (int channel,int volume);
	void StopSample      (int channel);
	void RestartSample    (int channel);
	bool GetSampleStatus  (int channel);
	void SetMasterVolume  (int volume);
	int  GetMasterVolume  ();
	void On(int NoAdjust, int NoGaps);
	void Off();
	bool IsOn() { return (SoundOn); }
private:
	bool ChannelOn(int Channel);
	BSoundPlayer *musicPlayer;
	Converter *converter;
	bool SoundOn;
};
