//===========================================================================//
// File:	audiorenderer.hpp                                                //
//---------------------------------------------------------------------------//
//   Date    Who  Modification                                               //
// --------  ---  ---------------------------------------------------------- //
// 03/22/99  SMJ  Initial coding.                                            //
//---------------------------------------------------------------------------//
// Copyright (C) 1999, Microsoft Corporation		                         //
// All Rights reserved worldwide                                             //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL               //
//===========================================================================//

#pragma once

#include "Adept.hpp"
#include "AudioSample.hpp"

namespace Adept {

	class AudioCommand;

	//##########################################################################
	//############################    AudioChannel    ##########################
	//##########################################################################

	class AudioChannel:
		public Stuff::Plug
	{
	public:
		typedef Stuff::Plug BaseClass;

		static void InitializeClass();
		static void TerminateClass();

		static ClassData *DefaultData;

		void TestInstance() const;

		AudioChannel(ClassData *class_data, int channel, int type, DWORD properties);
		~AudioChannel();

		virtual void Activate(AudioCommand *command);
		virtual void Deactivate();

		void SetSample(AudioSample *sample);
		AudioSample *GetCurrentSample()
			{Check_Object(this); return m_sample;}

		void Play(AudioCommand *command);
		void Stop();
		void SetVolume();

		virtual void Execute(Stuff::Time till);

		gosAudio_PlayMode GetPlayMode()
			{Check_Object(this); return m_playMode;}

		AudioSample *m_sample;
		AudioCommand *m_command;

		int m_channel, m_type;
		const DWORD m_properties;
		gosAudio_PlayMode m_playMode;
		Stuff::Time m_startTime;
		Stuff::Scalar m_energy, m_volume;
	};

}
