📄 btspy.cpp
字号:
// BtSpy.cpp : Defines the entry point for the application.
//
#include "resource.h"
#include "BtSpy.h"
#include "CFile.hpp"
#include "CWizard.hpp"
// Wizard Page 1 (Name)
INT CWPage1::OnInitDialog()
{
// First, Bind the controls
ebCardName.SetHWND(*this,IDE_CardName);
// Create the tooltip and associate tooltips to the controls
ttWindow.Create(app->Instance,*this);
ttWindow.Register(ebCardName,
TEXT("Type here the name, model , brand, and revision of your"
" capture card to be able to uniquely identify it"));
// Set the current card name
ebCardName.SetLimitText(40); // 40 Chars
ebCardName.SetText(TEXT(""));
// Init global vars
app->CardName = TEXT("");
return TRUE;
}
INT CWPage1::OnKillActive()
{
SetResult(FALSE);
return TRUE;
}
INT CWPage1::OnReset()
{
// Reget the card name
ebCardName.SetText(TEXT(""));
SetResult(FALSE);
return TRUE;
}
INT CWPage1::OnCommand(WORD ControlID,WORD NotifyCode)
{
// If some action detected, check that!
switch ( ControlID ) { // item, control, or accelerator identifier
case IDE_CardName:
// Set Active buttons
SetWizButtons(AllTrim(ebCardName.GetText()).Len() ? PSWIZB_NEXT : 0);
break;
}
return FALSE;
}
INT CWPage1::OnSetActive()
{
// Set Active buttons
SetWizButtons(AllTrim(ebCardName.GetText()).Len() ? PSWIZB_NEXT : 0);
return TRUE;
}
INT CWPage1::OnWizNext()
{
// the Next button was pressed
LPTSTR NextPage = (LPTSTR)-1; // By default, don't advance!
CString Name = AllTrim(ebCardName.GetText());
if (Name.Len()) {
app->CardName = Name;
NextPage = MAKEINTRESOURCE(IDD_PAGE2);
}
SetNextPage(NextPage);
return TRUE;
}
// Wizard page 2 (Has TV)
INT CWPage2::OnInitDialog()
{
// First, Bind the controls
rbNo.SetHWND(*this,IDR_No);
rbYes.SetHWND(*this,IDR_Yes);
// Create the tooltip and associate tooltips to the controls
ttWindow.Create(app->Instance,*this);
ttWindow.Register(rbNo,
TEXT("Means your card does NOT have a TV tunerThis option begins the installation of the current Driver"));
ttWindow.Register(rbYes,
TEXT("Means your card has a TV tuner module inside (and an Antenna connector at it's back)"));
// Set start options
app->Has_TV = FALSE;
// Set no selection by default
rbYes.SetCheck(FALSE);
rbNo.SetCheck(FALSE);
return TRUE;
}
INT CWPage2::OnCommand(WORD ControlID,WORD NotifyCode)
{
// If some action detected, check button
if (NotifyCode == BN_CLICKED) { // notification code
switch ( ControlID ) { // item, control, or accelerator identifier
case IDR_Yes:
case IDR_No:
app->Has_TV = (ControlID == IDR_Yes);
// Set Buttons
SetWizButtons(PSWIZB_BACK | PSWIZB_NEXT);
break;
}
}
return FALSE;
}
INT CWPage2::OnKillActive()
{
SetResult(FALSE);
return TRUE;
}
INT CWPage2::OnReset()
{
// Set no selection by default
rbYes.SetCheck(FALSE);
rbNo.SetCheck(FALSE);
// Set no active buttons
SetWizButtons(PSWIZB_BACK);
SetResult(FALSE);
return TRUE;
}
INT CWPage2::OnSetActive()
{
// Set Active buttons
SetWizButtons( PSWIZB_BACK | (
(rbYes.GetCheck() || rbNo.GetCheck())
? PSWIZB_NEXT : 0));
return TRUE;
}
INT CWPage2::OnWizNext()
{
// the Next button was pressed
LPTSTR NextPage = (LPTSTR)-1; // By default, don't advance!
if ((rbYes.GetCheck() || rbNo.GetCheck())) {
if (rbYes.GetCheck()) {
NextPage = MAKEINTRESOURCE(IDD_PAGE3);
} else {
NextPage = MAKEINTRESOURCE(IDD_PAGE4);
}
}
SetNextPage(NextPage);
return TRUE;
}
// Wizard page 3 (CaptureTV)
INT CWPage3::OnInitDialog()
{
// Create the tooltip and associate tooltips to the controls
ttWindow.Create(app->Instance,*this);
return TRUE;
}
INT CWPage3::OnKillActive()
{
SetResult(FALSE);
return TRUE;
}
INT CWPage3::OnReset()
{
// Set active buttons
SetWizButtons(PSWIZB_BACK | PSWIZB_NEXT);
SetResult(FALSE);
return TRUE;
}
INT CWPage3::OnSetActive()
{
// Set active buttons
SetWizButtons(PSWIZB_BACK | PSWIZB_NEXT);
return TRUE;
}
INT CWPage3::OnWizNext()
{
// Capture the values!
app->TV_GPOE = app->BtAccess.GetGPOE();
app->TV_GPDATA = app->BtAccess.GetGPDATA();
app->TV_Mux = app->BtAccess.GetMux();
// the Next button was pressed
SetNextPage(MAKEINTRESOURCE(IDD_PAGE4));
return TRUE;
}
// Wizard page 4 (Has SVideo)
INT CWPage4::OnInitDialog()
{
// First, Bind the controls
rbNo.SetHWND(*this,IDR_No);
rbYes.SetHWND(*this,IDR_Yes);
// Create the tooltip and associate tooltips to the controls
ttWindow.Create(app->Instance,*this);
ttWindow.Register(rbNo,
TEXT("Means your card does NOT have an SVideo connector"));
ttWindow.Register(rbYes,
TEXT("Means your card has an SVideo connector"));
// Set start options
app->Has_SVideo = FALSE;
// Set no selection by default
rbYes.SetCheck(FALSE);
rbNo.SetCheck(FALSE);
return TRUE;
}
INT CWPage4::OnCommand(WORD ControlID,WORD NotifyCode)
{
// If some action detected, check button
if (NotifyCode == BN_CLICKED) { // notification code
switch ( ControlID ) { // item, control, or accelerator identifier
case IDR_Yes:
case IDR_No:
app->Has_SVideo = (ControlID == IDR_Yes);
// Set Buttons
SetWizButtons(PSWIZB_BACK | PSWIZB_NEXT);
break;
}
}
return FALSE;
}
INT CWPage4::OnKillActive()
{
SetResult(FALSE);
return TRUE;
}
INT CWPage4::OnReset()
{
// Set no selection by default
rbYes.SetCheck(FALSE);
rbNo.SetCheck(FALSE);
// Set no active buttons
SetWizButtons(PSWIZB_BACK);
SetResult(FALSE);
return TRUE;
}
INT CWPage4::OnSetActive()
{
// Set Active buttons
SetWizButtons(PSWIZB_BACK | (
(rbYes.GetCheck() || rbNo.GetCheck())
? PSWIZB_NEXT : 0));
return TRUE;
}
INT CWPage4::OnWizBack()
{
// Always return to page 2! (HasTV)
SetNextPage(MAKEINTRESOURCE(IDD_PAGE2));
return TRUE;
}
INT CWPage4::OnWizNext()
{
// the Next button was pressed
LPTSTR NextPage = (LPTSTR)-1; // By default, don't advance!
if ((rbYes.GetCheck() || rbNo.GetCheck())) {
if (rbYes.GetCheck()) {
NextPage = MAKEINTRESOURCE(IDD_PAGE5);
} else {
NextPage = MAKEINTRESOURCE(IDD_PAGE6);
}
}
SetNextPage(NextPage);
return TRUE;
}
// Wizard Page 5(Capture SVideo)
INT CWPage5::OnInitDialog()
{
// Create the tooltip and associate tooltips to the controls
ttWindow.Create(app->Instance,*this);
return TRUE;
}
INT CWPage5::OnKillActive()
{
SetResult(FALSE);
return TRUE;
}
INT CWPage5::OnReset()
{
SetResult(FALSE);
return TRUE;
}
INT CWPage5::OnSetActive()
{
// Set active buttons
SetWizButtons(PSWIZB_BACK | PSWIZB_NEXT);
return TRUE;
}
INT CWPage5::OnWizNext()
{
// Capture the values!
app->SVideo_GPOE = app->BtAccess.GetGPOE();
app->SVideo_GPDATA = app->BtAccess.GetGPDATA();
app->SVideo_Mux = app->BtAccess.GetMux();
// the Next button was pressed
SetNextPage(MAKEINTRESOURCE(IDD_PAGE6));
return TRUE;
}
// Composite ins
// Wizard page 6 (Has CompositeIns)
INT CWPage6::OnInitDialog()
{
// First, Bind the controls
ebNumComposites.SetHWND(*this,IDE_CompositeIns);
sSpin.SetHWND(*this,IDS_CompositeIns);
// Create the tooltip and associate tooltips to the controls
ttWindow.Create(app->Instance,*this);
ttWindow.Register(ebNumComposites,
TEXT("Write the number of composite video inputs your capture card has. (Usually, number of RCA connectors)"));
// Set start options
app->CompositeIns = 0;
app->CurrComposite = 0;
// Set no composites by default
ebNumComposites.SetLimitText(1);
ebNumComposites.SetText(TEXT("0"));
sSpin.SetRange(0,4);
return TRUE;
}
INT CWPage6::OnKillActive()
{
SetResult(FALSE);
return TRUE;
}
INT CWPage6::OnReset()
{
// Set no composites by default
ebNumComposites.SetLimitText(1);
ebNumComposites.SetText(TEXT("0"));
sSpin.SetRange(0,4);
// Set Buttons
SetWizButtons(PSWIZB_BACK| PSWIZB_NEXT);
SetResult(FALSE);
return TRUE;
}
INT CWPage6::OnSetActive()
{
// Set Buttons
SetWizButtons(PSWIZB_BACK | PSWIZB_NEXT);
return TRUE;
}
INT CWPage6::OnWizBack()
{
// Always return to page 4! (HasSvideo)
SetNextPage(MAKEINTRESOURCE(IDD_PAGE4));
return TRUE;
}
INT CWPage6::OnWizNext()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -