X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bda0e173844e8e0f8acf4e8ad8b5c26e5c6fe5d..f5419957e5794f2d10f4e125f77b2c2e2cd222d6:/src/msw/wave.cpp diff --git a/src/msw/wave.cpp b/src/msw/wave.cpp index 8f54200b7b..23f09f7c47 100644 --- a/src/msw/wave.cpp +++ b/src/msw/wave.cpp @@ -21,12 +21,12 @@ #endif #ifndef WX_PRECOMP -#include +#include "wx/wx.h" #endif -#include -#include -#include +#include "wx/file.h" +#include "wx/msw/wave.h" +#include "wx/msw/private.h" #include #include @@ -36,22 +36,27 @@ #endif #ifdef __GNUWIN32__ -#include +#include "wx/msw/gnuwin32/extra.h" #endif -wxWave::wxWave(void) - : m_waveLength(0), m_isResource(FALSE), m_waveData(NULL) +wxWave::wxWave() + : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE) { } wxWave::wxWave(const wxString& sFileName, bool isResource) - : m_waveLength(0), m_isResource(isResource), m_waveData(NULL) + : m_waveData(NULL), m_waveLength(0), m_isResource(isResource) { Create(sFileName, isResource); } +wxWave::wxWave(int size, const byte* data) + : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE) +{ + Create(size, data); +} -wxWave::~wxWave(void) +wxWave::~wxWave() { Free(); } @@ -103,6 +108,19 @@ bool wxWave::Create(const wxString& fileName, bool isResource) } } +bool wxWave::Create(int size, const byte* data) +{ + Free(); + m_isResource = FALSE; + m_waveLength=size; + m_waveData = (byte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength)); + if (!m_waveData) + return FALSE; + + for (int i=0; i