123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- // Seek.cpp : implementation file
- //
- #include "stdafx.h"
- #include "StoneU_HC_CARDOCX.h"
- #include "Seek.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- extern UINT PORT;
- /////////////////////////////////////////////////////////////////////////////
- // CSeek dialog
- CSeek::CSeek(CWnd* pParent /*=NULL*/)
- : CDialog(CSeek::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CSeek)
- m_nSeekType = 0;
- m_nValue = 0;
- //}}AFX_DATA_INIT
- m_pParent = pParent;
- }
- void CSeek::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CSeek)
- DDX_Radio(pDX, IDC_BYFRAME, m_nSeekType);
- DDX_Text(pDX, IDC_VALUE, m_nValue);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CSeek, CDialog)
- //{{AFX_MSG_MAP(CSeek)
- ON_BN_CLICKED(IDC_SEEK, OnSeek)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CSeek message handlers
- void CSeek::OnSeek()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
-
- if(m_nSeekType == 0)
- {
- if(m_nValue >= m_nMaxFrameNum)
- {
- MessageBox("Input frame number is over!");
- return;
- }
- NAME(PlayM4_SetCurrentFrameNum)(PORT, m_nValue);
- }
- else if(m_nSeekType == 1)
- {
- if(m_nValue > m_nMaxTime)
- {
- MessageBox("Input time is over!");
- return;
- }
- NAME(PlayM4_SetPlayedTimeEx)(PORT, m_nValue*1000);
- }
-
- }
- BOOL CSeek::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_nMaxTime = NAME(PlayM4_GetFileTime)(PORT);
- m_nMaxFrameNum = NAME(PlayM4_GetFileTotalFrames)(PORT);
- CString csRange;
- csRange.Format("Ö¡ºÅ·¶Î§(Ö¡): %d~%d\r\nʱ¼ä·¶Î§(Ãë): %d~%d\r\n", 0, m_nMaxFrameNum, 0, m_nMaxTime);
- GetDlgItem(IDC_RANGE)->SetWindowText(csRange);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CSeek::OnOK()
- {
- // TODO: Add extra validation here
- if(m_pParent)
- m_pParent->PostMessage(WM_SEEKOK, 0, 0);
- else
- CDialog::OnOK();
- }
|