projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
win32 miniframe added
[wxWidgets.git]
/
src
/
msw
/
wave.cpp
diff --git
a/src/msw/wave.cpp
b/src/msw/wave.cpp
index 1f3ba0dd82ab16545c14800aafaa9456cb2b02b0..19b164f5a0e0bb773f9d2498c2a6c35ecae501ea 100644
(file)
--- a/
src/msw/wave.cpp
+++ b/
src/msw/wave.cpp
@@
-31,27
+31,31
@@
#include <windows.h>
#include <windowsx.h>
#include <windows.h>
#include <windowsx.h>
-#if
ndef __GNUWIN32__
+#if
!defined( __GNUWIN32__ ) || defined(wxUSE_NORLANDER_HEADERS)
#include <mmsystem.h>
#endif
#include <mmsystem.h>
#endif
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#ifdef __GNUWIN32__
+#ifndef wxUSE_NORLANDER_HEADERS
#include "wx/msw/gnuwin32/extra.h"
#endif
#include "wx/msw/gnuwin32/extra.h"
#endif
+#endif
+#endif
wxWave::wxWave()
wxWave::wxWave()
- : m_wave
Length(0), m_isResource(FALSE), m_waveData(NULL
)
+ : m_wave
Data(NULL), m_waveLength(0), m_isResource(FALSE
)
{
}
wxWave::wxWave(const wxString& sFileName, bool isResource)
{
}
wxWave::wxWave(const wxString& sFileName, bool isResource)
- : m_wave
Length(0), m_isResource(isResource), m_waveData(NULL
)
+ : m_wave
Data(NULL), m_waveLength(0), m_isResource(isResource
)
{
Create(sFileName, isResource);
}
{
Create(sFileName, isResource);
}
-wxWave::wxWave(int size, const
b
yte* data)
- : m_wave
Length(0), m_isResource(FALSE), m_waveData(NULL
)
+wxWave::wxWave(int size, const
wxB
yte* data)
+ : m_wave
Data(NULL), m_waveLength(0), m_isResource(FALSE
)
{
Create(size, data);
}
{
Create(size, data);
}
@@
-70,10
+74,14
@@
bool wxWave::Create(const wxString& fileName, bool isResource)
m_isResource = TRUE;
HRSRC hresInfo;
m_isResource = TRUE;
HRSRC hresInfo;
-#ifdef __WIN32__
- hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, "WAVE");
+#if defined(__WIN32__) && !defined(__TWIN32__)
+#ifdef _UNICODE
+ hresInfo = ::FindResourceW((HMODULE) wxhInstance, fileName, _T("WAVE"));
+#else
+ hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, _T("WAVE"));
+#endif
#else
#else
- hresInfo = ::FindResource((HMODULE) wxhInstance, fileName,
"WAVE"
);
+ hresInfo = ::FindResource((HMODULE) wxhInstance, fileName,
_T("WAVE")
);
#endif
if (!hresInfo)
return FALSE;
#endif
if (!hresInfo)
return FALSE;
@@
-82,7
+90,7
@@
bool wxWave::Create(const wxString& fileName, bool isResource)
if (waveData)
{
if (waveData)
{
- m_waveData= (
b
yte*)::LockResource(waveData);
+ m_waveData= (
wxB
yte*)::LockResource(waveData);
m_waveLength = (int) ::SizeofResource((HMODULE) wxhInstance, hresInfo);
}
m_waveLength = (int) ::SizeofResource((HMODULE) wxhInstance, hresInfo);
}
@@
-98,7
+106,7
@@
bool wxWave::Create(const wxString& fileName, bool isResource)
m_waveLength = (int) fileWave.Length();
m_waveLength = (int) fileWave.Length();
- m_waveData = (
b
yte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
+ m_waveData = (
wxB
yte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
if (!m_waveData)
return FALSE;
if (!m_waveData)
return FALSE;
@@
-108,12
+116,12
@@
bool wxWave::Create(const wxString& fileName, bool isResource)
}
}
}
}
-bool wxWave::Create(int size, const
b
yte* data)
+bool wxWave::Create(int size, const
wxB
yte* data)
{
Free();
m_isResource = FALSE;
m_waveLength=size;
{
Free();
m_isResource = FALSE;
m_waveLength=size;
- m_waveData = (
b
yte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
+ m_waveData = (
wxB
yte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
if (!m_waveData)
return FALSE;
if (!m_waveData)
return FALSE;
@@
-127,7
+135,7
@@
bool wxWave::Play(bool async, bool looped) const
return FALSE;
#ifdef __WIN32__
return FALSE;
#ifdef __WIN32__
- return ( ::PlaySound((LPCSTR)m_waveData, NULL, SND_MEMORY |
+ return ( ::PlaySound((LPC
T
STR)m_waveData, NULL, SND_MEMORY |
SND_NODEFAULT | (async ? SND_ASYNC : SND_SYNC) | (looped ? (SND_LOOP | SND_ASYNC) : 0)) != 0 );
#else
return ( ::sndPlaySound((LPCSTR)m_waveData, SND_MEMORY |
SND_NODEFAULT | (async ? SND_ASYNC : SND_SYNC) | (looped ? (SND_LOOP | SND_ASYNC) : 0)) != 0 );
#else
return ( ::sndPlaySound((LPCSTR)m_waveData, SND_MEMORY |