home *** CD-ROM | disk | FTP | other *** search
- // cdview.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "cd.h"
- #include "cdview.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CCdView
-
- IMPLEMENT_DYNCREATE(CCdView, CFormView)
-
- CCdView::CCdView()
- : CFormView(CCdView::IDD)
- {
- //{{AFX_DATA_INIT(CCdView)
- m_cd = NULL;
- m_CurrentTrack = 0;
- //}}AFX_DATA_INIT
- }
-
- CCdView::~CCdView()
- {
- }
-
- void CCdView::DoDataExchange(CDataExchange* pDX)
- {
- CFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CCdView)
- DDX_VBControl(pDX, IDC_TEGOMM_CD, m_cd);
- DDX_Text(pDX, IDC_CURRENT_TRACK, m_CurrentTrack);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CCdView, CFormView)
- //{{AFX_MSG_MAP(CCdView)
- ON_BN_CLICKED(IDC_BUTTON_LOAD, OnButtonLoad)
- ON_VBXEVENT(VBN_STATUSUPDATE, IDC_TEGOMM_CD, OnStatusupdateTegommCd)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CCdView message handlers
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- void CCdView::OnInitialUpdate()
- {
-
- // Call the base class function.
- CFormView::OnInitialUpdate();
-
- // Set the DeviceType property to "CDAudio".
- m_cd->SetStrProperty("DeviceType","CDAudio");
-
- // Set the UpdateInterval property to 250 milliseconds.
- m_cd->SetNumProperty("UpdateInterval",250);
-
- }
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- void CCdView::OnButtonLoad()
- {
- // TODO: Add your control notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Issue an Open command to the multimedia control.
- m_cd->SetStrProperty("Command", "Open");
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CCdView::OnStatusupdateTegommCd(UINT, int, CWnd*, LPVOID)
- {
- // TODO: Add your VBX event notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Set the TimeFormat property to "tmsf".
- // (TimeFormat = "tmsf" = Tracks, Minutes, Seconds, Frames)
- m_cd->SetStrProperty("TimeFormat","tmsf");
-
- // Get the current track.
- m_CurrentTrack = (BYTE)m_cd->GetNumProperty("Position");
-
- // Update the screen with the new value of m_CurrentTrack
- UpdateData(FALSE);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-