home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2001 July
/
VPR0107B.BIN
/
DRIVER
/
CANOPUS
/
MVR32
/
mvr32.exe
/
data1.cab
/
Development_Kit
/
Vc
/
Samples
/
Encode
/
TimeDlg.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2001-02-09
|
7KB
|
166 lines
//======================================================================
// -- TimeDlg.cpp --
//
// MVR-D2000
// エンコード サンプルプログラム
// Encode sample program
//
// Copyright (C) 1999-2000 Canopus Co., Ltd. All rights reserved.
//======================================================================
//
// -- サンプルプログラムをご使用になる前に ---
// -- Before use this sample program... --
//
// このサンプルプログラムは、カノープス製品を使うためにご使用ください。
// Please use this sample progeam to use products of canopus.
//
//======================================================================
// TimeDlg.cpp : インプリメンテーション ファイル
//
#include "stdafx.h"
#include "Encode.h"
#include "TimeDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern int ENC_ID;
/////////////////////////////////////////////////////////////////////////////
// CTimeDlg ダイアログ
CTimeDlg::CTimeDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTimeDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CTimeDlg)
// メモ - ClassWizard はこの位置にマッピング用のマクロを追加または削除します。
//}}AFX_DATA_INIT
}
void CTimeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTimeDlg)
DDX_Control(pDX, IDC_EDIT_TIME, m_Edit_Time);
DDX_Control(pDX, IDC_CHECK_LIMIT_TIME, m_Check_Time);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTimeDlg, CDialog)
//{{AFX_MSG_MAP(CTimeDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTimeDlg メッセージ ハンドラ
//----------------------------------------------------------------------
// #[ CTimeDlg::OnInitDialog ]
//
// 機能 キャプチャ時間の設定
//
// 引数: なし
//
// 戻り値: BOOL TRUE
// FALSE
//
//----------------------------------------------------------------------
// #[ CTimeDlg::OnInitDialog ]
//
// Function: Initialize recorde time dialog
//
// Parameters: none
//
// Return value: BOOL TRUE
// FALSE
//
//----------------------------------------------------------------------
BOOL CTimeDlg::OnInitDialog()
{
ENC_RETURN enc_return;
UINT rec_time;
UINT enable;
char szText[16];
CString strMessage;
CDialog::OnInitDialog();
// 現在の設定時間の取得
// Get record time
enc_return = ENC_Get_Record_Time(ENC_ID, &rec_time, &enable);
if(enc_return != ENC_SUCCESS)
{
strMessage.LoadString(IDC_ERROR_GET_PARAMETER);
MessageBox(strMessage);
return FALSE;
}
// 時間制限のチェック
// Check Limit Time
m_Check_Time.SetCheck(enable);
// キャプチャ時間の設定
// Set Record Time
wsprintf(szText, "%ld", rec_time);
m_Edit_Time.SetWindowText(szText);
return TRUE; // コントロールにフォーカスを設定しないとき、戻り値は TRUE となります
// 例外: OCX プロパティ ページの戻り値は FALSE となります
}
//----------------------------------------------------------------------
// #[ CTimeDlg::OnOK ]
//
// 機能 キャプチャ時間の設定を有効にする
//
// 引数: なし
//
// 戻り値: なし
//
//----------------------------------------------------------------------
// #[ CTimeDlg::OnOK ]
//
// Function: Set record time
//
// Parameters: none
//
// Return value: none
//
//----------------------------------------------------------------------
void CTimeDlg::OnOK()
{
ENC_RETURN enc_return;
UINT rec_time;
UINT enable;
char szText[32];
CString strMessage;
// 時間制限のチェック
// check limit time
enable = (m_Check_Time.GetCheck() ? TRUE : FALSE);
// キャプチャ時間の設定
// set record time
m_Edit_Time.GetWindowText(szText,sizeof(szText));
rec_time = atol(szText);
// パラメータの設定
// Set recorde parameter
enc_return = ENC_Set_Record_Time(ENC_ID, rec_time, enable);
if(enc_return != ENC_SUCCESS)
{
strMessage.LoadString(IDC_ERROR_SET_PARAMETER);
MessageBox(strMessage);
return;
}
CDialog::OnOK();
}