#include <vcl.h>
#pragma hdrstop

#include "miscVideoControl.h"
#include "MainForm.h"
#pragma package(smart_init)
#pragma resource "*.dfm"

#include <set>

#pragma warn -8057

TfrmVideoControl *frmVideoControl;

__fastcall TfrmVideoControl::TfrmVideoControl(TComponent* Owner) : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TfrmVideoControl::RefreshControls()
{
   chkFlipVertically->Enabled = frmMainForm->VideoGrabber->IsVideoControlModeAvailable (vc_FlipVertical);
   chkFlipHorizontally->Enabled = frmMainForm->VideoGrabber->IsVideoControlModeAvailable (vc_FlipHorizontal);
   chkExternalTrigger->Enabled = frmMainForm->VideoGrabber->IsVideoControlModeAvailable (vc_ExternalTriggerEnable);
   chkEmulateTrigger->Enabled = frmMainForm->VideoGrabber->IsVideoControlModeAvailable (vc_Trigger);

   chkFlipVertically->Checked = frmMainForm->VideoGrabber->GetVideoControlMode (vc_FlipVertical);
   chkFlipHorizontally->Checked = frmMainForm->VideoGrabber->GetVideoControlMode (vc_FlipHorizontal);
   chkExternalTrigger->Checked = frmMainForm->VideoGrabber->GetVideoControlMode (vc_ExternalTriggerEnable);
   chkEmulateTrigger->Checked = frmMainForm->VideoGrabber->GetVideoControlMode (vc_Trigger);
}
//---------------------------------------------------------------------------

void __fastcall TfrmVideoControl::FormShow(TObject *Sender)
{
   RefreshControls();
}
//---------------------------------------------------------------------------

void __fastcall TfrmVideoControl::chkFlipVerticallyClick(TObject *Sender)
{
   frmMainForm->VideoGrabber->SetVideoControlMode2 (vc_FlipVertical, chkFlipVertically->Checked);
}
//---------------------------------------------------------------------------

void __fastcall TfrmVideoControl::chkFlipHorizontallyClick(TObject *Sender)
{
   frmMainForm->VideoGrabber->SetVideoControlMode2 (vc_FlipHorizontal, chkFlipHorizontally->Checked);
}
//---------------------------------------------------------------------------

void __fastcall TfrmVideoControl::chkExternalTriggerClick(TObject *Sender)
{
   frmMainForm->VideoGrabber->SetVideoControlMode2 (vc_ExternalTriggerEnable, chkExternalTrigger->Checked);
}
//---------------------------------------------------------------------------

void __fastcall TfrmVideoControl::chkEmulateTriggerClick(TObject *Sender)
{
   frmMainForm->VideoGrabber->SetVideoControlMode2 (vc_Trigger, chkEmulateTrigger->Checked);
}

//---------------------------------------------------------------------------
void __fastcall TfrmVideoControl::Button2Click(TObject *Sender)
{
   Close();
}
//---------------------------------------------------------------------------


