home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 15: Shareware / PC Actual CDT 15.iso / files / Windows_95_98 / Programacion / ActiveX / NCTWavPlayer.exe / Main / TestDevice.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-03-06  |  2.7 KB  |  116 lines

  1. // TestDevice.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "TestVC.h"
  6. #include "TestDevice.h"
  7. #include "TestSheet.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CTestDevice property page
  17.  
  18. IMPLEMENT_DYNCREATE(CTestDevice, CPropertyPage)
  19.  
  20. CTestDevice::CTestDevice() : CPropertyPage(CTestDevice::IDD)
  21. {
  22.     //{{AFX_DATA_INIT(CTestDevice)
  23.     //}}AFX_DATA_INIT
  24. }
  25.  
  26. CTestDevice::~CTestDevice()
  27. {
  28. }
  29.  
  30. void CTestDevice::DoDataExchange(CDataExchange* pDX)
  31. {
  32.     CPropertyPage::DoDataExchange(pDX);
  33.     //{{AFX_DATA_MAP(CTestDevice)
  34.     DDX_Control(pDX, IDC_CHECK2, m_fplay);
  35.     DDX_Control(pDX, IDC_CHECK1, m_frecord);
  36.     DDX_Control(pDX, IDC_COMBO2, m_play);
  37.     DDX_Control(pDX, IDC_COMBO1, m_record);
  38.     //}}AFX_DATA_MAP
  39. }
  40.  
  41.  
  42. BEGIN_MESSAGE_MAP(CTestDevice, CPropertyPage)
  43.     //{{AFX_MSG_MAP(CTestDevice)
  44.     ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
  45.     ON_CBN_SELCHANGE(IDC_COMBO2, OnSelchangeCombo2)
  46.     ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
  47.     ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
  48.     //}}AFX_MSG_MAP
  49. END_MESSAGE_MAP()
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CTestDevice message handlers
  53.  
  54. BOOL CTestDevice::OnInitDialog() 
  55. {
  56.     CPropertyPage::OnInitDialog();
  57.     
  58.     CPropertySheet* pSheet = STATIC_DOWNCAST(CPropertySheet, GetParent());
  59.     CTestSheet* pts = DYNAMIC_DOWNCAST(CTestSheet,pSheet);
  60.     m_player=pts->m_player;
  61.  
  62.     short i,cdev;
  63.  
  64.     cdev=m_player->GetDevInput(); 
  65.     for(i=0;i<=m_player->GetDevInputMax();i++) {
  66.         m_player->SetDevInput(i);
  67.         m_record.InsertString(i,m_player->GetDevInputName()); 
  68.     }
  69.     m_player->SetDevInput(cdev);
  70.     m_record.SetCurSel(m_player->GetDevInput());
  71.     
  72.     cdev=m_player->GetDevOutput(); 
  73.     for(i=0;i<=m_player->GetDevOutputMax();i++) {
  74.         m_player->SetDevOutput(i);
  75.         m_play.InsertString(i,m_player->GetDevOutputName()); 
  76.     }
  77.     m_player->SetDevOutput(cdev);
  78.     m_play.SetCurSel(m_player->GetDevOutput());
  79.  
  80.     m_frecord.SetCheck(m_player->GetFlgEndRecordBlock());  
  81.     m_fplay.SetCheck(m_player->GetFlgSelectedPlay()); 
  82.  
  83.     return TRUE;  // return TRUE unless you set the focus to a control
  84.                   // EXCEPTION: OCX Property Pages should return FALSE
  85. }
  86.  
  87. void CTestDevice::OnSelchangeCombo1() 
  88. {
  89.     SetModified(); 
  90. }
  91.  
  92. void CTestDevice::OnSelchangeCombo2() 
  93. {
  94.     SetModified(); 
  95. }
  96.  
  97. void CTestDevice::OnCheck1() 
  98. {
  99.     SetModified(); 
  100. }
  101.  
  102. void CTestDevice::OnCheck2() 
  103. {
  104.     SetModified(); 
  105. }
  106.  
  107. void CTestDevice::OnOK() 
  108. {
  109.     m_player->SetDevInput(m_record.GetCurSel()); 
  110.     m_player->SetDevOutput(m_play.GetCurSel()); 
  111.     m_player->SetFlgEndRecordBlock(m_frecord.GetCheck());
  112.     m_player->SetFlgSelectedPlay(m_fplay.GetCheck()); 
  113.     
  114.     CPropertyPage::OnOK();
  115. }
  116.