//===========================================================================//
// 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 "AudioChannel.hpp"

namespace Adept {

	//##########################################################################
	//#########################    SpatializedChannel    #######################
	//##########################################################################

	class SpatializedChannel:
		public AudioChannel
	{
	public:
		typedef AudioChannel BaseClass;

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

		static ClassData *DefaultData;

		void TestInstance() const;

		SpatializedChannel(ClassData *class_data, int channel, int type);
		~SpatializedChannel();

		void Activate(AudioCommand *command);

		void Execute(Stuff::Time till);

		Stuff::Point3D m_position;
		Stuff::Vector3D m_velocity;
		Stuff::YawPitchRange m_bearing;

		void SetPosition(const Stuff::Point3D &position)
			{m_position = position; gosAudio_SetChannelSlider(m_channel, gosAudio_Position, -m_position.x, m_position.y, m_position.z);}
		void SetVelocity(const Stuff::Vector3D &velocity)
			{m_velocity = velocity; gosAudio_SetChannelSlider(m_channel, gosAudio_Velocity, -m_velocity.x, m_velocity.y, m_velocity.z);}
		void SetBearing();

		enum {
			SpatializedProperties = gosAudio_Common|gosAudio_Volume|gosAudio_Position|gosAudio_MinMaxDistance, // |gosAudio_Velocity
		};
	};

}
