home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************\
- Copyright (C) James Boer, 2002.
- All rights reserved worldwide.
-
- This software is provided "as is" without express or implied
- warranties. You may freely copy and compile this source into
- applications you distribute provided that the copyright text
- below is included in the resulting source code, for example:
- "Portions Copyright (C) James Boer, 2002"
- \***********************************************************/
-
- #include "stdafx.h"
- #include "AudioTest.h"
- #include "SoundOpen.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CSoundOpen
-
- IMPLEMENT_DYNAMIC(CSoundOpen, CFileDialog)
-
- CSoundOpen::CSoundOpen(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
- DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) :
- CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags,
- lpszFilter, pParentWnd)
- {
- m_ofn.hInstance = AfxGetResourceHandle();
- m_ofn.Flags |= OFN_ALLOWMULTISELECT | OFN_ENABLESIZING |
- OFN_EXPLORER | OFN_ENABLETEMPLATE;
- m_ofn.lpTemplateName = MAKEINTRESOURCE(IDD_SOUND_OPEN);
- m_ofn.lpstrFile = new TCHAR[32768];
- memset(m_ofn.lpstrFile, 0, 32768 * sizeof(TCHAR));
- m_ofn.nMaxFile = 32768;
- m_ofn.lpstrInitialDir = NULL;
- m_bStreaming = false;
- m_bLooping = false;
- m_bMusic = false;
- }
-
- CSoundOpen::~CSoundOpen()
- {
- delete[] m_ofn.lpstrFile;
- }
-
-
- BEGIN_MESSAGE_MAP(CSoundOpen, CFileDialog)
- //{{AFX_MSG_MAP(CSoundOpen)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- BOOL CSoundOpen::OnFileNameOK()
- {
- CButton* pCheck = (CButton*) GetDlgItem(IDC_OPEN_STREAMING);
- m_bStreaming = (pCheck->GetCheck() == 1);
- pCheck = (CButton*) GetDlgItem(IDC_OPEN_LOOPING);
- m_bLooping = (pCheck->GetCheck() == 1);
- pCheck = (CButton*) GetDlgItem(IDC_OPEN_MUSIC);
- m_bMusic = (pCheck->GetCheck() == 1);
- return FALSE;
- }
-
-