X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e90c1d2a19361551eb07778280f22be3e759cf64..e2c922f53f6a8f08e8a82817c75981822dbe9ca1:/src/msw/wave.cpp?ds=sidebyside diff --git a/src/msw/wave.cpp b/src/msw/wave.cpp index 699b92ebee..1ee0083801 100644 --- a/src/msw/wave.cpp +++ b/src/msw/wave.cpp @@ -5,11 +5,11 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "wave.h" #endif @@ -20,6 +20,8 @@ #pragma hdrstop #endif +#if wxUSE_WAVE + #ifndef WX_PRECOMP #include "wx/wx.h" #endif @@ -28,19 +30,12 @@ #include "wx/msw/wave.h" #include "wx/msw/private.h" -#include #include -#if !defined( __GNUWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS) -#include -#endif - -#ifndef __TWIN32__ -#ifdef __GNUWIN32__ -#ifndef wxUSE_NORLANDER_HEADERS -#include "wx/msw/gnuwin32/extra.h" -#endif -#endif +#if defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__) + #include "wx/msw/gnuwin32/extra.h" +#else + #include #endif wxWave::wxWave() @@ -74,14 +69,14 @@ bool wxWave::Create(const wxString& fileName, bool isResource) m_isResource = TRUE; HRSRC hresInfo; -#if defined(__WIN32__) && !defined(__TWIN32__) +#if defined(__WIN32__) #ifdef _UNICODE - hresInfo = ::FindResourceW((HMODULE) wxhInstance, fileName, T("WAVE")); + hresInfo = ::FindResourceW((HMODULE) wxhInstance, fileName, wxT("WAVE")); #else - hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, T("WAVE")); + hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, wxT("WAVE")); #endif #else - hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, T("WAVE")); + hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, wxT("WAVE")); #endif if (!hresInfo) return FALSE; @@ -106,7 +101,7 @@ bool wxWave::Create(const wxString& fileName, bool isResource) m_waveLength = (int) fileWave.Length(); - m_waveData = (wxByte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength)); + m_waveData = (wxByte*)GlobalLock(GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength)); if (!m_waveData) return FALSE; @@ -121,7 +116,7 @@ bool wxWave::Create(int size, const wxByte* data) Free(); m_isResource = FALSE; m_waveLength=size; - m_waveData = (wxByte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength)); + m_waveData = (wxByte*)GlobalLock(GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength)); if (!m_waveData) return FALSE; @@ -147,20 +142,24 @@ bool wxWave::Free() { if (m_waveData) { -#ifdef __WIN32__ - HGLOBAL waveData = ::GlobalHandle(m_waveData); +#ifdef __WXWINCE__ + HGLOBAL waveData = (HGLOBAL) m_waveData; +#elif defined(__WIN32__) + HGLOBAL waveData = GlobalHandle(m_waveData); #else HGLOBAL waveData = GlobalPtrHandle(m_waveData); #endif if (waveData) { - if (m_isResource) +#ifndef __WXWINCE__ + if (m_isResource) ::FreeResource(waveData); else +#endif { - ::GlobalUnlock(waveData); - ::GlobalFree(waveData); + GlobalUnlock(waveData); + GlobalFree(waveData); } m_waveData = NULL; @@ -171,4 +170,4 @@ bool wxWave::Free() return FALSE; } - +#endif // wxUSE_WAVE