X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ee4f8c2af9c6c5458e488db10aef7d00a89ace25..a38b83c353cce75329b2c53c0eaa4ad0f500ccf1:/src/msw/wave.cpp diff --git a/src/msw/wave.cpp b/src/msw/wave.cpp index 6486eec941..23f09f7c47 100644 --- a/src/msw/wave.cpp +++ b/src/msw/wave.cpp @@ -40,16 +40,21 @@ #endif wxWave::wxWave() - : m_waveLength(0), m_isResource(FALSE), m_waveData(NULL) + : 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() { @@ -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