//---------------------------------------------------------------------------

#ifndef BaseTrackH
#define BaseTrackH
//---------------------------------------------------------------------------
#define TRACK_NORMAL			0x00
#define TRACK_MUTE				0x01
#define TRACK_SOLO				0x02
#define TRACK_HIDE				0x04

#define ST_MIDI		0
#define ST_AUDIO	1

class TBaseTrack
{
public:
	BYTE state;
	BYTE volume;
	char pan;
	char gain;

	TBaseTrack()
	{
		state = TRACK_NORMAL;
		volume = 100;
		pan = gain = 0;
	};

	TBaseTrack( BYTE s, BYTE v, char p, char g )
	{
		state = s;
		volume = v;
		pan = p;
		gain = g;
    }

	bool IsMute(){ return state & TRACK_MUTE; };
	bool IsSolo(){ return state & TRACK_SOLO; };
	bool IsHide(){ return state & TRACK_HIDE; };
	void Mute( bool bMute=true ) { if( bMute ) state |= TRACK_MUTE; else state &= ~TRACK_MUTE; };
	void Solo( bool bSolo=true ) { if( bSolo ) state |= TRACK_SOLO; else state &= ~TRACK_SOLO; };
	void Hide( bool bHide=true ) { if( bHide ) state |= TRACK_HIDE; else state &= ~TRACK_HIDE; };

};

void SetTrackParams( bool bSolo=true );  //bSolo£ºÊÇ·ñ¿¼ÂÇ¶À×à×´Ì¬
bool IsTrackMute( int iType, int iTrack );
void ChangeTrackState( int iType, int iTrack, int iState, bool& bSet, bool& bUnset );

#endif
