home *** CD-ROM | disk | FTP | other *** search
- // mixview.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "mix.h"
- #include "mixview.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMixView
-
- IMPLEMENT_DYNCREATE(CMixView, CFormView)
-
- CMixView::CMixView()
- : CFormView(CMixView::IDD)
- {
- //{{AFX_DATA_INIT(CMixView)
- m_midi = NULL;
- m_wav = NULL;
- //}}AFX_DATA_INIT
- }
-
- CMixView::~CMixView()
- {
- }
-
- void CMixView::DoDataExchange(CDataExchange* pDX)
- {
- CFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMixView)
- DDX_VBControl(pDX, IDC_TEGOMM_MIDI, m_midi);
- DDX_VBControl(pDX, IDC_TEGOMM_WAV, m_wav);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CMixView, CFormView)
- //{{AFX_MSG_MAP(CMixView)
- ON_VBXEVENT(VBN_DONE, IDC_TEGOMM_WAV, OnDoneTegommWav)
- ON_VBXEVENT(VBN_DONE, IDC_TEGOMM_MIDI, OnDoneTegommMidi)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CMixView message handlers
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- void CMixView::OnInitialUpdate()
- {
-
- // Call the base class function.
- CFormView::OnInitialUpdate();
-
- // Open the 8KENNED3.WAV file.
- m_wav->SetStrProperty("DeviceType","WaveAudio");
- m_wav->SetStrProperty("FileName",
- "\\VCPROG\\WAV\\8KENNED3.WAV" );
- m_wav->SetStrProperty("Command", "Open");
-
-
- // Open the BOURBON6.MID file.
- m_midi->SetStrProperty("DeviceType","Sequencer");
- m_midi->SetStrProperty("FileName",
- "\\VCPROG\\MIDI\\BOURBON6.MID" );
- m_midi->SetStrProperty("Command", "Open");
-
- }
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- void CMixView::OnDoneTegommWav(UINT, int, CWnd*, LPVOID)
- {
- // TODO: Add your VBX event notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Get current position.
- long position = m_wav->GetNumProperty("Position");
-
- // Get total length.
- long length = m_wav->GetNumProperty("Length");
-
- // If current position is end position, rewind the tape.
- if (position == length)
- m_wav->SetStrProperty("Command", "Prev");
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-
- void CMixView::OnDoneTegommMidi(UINT, int, CWnd*, LPVOID)
- {
- // TODO: Add your VBX event notification handler code here
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Get current position.
- long position = m_midi->GetNumProperty("Position");
-
- // Get total length.
- long length = m_midi->GetNumProperty("Length");
-
- // If current position is end position, rewind the tape.
- if (position == length)
- m_midi->SetStrProperty("Command", "Prev");
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
- }
-