/////////////////////////////////////////////////////////////////////////////
-// Name: sound.cpp
+// Name: src/os2/sound.cpp
// Purpose: wxSound class implementation: optional
// Author: David Webster
// Modified by:
Create(sFileName, isResource);
}
-wxSound::wxSound(int size, const wxByte* data)
+wxSound::wxSound(size_t size, const void* data)
: m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
{
Create(size, data);
}
}
-bool wxSound::Create(int size, const wxByte* data)
+bool wxSound::Create(size_t size, const void* data)
{
Free();
m_isResource = FALSE;
if (!m_waveData)
return FALSE;
- for (int i=0; i<size; i++) m_waveData[i] = data[i];
+ memcpy(m_waveData, data, size);
return TRUE;
}
-bool wxSound::DoPlay(unsigned flags) const
+bool wxSound::DoPlay(unsigned WXUNUSED(flags)) const
{
- if (!IsOk())
- return FALSE;
+ if (!IsOk())
+ return false;
+
// TODO:
/*
- return ( ::PlaySound((LPCTSTR)m_waveData, NULL, SND_MEMORY |
- SND_NODEFAULT | (async ? SND_ASYNC : SND_SYNC) | (looped ? (SND_LOOP | SND_ASYNC) : 0)) != 0 );
+ return ( ::PlaySound((LPCTSTR)m_waveData, NULL, SND_MEMORY |
+ SND_NODEFAULT | (async ? SND_ASYNC : SND_SYNC) | (looped ? (SND_LOOP | SND_ASYNC) : 0)) != 0 );
*/
- return FALSE;
+ return false;
}
bool wxSound::Free()
{
- if (m_waveData)
- {
+ if (m_waveData)
+ {
// HGLOBAL waveData = ::GlobalHandle(m_waveData);
// TODO:
return TRUE;
}
*/
- }
- return FALSE;
+ }
+ return false;
}
-