#ifndef SCR_WBox_INCLUDED
	#define SCR_WBox_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 SCR_WBox : public bncs_script_helper
{
public:
	SCR_WBox( bncs_client_callback * parent, const char* path );
	virtual ~SCR_WBox();

	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;
	
	int source_pkg;				// Holds the source package id.
	int dest_pkg;				// Holds the destination package id.
	int take_count;				// Used by the take timeout period process.
	int cta_bncs_pkg_id;		// Holds the BNCS driver id of the CTA package system
	int cta_audio_id;			// Holds the driver id of the CTA audio router
	int active_dest;			// Holds the index of the active destination button.

	bool source_selected;		// Set true when a source is selected
	bool dest_selected;			// Set true when a destination is selected
	bool take_enabled;			// Set true when both a source and destination are selected
	bool timer_counter_enabled;	// Set true when the timer counter is running.

	// Local support functions
	void take_check(void);		// Checks if the take button should be enabled, and initiates the take counter system.
	void clear_all(void);		// Used to clear down source and/or selections
};


#endif // SCR_WBox_INCLUDED