///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "PlayerUI.h"

///////////////////////////////////////////////////////////////////////////

PlayerUI::PlayerUI( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* bSizer1;
	bSizer1 = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizer3;
	bSizer3 = new wxBoxSizer( wxHORIZONTAL );
	
	leftMediaCanvas = new OpenCVGLCanvas(this);
	leftMediaCanvas->Hide();
	
	bSizer3->Add( leftMediaCanvas, 0, wxRIGHT, 5 );
	
	rightMediaCanvas = new OpenCVGLCanvas(this);
	rightMediaCanvas->Hide();
	
	bSizer3->Add( rightMediaCanvas, 0, 0, 5 );
	
	bSizer1->Add( bSizer3, 0, 0, 5 );
	
	progressSlider = new wxSlider( this, ID_PROGRESS_SLIDER, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
	bSizer1->Add( progressSlider, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer2;
	bSizer2 = new wxBoxSizer( wxHORIZONTAL );
	
	playButton = new wxBitmapButton( this, ID_PLAY_BUTTON, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	bSizer2->Add( playButton, 0, wxALL, 5 );
	
	skipBackwardButton = new wxBitmapButton( this, ID_SKIP_BACK_BUTTON, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	bSizer2->Add( skipBackwardButton, 0, wxTOP|wxBOTTOM, 5 );
	
	rewindButton = new wxBitmapButton( this, ID_REWIND_BUTTON, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	bSizer2->Add( rewindButton, 0, wxTOP|wxBOTTOM, 5 );
	
	stopButton = new wxBitmapButton( this, ID_STOP_BUTTON, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	bSizer2->Add( stopButton, 0, wxALL, 5 );
	
	forwardButton = new wxBitmapButton( this, ID_FORWARD_BUTTON, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	bSizer2->Add( forwardButton, 0, wxTOP|wxBOTTOM, 5 );
	
	skipForwardButton = new wxBitmapButton( this, ID_SKIP_FORWARD_BUTTON, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
	bSizer2->Add( skipForwardButton, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
	
	bSizer1->Add( bSizer2, 0, wxALIGN_CENTER_HORIZONTAL, 0 );
	
	this->SetSizer( bSizer1 );
	this->Layout();
	bSizer1->Fit( this );
	
	// Connect Events
	progressSlider->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	playButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlayerUI::onPlay ), NULL, this );
	rewindButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlayerUI::onRewindButtonClick ), NULL, this );
	stopButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlayerUI::onStop ), NULL, this );
	forwardButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlayerUI::onForwardButtonClick ), NULL, this );
}

PlayerUI::~PlayerUI()
{
	// Disconnect Events
	progressSlider->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	progressSlider->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( PlayerUI::onSliderScroll ), NULL, this );
	playButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlayerUI::onPlay ), NULL, this );
	rewindButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlayerUI::onRewindButtonClick ), NULL, this );
	stopButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlayerUI::onStop ), NULL, this );
	forwardButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PlayerUI::onForwardButtonClick ), NULL, this );
}
