#ifndef SysControl_INCLUDED
	#define SysControl_INCLUDED

#include <bncs_script_helper.h>

#ifdef WIN32
	#ifdef DOEXPORT_SCRIPT
		#define EXPORT_SCRIPT __declspec(dllexport) 
	#else
		#define EXPORT_SCRIPT 
	#endif
#else 
	#define EXPORT_SCRIPT
#endif
 
class SysControl : public bncs_script_helper
{
public:
	SysControl( bncs_client_callback * parent, const char* path );
	virtual ~SysControl();

	void buttonCallback( buttonNotify *b );
	int revertiveCallback( revertiveNotify * r );
	void databaseCallback( revertiveNotify * r );
	bncs_string parentCallback( parentNotify *p );
	void timerCallback( int );
	
private:
	bncs_string m_myParam;
	bncs_string m_instance;
	
	bncs_config myVals;				// Used when reading values from wn_academy.xml

	int currentState;				// Holds the current Off/Reh/TX status
	int tallyInfodriver;			// Holds the BNCS driver ID for the tally infodriver
	int sdiRouterdriver;			// Holds the BNCS driver ID for the sdi router
	int audioRouterdriver;			// Holds the BNCS driver ID for the audio router
	int defaultAudio;				// The audio source routed when audio to line button switches to off
	int defaultVideo;				// The video source routed when video to line button switches to off
	int currentVideo;
	int currentAudio;

	bool lineupAllowed;				// Set true when we are allowed to send line up signals
	bool tallyReg;					// Flags that show if the drivers have been registered for revertives
	bool SDIReg;
	bool audioReg;
	bool audio_to_line;				// Set true when revertive shows that audio alignment source is routed to line out
	bool video_to_line;				// Set true when revertive shows that video alignment source is routed to line out
};


#endif // SysControl_INCLUDED