//===== Copyright © 1996-2005, Sander Corporation, All rights reserved. ========
//
// Purpose: 
//
//=============================================================================

#include "cbase.h"
#include "hl2wars/rts_shareddefs.h"

class CMP3Control : public CPointEntity
{
public:
	DECLARE_CLASS( CMP3Control , CPointEntity );
	DECLARE_DATADESC();
	DECLARE_SERVERCLASS();  // make this entity networkable

	// Constructor
	CMP3Control ( void );
	~CMP3Control ( void );

	void InputAddSong( inputdata_t &inputdata );

	int UpdateTransmitState()	// set transmit filter to transmit always
	{
		return SetTransmitState( FL_EDICT_ALWAYS );
	}
};

LINK_ENTITY_TO_CLASS( mp3_control, CMP3Control  );
	
BEGIN_DATADESC( CMP3Control  )	
	DEFINE_INPUTFUNC(FIELD_STRING, "InputAddSong", InputAddSong),
END_DATADESC()

IMPLEMENT_SERVERCLASS_ST( CMP3Control, DT_MP3Control )
END_SEND_TABLE()

CMP3Control::CMP3Control ()
{

}

CMP3Control::~CMP3Control ()
{
}

//------------------------------------------------------------------------------
// Purpose:
//------------------------------------------------------------------------------
void CMP3Control::InputAddSong( inputdata_t &inputdata ) 
{
	if ( !inputdata.value.String()[0] )
		return;

	EntityMessageBegin( this, true );
		//WRITE_BYTE( inputdata.value.Int() );
		WRITE_STRING( inputdata.value.String() );
	MessageEnd();
}
