X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bcd2b961ff2545f4daf8ca7150b660a23cb0c8f7..e5c4c38b5d3523bfac08987b5ec09d34f4f61caa:/src/gtk/wave.cpp diff --git a/src/gtk/wave.cpp b/src/gtk/wave.cpp index ee85956bed..747514360d 100644 --- a/src/gtk/wave.cpp +++ b/src/gtk/wave.cpp @@ -6,13 +6,17 @@ // Created: 25/10/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ #pragma implementation "wave.h" #endif +#include "wx/setup.h" + +#if wxUSE_WAVE + // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -165,7 +169,6 @@ typedef struct int wxWave::OpenDSP(void) { - wxString str; WAVEFORMAT waveformat; int dev=-1; unsigned long ul; @@ -175,14 +178,14 @@ int wxWave::OpenDSP(void) memcpy(&waveformat,&m_waveData[FMT_INDEX+4],sizeof(WAVEFORMAT)); - str= wxString(m_waveData,4); - if (str != "RIFF") return -1; - str= wxString(&m_waveData[WAVE_INDEX],4); - if (str != "WAVE") return -1; - str= wxString(&m_waveData[FMT_INDEX],4); - if (str != "fmt ") return -1; - str= wxString(&m_waveData[FMT_INDEX+waveformat.uiSize+8],4); - if(str != "data") return -1; + if (memcmp(m_waveData, "RIFF", 4) != 0) + return -1; + if (memcmp(&m_waveData[WAVE_INDEX], "WAVE", 4) != 0) + return -1; + if (memcmp(&m_waveData[FMT_INDEX], "fmt ", 4) != 0) + return -1; + if (memcmp(&m_waveData[FMT_INDEX+waveformat.uiSize+8], "data", 4) != 0) + return -1; memcpy(&ul,&m_waveData[FMT_INDEX+waveformat.uiSize+12],4); m_sizeData=ul; if ((int)(m_sizeData+FMT_INDEX+waveformat.uiSize+16) != m_waveLength) @@ -221,4 +224,5 @@ bool wxWave::InitDSP(int dev, int iDataBits, int iChannel,unsigned long ulSampli return TRUE; } +#endif