home *** CD-ROM | disk | FTP | other *** search
/ Game Audio Programming / GameAudioProgramming.iso / Game_Audio / AudioTest / SoundOpen.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-05-27  |  2.0 KB  |  68 lines

  1. /***********************************************************\
  2. Copyright (C) James Boer, 2002. 
  3. All rights reserved worldwide.
  4.  
  5. This software is provided "as is" without express or implied
  6. warranties. You may freely copy and compile this source into
  7. applications you distribute provided that the copyright text
  8. below is included in the resulting source code, for example:
  9. "Portions Copyright (C) James Boer, 2002"
  10. \***********************************************************/
  11.  
  12. #include "stdafx.h"
  13. #include "AudioTest.h"
  14. #include "SoundOpen.h"
  15.  
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CSoundOpen
  24.  
  25. IMPLEMENT_DYNAMIC(CSoundOpen, CFileDialog)
  26.  
  27. CSoundOpen::CSoundOpen(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
  28.         DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) :
  29.         CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, 
  30.         lpszFilter, pParentWnd)
  31. {
  32.     m_ofn.hInstance = AfxGetResourceHandle();
  33.     m_ofn.Flags |= OFN_ALLOWMULTISELECT | OFN_ENABLESIZING | 
  34.         OFN_EXPLORER | OFN_ENABLETEMPLATE;
  35.     m_ofn.lpTemplateName = MAKEINTRESOURCE(IDD_SOUND_OPEN);
  36.     m_ofn.lpstrFile = new TCHAR[32768];
  37.     memset(m_ofn.lpstrFile, 0, 32768 * sizeof(TCHAR));
  38.     m_ofn.nMaxFile = 32768;
  39.     m_ofn.lpstrInitialDir = NULL;
  40.     m_bStreaming = false;
  41.     m_bLooping = false;
  42.     m_bMusic = false;
  43. }
  44.  
  45. CSoundOpen::~CSoundOpen()
  46. {
  47.     delete[] m_ofn.lpstrFile;
  48. }
  49.  
  50.  
  51. BEGIN_MESSAGE_MAP(CSoundOpen, CFileDialog)
  52.     //{{AFX_MSG_MAP(CSoundOpen)
  53.         // NOTE - the ClassWizard will add and remove mapping macros here.
  54.     //}}AFX_MSG_MAP
  55. END_MESSAGE_MAP()
  56.  
  57. BOOL CSoundOpen::OnFileNameOK()
  58. {
  59.     CButton* pCheck = (CButton*) GetDlgItem(IDC_OPEN_STREAMING);
  60.     m_bStreaming = (pCheck->GetCheck() == 1);
  61.     pCheck = (CButton*) GetDlgItem(IDC_OPEN_LOOPING);
  62.     m_bLooping = (pCheck->GetCheck() == 1);
  63.     pCheck = (CButton*) GetDlgItem(IDC_OPEN_MUSIC);
  64.     m_bMusic = (pCheck->GetCheck() == 1);
  65.     return FALSE;
  66. }
  67.  
  68.