<set var="ADVANCED_MSW_SRC" hints="files">
src/common/taskbarcmn.cpp
src/msw/joystick.cpp
+ src/msw/sound.cpp
src/msw/taskbar.cpp
- src/msw/wave.cpp
</set>
<set var="ADVANCED_MSW_HDR" hints="files">
wx/msw/joystick.h
+ wx/msw/sound.h
wx/msw/taskbar.h
- wx/msw/wave.h
</set>
<set var="ADVANCED_MAC_SRC" hints="files">
src/mac/joystick.cpp
- src/mac/wave.cpp
+ src/mac/sound.cpp
</set>
<set var="ADVANCED_MAC_HDR" hints="files">
wx/mac/joystick.h
- wx/mac/wave.h
+ wx/mac/sound.h
</set>
<set var="ADVANCED_OS2_SRC" hints="files">
src/os2/joystick.cpp
- src/os2/wave.cpp
+ src/os2/sound.cpp
</set>
<set var="ADVANCED_OS2_HDR" hints="files">
wx/os2/joystick.h
- wx/os2/wave.h
+ wx/os2/sound.h
</set>
<set var="ADVANCED_UNIX_SRC" hints="files">
\input view.tex
\input vlbox.tex
\input vscroll.tex
-\input wave.tex
+\input sound.tex
\input window.tex
\input windowdc.tex
\input wnddisbl.tex
\item{ \helpref{wxSplashScreen}{wxsplashscreen} }
\item{ \helpref{wxTaskBarIcon}{wxtaskbaricon} }
\item{ wxTipDialog }
-\item{ \helpref{wxWave}{wxwave} }
+\item{ \helpref{wxSound}{wxsound} }
\item{ \helpref{wxWizard}{wxwizard} }
\item{ \helpref{wxSashLayoutWindow}{wxsashlayoutwindow} }
\item{ \helpref{wxSashWindow}{wxsashwindow} }
--- /dev/null
+\section{\class{wxSound}}\label{wxsound}
+
+This class represents a short wave file, in Windows WAV format, that
+can be stored in memory and played. Currently this class is implemented
+on Windows and Linux only.
+
+\wxheading{Derived from}
+
+\helpref{wxObject}{wxobject}
+
+\wxheading{Include files}
+
+<wx/wave.h>
+
+\latexignore{\rtfignore{\wxheading{Members}}}
+
+\membersection{wxSound::wxSound}\label{wxsoundconstr}
+
+\func{}{wxSound}{\void}
+
+Default constructor.
+
+\func{}{wxSound}{\param{const wxString\&}{ fileName}, \param{bool}{ isResource = false}}
+
+Constructs a wave object from a file or resource. Call \helpref{wxSound::IsOk}{wxsoundisok} to
+determine whether this succeeded.
+
+\wxheading{Parameters}
+
+\docparam{fileName}{The filename or Windows resource.}
+
+\docparam{isResource}{true if {\it fileName} is a resource, false if it is a filename.}
+
+\membersection{wxSound::\destruct{wxSound}}
+
+\func{}{\destruct{wxSound}}{\void}
+
+Destroys the wxSound object.
+
+\membersection{wxSound::Create}\label{wxsoundcreate}
+
+\func{bool}{Create}{\param{const wxString\&}{ fileName}, \param{bool}{ isResource = false}}
+
+Constructs a wave object from a file or resource.
+
+\wxheading{Parameters}
+
+\docparam{fileName}{The filename or Windows resource.}
+
+\docparam{isResource}{true if {\it fileName} is a resource, false if it is a filename.}
+
+\wxheading{Return value}
+
+true if the call was successful, false otherwise.
+
+\membersection{wxSound::IsOk}\label{wxsoundisok}
+
+\constfunc{bool}{IsOk}{\void}
+
+Returns true if the object contains a successfully loaded file or resource, false otherwise.
+
+\membersection{wxSound::Play}\label{wxsoundplay}
+
+\constfunc{bool}{Play}{\param{bool}{ async = true}, \param{bool}{ looped = false}}
+
+Plays the wave file synchronously or asynchronously, looped or single-shot.
+
+
\subsection{Sound sample}\label{samplesound}
-The {\tt sound} sample shows how to use \helpref{wxWave}{wxwave} for simple
+The {\tt sound} sample shows how to use \helpref{wxSound}{wxsound} for simple
audio output (e.g. notifications).
+++ /dev/null
-\section{\class{wxWave}}\label{wxwave}
-
-This class represents a short wave file, in Windows WAV format, that
-can be stored in memory and played. Currently this class is implemented
-on Windows and Linux only.
-
-\wxheading{Derived from}
-
-\helpref{wxObject}{wxobject}
-
-\wxheading{Include files}
-
-<wx/wave.h>
-
-\latexignore{\rtfignore{\wxheading{Members}}}
-
-\membersection{wxWave::wxWave}\label{wxwaveconstr}
-
-\func{}{wxWave}{\void}
-
-Default constructor.
-
-\func{}{wxWave}{\param{const wxString\&}{ fileName}, \param{bool}{ isResource = false}}
-
-Constructs a wave object from a file or resource. Call \helpref{wxWave::IsOk}{wxwaveisok} to
-determine whether this succeeded.
-
-\wxheading{Parameters}
-
-\docparam{fileName}{The filename or Windows resource.}
-
-\docparam{isResource}{true if {\it fileName} is a resource, false if it is a filename.}
-
-\membersection{wxWave::\destruct{wxWave}}
-
-\func{}{\destruct{wxWave}}{\void}
-
-Destroys the wxWave object.
-
-\membersection{wxWave::Create}\label{wxwavecreate}
-
-\func{bool}{Create}{\param{const wxString\&}{ fileName}, \param{bool}{ isResource = false}}
-
-Constructs a wave object from a file or resource.
-
-\wxheading{Parameters}
-
-\docparam{fileName}{The filename or Windows resource.}
-
-\docparam{isResource}{true if {\it fileName} is a resource, false if it is a filename.}
-
-\wxheading{Return value}
-
-true if the call was successful, false otherwise.
-
-\membersection{wxWave::IsOk}\label{wxwaveisok}
-
-\constfunc{bool}{IsOk}{\void}
-
-Returns true if the object contains a successfully loaded file or resource, false otherwise.
-
-\membersection{wxWave::Play}\label{wxwaveplay}
-
-\constfunc{bool}{Play}{\param{bool}{ async = true}, \param{bool}{ looped = false}}
-
-Plays the wave file synchronously or asynchronously, looped or single-shot.
-
-
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: sound.cpp
+// Purpose: wxSound class implementation: optional
+// Author: Stefan Csomor
+// Modified by:
+// Created: 1998-01-01
+// RCS-ID: $Id$
+// Copyright: (c) Stefan Csomor
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "sound.h"
+#endif
+
+#include "wx/object.h"
+#include "wx/string.h"
+#include "wx/sound.h"
+
+#if wxUSE_SOUND
+
+#ifdef __WXMAC__
+#include "wx/mac/private.h"
+#ifndef __DARWIN__
+#include <Sound.h>
+#endif
+#endif
+
+wxSound::wxSound()
+ : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
+{
+}
+
+wxSound::wxSound(const wxString& sFileName, bool isResource)
+ : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
+{
+ Create(sFileName, isResource);
+}
+
+
+wxSound::~wxSound()
+{
+ FreeData();
+}
+
+wxSound::wxSound(int size, const wxByte* data)
+ : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(false)
+{
+ //TODO convert data
+}
+
+bool wxSound::Create(const wxString& fileName, bool isResource)
+{
+ bool ret = false;
+ m_sndname = fileName;
+ m_isResource = isResource;
+
+ if (m_isResource)
+ ret = true;
+ else
+ { /*
+ if (sndChan)
+ { // we're playing
+ FSClose(SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel(sndChan, TRUE);
+ free(sndChan);
+ sndChan = 0;
+ KillTimer(0,timerID);
+ }
+
+ if (!lpSnd)
+ return true;
+
+ if (_access(lpSnd,0)) // no file, no service
+ return false;
+
+ // Allocate SndChannel
+ sndChan = (SndChannelPtr) malloc (sizeof(SndChannel));
+
+ if (!sndChan)
+ return false;
+
+ sndChan->qLength = 128;
+
+ if (noErr != SndNewChannel (&sndChan, sampledSynth, initMono | initNoInterp, 0))
+ {
+ free(sndChan);
+ sndChan = 0;
+ return false;
+ }
+
+ if (!(SndRefNum = MacOpenSndFile ((char *)lpSnd)))
+ {
+ SndDisposeChannel(sndChan, TRUE);
+ free(sndChan);
+ sndChan = 0;
+
+ return false;
+ }
+
+ bool async = false;
+
+ if (fdwSound & SND_ASYNC)
+ async = true;
+
+ if (SndStartFilePlay(sndChan, SndRefNum, 0, 81920, 0, 0, 0, async) != noErr)
+ {
+ FSClose (SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel (sndChan, TRUE);
+ free (sndChan);
+ sndChan = 0;
+ return false;
+ }
+
+ if (async)
+ { // haven't finish yet
+ timerID = SetTimer(0, 0, 250, TimerCallBack);
+ }
+ else
+ {
+ FSClose (SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel (sndChan, TRUE);
+ free (sndChan);
+ sndChan = 0;
+ }*/
+ }
+
+ return ret;
+}
+
+
+//don't know what to do with looped, wth
+bool wxSound::DoPlay(unsigned flags) const
+{
+ bool ret = false;
+
+ if (m_isResource)
+ {
+ Str255 snd ;
+ wxMacStringToPascal( m_sndname , snd ) ;
+ SndListHandle hSnd;
+
+ hSnd = (SndListHandle) GetNamedResource('snd ', snd);
+
+ if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, (flags & wxSOUND_ASYNC)) == noErr))
+ ret = true;
+ }
+
+ return ret;
+}
+
+
+bool wxSound::FreeData()
+{
+ bool ret = false;
+
+ if (m_isResource)
+ {
+ m_sndname.Empty();
+ ret = true;
+ }
+ else
+ {
+ //TODO,
+ }
+
+ return ret;
+}
+
+
+//code below is from an old implementation used for telinfo with MSVC crossplatform support
+//technology proceeds, so it would be the wisest to drop this code, but it's left here just
+//for the sake of a reference. BTW: Wave files can now be played with QT, starting from V3
+
+/*static short MacOpenSndFile (char * path)
+{
+ VolumeParam vp;
+ FSSpec fspec;
+ Str255 name;
+ char *c;
+
+ // first, get the volume reference number for the file. Start by
+ // making a Pstring with just the volume name
+ strcpy ((char *) name, path);
+ if (c = strchr ((char *) name, ':'))
+ {
+ c++;
+ *c = '\0';
+ }
+
+ c2pstr ((char *) name);
+ vp.ioCompletion = 0;
+ vp.ioVolIndex = -1;
+ vp.ioNamePtr = name;
+ vp.ioVRefNum = 0;
+
+ if (PBGetVInfo((ParamBlockRec *)&vp, 0) != noErr)
+ return 0;
+
+ // next, buld an FSSpec for the file
+ strcpy ((char *) name, path);
+ c2pstr ((char *) name);
+ if (FSMakeFSSpec (vp.ioVRefNum, 0, name, &fspec) != noErr)
+ return 0;
+
+ short frefnum;
+ // now open the file, and return it's reference number
+ if (FSpOpenDF(&fspec, fsRdPerm, &frefnum) != noErr)
+ return 0;
+
+ return frefnum;
+}
+
+
+void TimerCallBack(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime)
+{
+ if(!sndChan)
+ {
+ KillTimer(0,timerID);
+ return;
+ }
+
+ SCStatus scstat;
+
+ if (noErr == SndChannelStatus (sndChan, sizeof (SCStatus), &scstat)) {
+ if (scstat.scChannelPaused || scstat.scChannelBusy)
+ return; // not done yet
+ }
+
+ // either error or done.
+ FSClose (SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel (sndChan, TRUE);
+ free (sndChan);
+ sndChan = 0;
+ KillTimer(0,timerID);
+}*/
+
+
+#endif
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: wave.cpp
-// Purpose: wxWave class implementation: optional
-// Author: Stefan Csomor
-// Modified by:
-// Created: 1998-01-01
-// RCS-ID: $Id$
-// Copyright: (c) Stefan Csomor
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
-#pragma implementation "wave.h"
-#endif
-
-#include "wx/object.h"
-#include "wx/string.h"
-#include "wx/wave.h"
-
-#if wxUSE_WAVE
-
-#ifdef __WXMAC__
-#include "wx/mac/private.h"
-#ifndef __DARWIN__
-#include <Sound.h>
-#endif
-#endif
-
-wxWave::wxWave()
- : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
-{
-}
-
-wxWave::wxWave(const wxString& sFileName, bool isResource)
- : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
-{
- Create(sFileName, isResource);
-}
-
-
-wxWave::~wxWave()
-{
- FreeData();
-}
-
-wxWave::wxWave(int size, const wxByte* data)
- : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(false)
-{
- //TODO convert data
-}
-
-bool wxWave::Create(const wxString& fileName, bool isResource)
-{
- bool ret = false;
- m_sndname = fileName;
- m_isResource = isResource;
-
- if (m_isResource)
- ret = true;
- else
- { /*
- if (sndChan)
- { // we're playing
- FSClose(SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel(sndChan, TRUE);
- free(sndChan);
- sndChan = 0;
- KillTimer(0,timerID);
- }
-
- if (!lpSnd)
- return true;
-
- if (_access(lpSnd,0)) // no file, no service
- return false;
-
- // Allocate SndChannel
- sndChan = (SndChannelPtr) malloc (sizeof(SndChannel));
-
- if (!sndChan)
- return false;
-
- sndChan->qLength = 128;
-
- if (noErr != SndNewChannel (&sndChan, sampledSynth, initMono | initNoInterp, 0))
- {
- free(sndChan);
- sndChan = 0;
- return false;
- }
-
- if (!(SndRefNum = MacOpenSndFile ((char *)lpSnd)))
- {
- SndDisposeChannel(sndChan, TRUE);
- free(sndChan);
- sndChan = 0;
-
- return false;
- }
-
- bool async = false;
-
- if (fdwSound & SND_ASYNC)
- async = true;
-
- if (SndStartFilePlay(sndChan, SndRefNum, 0, 81920, 0, 0, 0, async) != noErr)
- {
- FSClose (SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel (sndChan, TRUE);
- free (sndChan);
- sndChan = 0;
- return false;
- }
-
- if (async)
- { // haven't finish yet
- timerID = SetTimer(0, 0, 250, TimerCallBack);
- }
- else
- {
- FSClose (SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel (sndChan, TRUE);
- free (sndChan);
- sndChan = 0;
- }*/
- }
-
- return ret;
-}
-
-
-//don't know what to do with looped, wth
-bool wxWave::Play(bool async, bool looped) const
-{
- bool ret = false;
-
- if (m_isResource)
- {
- Str255 snd ;
- wxMacStringToPascal( m_sndname , snd ) ;
- SndListHandle hSnd;
-
- hSnd = (SndListHandle) GetNamedResource('snd ', snd);
-
- if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, async) == noErr))
- ret = true;
- }
-
- return ret;
-}
-
-
-bool wxWave::FreeData()
-{
- bool ret = false;
-
- if (m_isResource)
- {
- m_sndname.Empty();
- ret = true;
- }
- else
- {
- //TODO,
- }
-
- return ret;
-}
-
-
-//code below is from an old implementation used for telinfo with MSVC crossplatform support
-//technology proceeds, so it would be the wisest to drop this code, but it's left here just
-//for the sake of a reference. BTW: Wave files can now be played with QT, starting from V3
-
-/*static short MacOpenSndFile (char * path)
-{
- VolumeParam vp;
- FSSpec fspec;
- Str255 name;
- char *c;
-
- // first, get the volume reference number for the file. Start by
- // making a Pstring with just the volume name
- strcpy ((char *) name, path);
- if (c = strchr ((char *) name, ':'))
- {
- c++;
- *c = '\0';
- }
-
- c2pstr ((char *) name);
- vp.ioCompletion = 0;
- vp.ioVolIndex = -1;
- vp.ioNamePtr = name;
- vp.ioVRefNum = 0;
-
- if (PBGetVInfo((ParamBlockRec *)&vp, 0) != noErr)
- return 0;
-
- // next, buld an FSSpec for the file
- strcpy ((char *) name, path);
- c2pstr ((char *) name);
- if (FSMakeFSSpec (vp.ioVRefNum, 0, name, &fspec) != noErr)
- return 0;
-
- short frefnum;
- // now open the file, and return it's reference number
- if (FSpOpenDF(&fspec, fsRdPerm, &frefnum) != noErr)
- return 0;
-
- return frefnum;
-}
-
-
-void TimerCallBack(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime)
-{
- if(!sndChan)
- {
- KillTimer(0,timerID);
- return;
- }
-
- SCStatus scstat;
-
- if (noErr == SndChannelStatus (sndChan, sizeof (SCStatus), &scstat)) {
- if (scstat.scChannelPaused || scstat.scChannelBusy)
- return; // not done yet
- }
-
- // either error or done.
- FSClose (SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel (sndChan, TRUE);
- free (sndChan);
- sndChan = 0;
- KillTimer(0,timerID);
-}*/
-
-
-#endif
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: sound.cpp
+// Purpose: wxSound class implementation: optional
+// Author: Stefan Csomor
+// Modified by:
+// Created: 1998-01-01
+// RCS-ID: $Id$
+// Copyright: (c) Stefan Csomor
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "sound.h"
+#endif
+
+#include "wx/object.h"
+#include "wx/string.h"
+#include "wx/sound.h"
+
+#if wxUSE_SOUND
+
+#ifdef __WXMAC__
+#include "wx/mac/private.h"
+#ifndef __DARWIN__
+#include <Sound.h>
+#endif
+#endif
+
+wxSound::wxSound()
+ : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
+{
+}
+
+wxSound::wxSound(const wxString& sFileName, bool isResource)
+ : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
+{
+ Create(sFileName, isResource);
+}
+
+
+wxSound::~wxSound()
+{
+ FreeData();
+}
+
+wxSound::wxSound(int size, const wxByte* data)
+ : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(false)
+{
+ //TODO convert data
+}
+
+bool wxSound::Create(const wxString& fileName, bool isResource)
+{
+ bool ret = false;
+ m_sndname = fileName;
+ m_isResource = isResource;
+
+ if (m_isResource)
+ ret = true;
+ else
+ { /*
+ if (sndChan)
+ { // we're playing
+ FSClose(SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel(sndChan, TRUE);
+ free(sndChan);
+ sndChan = 0;
+ KillTimer(0,timerID);
+ }
+
+ if (!lpSnd)
+ return true;
+
+ if (_access(lpSnd,0)) // no file, no service
+ return false;
+
+ // Allocate SndChannel
+ sndChan = (SndChannelPtr) malloc (sizeof(SndChannel));
+
+ if (!sndChan)
+ return false;
+
+ sndChan->qLength = 128;
+
+ if (noErr != SndNewChannel (&sndChan, sampledSynth, initMono | initNoInterp, 0))
+ {
+ free(sndChan);
+ sndChan = 0;
+ return false;
+ }
+
+ if (!(SndRefNum = MacOpenSndFile ((char *)lpSnd)))
+ {
+ SndDisposeChannel(sndChan, TRUE);
+ free(sndChan);
+ sndChan = 0;
+
+ return false;
+ }
+
+ bool async = false;
+
+ if (fdwSound & SND_ASYNC)
+ async = true;
+
+ if (SndStartFilePlay(sndChan, SndRefNum, 0, 81920, 0, 0, 0, async) != noErr)
+ {
+ FSClose (SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel (sndChan, TRUE);
+ free (sndChan);
+ sndChan = 0;
+ return false;
+ }
+
+ if (async)
+ { // haven't finish yet
+ timerID = SetTimer(0, 0, 250, TimerCallBack);
+ }
+ else
+ {
+ FSClose (SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel (sndChan, TRUE);
+ free (sndChan);
+ sndChan = 0;
+ }*/
+ }
+
+ return ret;
+}
+
+
+//don't know what to do with looped, wth
+bool wxSound::DoPlay(unsigned flags) const
+{
+ bool ret = false;
+
+ if (m_isResource)
+ {
+ Str255 snd ;
+ wxMacStringToPascal( m_sndname , snd ) ;
+ SndListHandle hSnd;
+
+ hSnd = (SndListHandle) GetNamedResource('snd ', snd);
+
+ if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, (flags & wxSOUND_ASYNC)) == noErr))
+ ret = true;
+ }
+
+ return ret;
+}
+
+
+bool wxSound::FreeData()
+{
+ bool ret = false;
+
+ if (m_isResource)
+ {
+ m_sndname.Empty();
+ ret = true;
+ }
+ else
+ {
+ //TODO,
+ }
+
+ return ret;
+}
+
+
+//code below is from an old implementation used for telinfo with MSVC crossplatform support
+//technology proceeds, so it would be the wisest to drop this code, but it's left here just
+//for the sake of a reference. BTW: Wave files can now be played with QT, starting from V3
+
+/*static short MacOpenSndFile (char * path)
+{
+ VolumeParam vp;
+ FSSpec fspec;
+ Str255 name;
+ char *c;
+
+ // first, get the volume reference number for the file. Start by
+ // making a Pstring with just the volume name
+ strcpy ((char *) name, path);
+ if (c = strchr ((char *) name, ':'))
+ {
+ c++;
+ *c = '\0';
+ }
+
+ c2pstr ((char *) name);
+ vp.ioCompletion = 0;
+ vp.ioVolIndex = -1;
+ vp.ioNamePtr = name;
+ vp.ioVRefNum = 0;
+
+ if (PBGetVInfo((ParamBlockRec *)&vp, 0) != noErr)
+ return 0;
+
+ // next, buld an FSSpec for the file
+ strcpy ((char *) name, path);
+ c2pstr ((char *) name);
+ if (FSMakeFSSpec (vp.ioVRefNum, 0, name, &fspec) != noErr)
+ return 0;
+
+ short frefnum;
+ // now open the file, and return it's reference number
+ if (FSpOpenDF(&fspec, fsRdPerm, &frefnum) != noErr)
+ return 0;
+
+ return frefnum;
+}
+
+
+void TimerCallBack(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime)
+{
+ if(!sndChan)
+ {
+ KillTimer(0,timerID);
+ return;
+ }
+
+ SCStatus scstat;
+
+ if (noErr == SndChannelStatus (sndChan, sizeof (SCStatus), &scstat)) {
+ if (scstat.scChannelPaused || scstat.scChannelBusy)
+ return; // not done yet
+ }
+
+ // either error or done.
+ FSClose (SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel (sndChan, TRUE);
+ free (sndChan);
+ sndChan = 0;
+ KillTimer(0,timerID);
+}*/
+
+
+#endif
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: wave.cpp
-// Purpose: wxWave class implementation: optional
-// Author: Stefan Csomor
-// Modified by:
-// Created: 1998-01-01
-// RCS-ID: $Id$
-// Copyright: (c) Stefan Csomor
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUG__
-#pragma implementation "wave.h"
-#endif
-
-#include "wx/object.h"
-#include "wx/string.h"
-#include "wx/wave.h"
-
-#if wxUSE_WAVE
-
-#ifdef __WXMAC__
-#include "wx/mac/private.h"
-#ifndef __DARWIN__
-#include <Sound.h>
-#endif
-#endif
-
-wxWave::wxWave()
- : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
-{
-}
-
-wxWave::wxWave(const wxString& sFileName, bool isResource)
- : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
-{
- Create(sFileName, isResource);
-}
-
-
-wxWave::~wxWave()
-{
- FreeData();
-}
-
-wxWave::wxWave(int size, const wxByte* data)
- : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(false)
-{
- //TODO convert data
-}
-
-bool wxWave::Create(const wxString& fileName, bool isResource)
-{
- bool ret = false;
- m_sndname = fileName;
- m_isResource = isResource;
-
- if (m_isResource)
- ret = true;
- else
- { /*
- if (sndChan)
- { // we're playing
- FSClose(SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel(sndChan, TRUE);
- free(sndChan);
- sndChan = 0;
- KillTimer(0,timerID);
- }
-
- if (!lpSnd)
- return true;
-
- if (_access(lpSnd,0)) // no file, no service
- return false;
-
- // Allocate SndChannel
- sndChan = (SndChannelPtr) malloc (sizeof(SndChannel));
-
- if (!sndChan)
- return false;
-
- sndChan->qLength = 128;
-
- if (noErr != SndNewChannel (&sndChan, sampledSynth, initMono | initNoInterp, 0))
- {
- free(sndChan);
- sndChan = 0;
- return false;
- }
-
- if (!(SndRefNum = MacOpenSndFile ((char *)lpSnd)))
- {
- SndDisposeChannel(sndChan, TRUE);
- free(sndChan);
- sndChan = 0;
-
- return false;
- }
-
- bool async = false;
-
- if (fdwSound & SND_ASYNC)
- async = true;
-
- if (SndStartFilePlay(sndChan, SndRefNum, 0, 81920, 0, 0, 0, async) != noErr)
- {
- FSClose (SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel (sndChan, TRUE);
- free (sndChan);
- sndChan = 0;
- return false;
- }
-
- if (async)
- { // haven't finish yet
- timerID = SetTimer(0, 0, 250, TimerCallBack);
- }
- else
- {
- FSClose (SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel (sndChan, TRUE);
- free (sndChan);
- sndChan = 0;
- }*/
- }
-
- return ret;
-}
-
-
-//don't know what to do with looped, wth
-bool wxWave::Play(bool async, bool looped) const
-{
- bool ret = false;
-
- if (m_isResource)
- {
- Str255 snd ;
- wxMacStringToPascal( m_sndname , snd ) ;
- SndListHandle hSnd;
-
- hSnd = (SndListHandle) GetNamedResource('snd ', snd);
-
- if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, async) == noErr))
- ret = true;
- }
-
- return ret;
-}
-
-
-bool wxWave::FreeData()
-{
- bool ret = false;
-
- if (m_isResource)
- {
- m_sndname.Empty();
- ret = true;
- }
- else
- {
- //TODO,
- }
-
- return ret;
-}
-
-
-//code below is from an old implementation used for telinfo with MSVC crossplatform support
-//technology proceeds, so it would be the wisest to drop this code, but it's left here just
-//for the sake of a reference. BTW: Wave files can now be played with QT, starting from V3
-
-/*static short MacOpenSndFile (char * path)
-{
- VolumeParam vp;
- FSSpec fspec;
- Str255 name;
- char *c;
-
- // first, get the volume reference number for the file. Start by
- // making a Pstring with just the volume name
- strcpy ((char *) name, path);
- if (c = strchr ((char *) name, ':'))
- {
- c++;
- *c = '\0';
- }
-
- c2pstr ((char *) name);
- vp.ioCompletion = 0;
- vp.ioVolIndex = -1;
- vp.ioNamePtr = name;
- vp.ioVRefNum = 0;
-
- if (PBGetVInfo((ParamBlockRec *)&vp, 0) != noErr)
- return 0;
-
- // next, buld an FSSpec for the file
- strcpy ((char *) name, path);
- c2pstr ((char *) name);
- if (FSMakeFSSpec (vp.ioVRefNum, 0, name, &fspec) != noErr)
- return 0;
-
- short frefnum;
- // now open the file, and return it's reference number
- if (FSpOpenDF(&fspec, fsRdPerm, &frefnum) != noErr)
- return 0;
-
- return frefnum;
-}
-
-
-void TimerCallBack(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime)
-{
- if(!sndChan)
- {
- KillTimer(0,timerID);
- return;
- }
-
- SCStatus scstat;
-
- if (noErr == SndChannelStatus (sndChan, sizeof (SCStatus), &scstat)) {
- if (scstat.scChannelPaused || scstat.scChannelBusy)
- return; // not done yet
- }
-
- // either error or done.
- FSClose (SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel (sndChan, TRUE);
- free (sndChan);
- sndChan = 0;
- KillTimer(0,timerID);
-}*/
-
-
-#endif
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: sound.cpp
+// Purpose: wxSound
+// Author: Julian Smart
+// Modified by:
+// Created: 04/01/98
+// RCS-ID: $Id$
+// Copyright: (c) Julian Smart
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+#pragma implementation "sound.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#if defined(__BORLANDC__)
+#pragma hdrstop
+#endif
+
+#if wxUSE_SOUND
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+#include "wx/file.h"
+#include "wx/sound.h"
+#include "wx/msw/private.h"
+
+#include <windowsx.h>
+
+#if defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)
+ #include "wx/msw/gnuwin32/extra.h"
+#else
+ #include <mmsystem.h>
+#endif
+
+wxSound::wxSound()
+ : m_waveData(NULL), m_waveLength(0), m_isResource(false)
+{
+}
+
+wxSound::wxSound(const wxString& sFileName, bool isResource)
+ : m_waveData(NULL), m_waveLength(0), m_isResource(isResource)
+{
+ Create(sFileName, isResource);
+}
+
+wxSound::wxSound(int size, const wxByte* data)
+ : m_waveData(NULL), m_waveLength(0), m_isResource(false)
+{
+ Create(size, data);
+}
+
+wxSound::~wxSound()
+{
+ Free();
+}
+
+bool wxSound::Create(const wxString& fileName, bool isResource)
+{
+ Free();
+
+ if (isResource)
+ {
+ m_isResource = TRUE;
+
+ HRSRC hresInfo;
+ hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, wxT("WAVE"));
+ if (!hresInfo)
+ return false;
+
+ HGLOBAL waveData = ::LoadResource((HMODULE) wxhInstance, hresInfo);
+
+ if (waveData)
+ {
+ m_waveData= (wxByte*)::LockResource(waveData);
+ m_waveLength = (int) ::SizeofResource((HMODULE) wxhInstance, hresInfo);
+ }
+
+ return (m_waveData ? true : false);
+ }
+ else
+ {
+ m_isResource = false;
+
+ wxFile fileWave;
+ if (!fileWave.Open(fileName, wxFile::read))
+ return false;
+
+ m_waveLength = (int) fileWave.Length();
+
+ m_waveData = (wxByte*)GlobalLock(GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
+ if (!m_waveData)
+ return false;
+
+ fileWave.Read(m_waveData, m_waveLength);
+
+ return true;
+ }
+}
+
+bool wxSound::Create(int size, const wxByte* data)
+{
+ Free();
+ m_isResource = true;
+ m_waveLength=size;
+ m_waveData = (wxByte*)GlobalLock(GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
+ if (!m_waveData)
+ return false;
+
+ for (int i=0; i<size; i++) m_waveData[i] = data[i];
+ return true;
+}
+
+bool wxSound::DoPlay(unsigned flags) const
+{
+ if (!IsOk())
+ return false;
+
+ return (::PlaySound((LPCTSTR)m_waveData, NULL,
+ SND_MEMORY | SND_NODEFAULT |
+ ((flags & wxSOUND_ASYNC) ? SND_ASYNC : SND_SYNC) |
+ ((flags & wxSOUND_LOOP) ? (SND_LOOP | SND_ASYNC) : 0))
+ != 0);
+}
+
+bool wxSound::Free()
+{
+ if (m_waveData)
+ {
+#ifdef __WXWINCE__
+ HGLOBAL waveData = (HGLOBAL) m_waveData;
+#else
+ HGLOBAL waveData = GlobalHandle(m_waveData);
+#endif
+
+ if (waveData)
+ {
+#ifndef __WXWINCE__
+ if (m_isResource)
+ ::FreeResource(waveData);
+ else
+#endif
+ {
+ GlobalUnlock(waveData);
+ GlobalFree(waveData);
+ }
+
+ m_waveData = NULL;
+ m_waveLength = 0;
+ return true;
+ }
+ }
+ return false;
+}
+
+/*static*/ void wxSound::Stop()
+{
+ ::PlaySound(NULL, NULL, 0);
+}
+
+#endif // wxUSE_SOUND
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: wave.cpp
-// Purpose: wxWave
-// Author: Julian Smart
-// Modified by:
-// Created: 04/01/98
-// RCS-ID: $Id$
-// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "wave.h"
-#endif
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#if defined(__BORLANDC__)
-#pragma hdrstop
-#endif
-
-#if wxUSE_WAVE
-
-#ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
-
-#include "wx/file.h"
-#include "wx/msw/wave.h"
-#include "wx/msw/private.h"
-
-#include <windowsx.h>
-
-#if defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)
- #include "wx/msw/gnuwin32/extra.h"
-#else
- #include <mmsystem.h>
-#endif
-
-wxWave::wxWave()
- : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
-{
-}
-
-wxWave::wxWave(const wxString& sFileName, bool isResource)
- : m_waveData(NULL), m_waveLength(0), m_isResource(isResource)
-{
- Create(sFileName, isResource);
-}
-
-wxWave::wxWave(int size, const wxByte* data)
- : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
-{
- Create(size, data);
-}
-
-wxWave::~wxWave()
-{
- Free();
-}
-
-bool wxWave::Create(const wxString& fileName, bool isResource)
-{
- Free();
-
- if (isResource)
- {
- m_isResource = TRUE;
-
- HRSRC hresInfo;
-#if defined(__WIN32__)
-#ifdef _UNICODE
- hresInfo = ::FindResourceW((HMODULE) wxhInstance, fileName, wxT("WAVE"));
-#else
- hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, wxT("WAVE"));
-#endif
-#else
- hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, wxT("WAVE"));
-#endif
- if (!hresInfo)
- return FALSE;
-
- HGLOBAL waveData = ::LoadResource((HMODULE) wxhInstance, hresInfo);
-
- if (waveData)
- {
- m_waveData= (wxByte*)::LockResource(waveData);
- m_waveLength = (int) ::SizeofResource((HMODULE) wxhInstance, hresInfo);
- }
-
- return (m_waveData ? TRUE : FALSE);
- }
- else
- {
- m_isResource = FALSE;
-
- wxFile fileWave;
- if (!fileWave.Open(fileName, wxFile::read))
- return FALSE;
-
- m_waveLength = (int) fileWave.Length();
-
- m_waveData = (wxByte*)GlobalLock(GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
- if (!m_waveData)
- return FALSE;
-
- fileWave.Read(m_waveData, m_waveLength);
-
- return TRUE;
- }
-}
-
-bool wxWave::Create(int size, const wxByte* data)
-{
- Free();
- m_isResource = FALSE;
- m_waveLength=size;
- m_waveData = (wxByte*)GlobalLock(GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
- if (!m_waveData)
- return FALSE;
-
- for (int i=0; i<size; i++) m_waveData[i] = data[i];
- return TRUE;
-}
-
-bool wxWave::Play(bool async, bool looped) const
-{
- if (!IsOk())
- return FALSE;
-
-#ifdef __WIN32__
- return ( ::PlaySound((LPCTSTR)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 );
-#endif
-}
-
-bool wxWave::Free()
-{
- if (m_waveData)
- {
-#ifdef __WXWINCE__
- HGLOBAL waveData = (HGLOBAL) m_waveData;
-#elif defined(__WIN32__)
- HGLOBAL waveData = GlobalHandle(m_waveData);
-#else
- HGLOBAL waveData = GlobalPtrHandle(m_waveData);
-#endif
-
- if (waveData)
- {
-#ifndef __WXWINCE__
- if (m_isResource)
- ::FreeResource(waveData);
- else
-#endif
- {
- GlobalUnlock(waveData);
- GlobalFree(waveData);
- }
-
- m_waveData = NULL;
- m_waveLength = 0;
- return TRUE;
- }
- }
- return FALSE;
-}
-
-#endif // wxUSE_WAVE
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: sound.cpp
+// Purpose: wxSound class implementation: optional
+// Author: David Webster
+// Modified by:
+// Created: 10/17/99
+// RCS-ID: $Id$
+// Copyright: (c) David Webster
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifndef WX_PRECOMP
+#include "wx/wx.h"
+#endif
+
+#include "wx/file.h"
+#include "wx/sound.h"
+#define INCL_32 /* force 32 bit compile */
+#define INCL_GPIBITMAPS
+#define INCL_DOSFILEMGR
+#define INCL_WIN
+#define INCL_GPI
+#define INCL_PM
+#include <os2.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <os2medef.h>
+#include <mmioos2.h>
+
+wxSound::wxSound()
+ : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
+{
+}
+
+wxSound::wxSound(const wxString& sFileName, bool isResource)
+ : m_waveData(NULL), m_waveLength(0), m_isResource(isResource)
+{
+ Create(sFileName, isResource);
+}
+
+wxSound::wxSound(int size, const wxByte* data)
+ : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
+{
+ Create(size, data);
+}
+
+wxSound::~wxSound()
+{
+ Free();
+}
+
+bool wxSound::Create(const wxString& fileName, bool isResource)
+{
+ Free();
+
+ if (isResource)
+ {
+ m_isResource = TRUE;
+// TODO:
+/*
+ HRSRC hresInfo;
+#ifdef _UNICODE
+ hresInfo = ::FindResourceW((HMODULE) wxhInstance, fileName, wxT("WAVE"));
+#else
+ hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, wxT("WAVE"));
+#endif
+ if (!hresInfo)
+ return FALSE;
+
+ HGLOBAL waveData = ::LoadResource((HMODULE) wxhInstance, hresInfo);
+
+ if (waveData)
+ {
+ m_waveData= (wxByte*)::LockResource(waveData);
+ m_waveLength = (int) ::SizeofResource((HMODULE) wxhInstance, hresInfo);
+ }
+
+ return (m_waveData ? TRUE : FALSE);
+*/
+ return FALSE;
+ }
+ else
+ {
+ m_isResource = FALSE;
+#if wxUSE_FILE
+
+ wxFile fileWave;
+ if (!fileWave.Open(fileName, wxFile::read))
+ return FALSE;
+
+ m_waveLength = (int) fileWave.Length();
+// TODO:
+/*
+ m_waveData = (wxByte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
+ if (!m_waveData)
+ return FALSE;
+
+ fileWave.Read(m_waveData, m_waveLength);
+*/
+ return TRUE;
+#else
+ return FALSE;
+#endif //wxUSE_FILE
+ }
+}
+
+bool wxSound::Create(int size, const wxByte* data)
+{
+ Free();
+ m_isResource = FALSE;
+ m_waveLength=size;
+ m_waveData = NULL; // (wxByte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
+ if (!m_waveData)
+ return FALSE;
+
+ for (int i=0; i<size; i++) m_waveData[i] = data[i];
+ return TRUE;
+}
+
+bool wxSound::DoPlay(unsigned flags) const
+{
+ 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 FALSE;
+}
+
+bool wxSound::Free()
+{
+ if (m_waveData)
+ {
+// HGLOBAL waveData = ::GlobalHandle(m_waveData);
+
+// TODO:
+/*
+ if (waveData)
+ {
+ if (m_isResource)
+ ::FreeResource(waveData);
+ else
+ {
+ ::GlobalUnlock(waveData);
+ ::GlobalFree(waveData);
+ }
+
+ m_waveData = NULL;
+ m_waveLength = 0;
+ return TRUE;
+ }
+*/
+ }
+ return FALSE;
+}
+
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: wave.cpp
-// Purpose: wxWave class implementation: optional
-// Author: David Webster
-// Modified by:
-// Created: 10/17/99
-// RCS-ID: $Id$
-// Copyright: (c) David Webster
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#ifndef WX_PRECOMP
-#include "wx/wx.h"
-#endif
-
-#include "wx/file.h"
-#include "wx/os2/wave.h"
-#define INCL_32 /* force 32 bit compile */
-#define INCL_GPIBITMAPS
-#define INCL_DOSFILEMGR
-#define INCL_WIN
-#define INCL_GPI
-#define INCL_PM
-#include <os2.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <os2medef.h>
-#include <mmioos2.h>
-
-wxWave::wxWave()
- : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
-{
-}
-
-wxWave::wxWave(const wxString& sFileName, bool isResource)
- : m_waveData(NULL), m_waveLength(0), m_isResource(isResource)
-{
- Create(sFileName, isResource);
-}
-
-wxWave::wxWave(int size, const wxByte* data)
- : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
-{
- Create(size, data);
-}
-
-wxWave::~wxWave()
-{
- Free();
-}
-
-bool wxWave::Create(const wxString& fileName, bool isResource)
-{
- Free();
-
- if (isResource)
- {
- m_isResource = TRUE;
-// TODO:
-/*
- HRSRC hresInfo;
-#ifdef _UNICODE
- hresInfo = ::FindResourceW((HMODULE) wxhInstance, fileName, wxT("WAVE"));
-#else
- hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, wxT("WAVE"));
-#endif
- if (!hresInfo)
- return FALSE;
-
- HGLOBAL waveData = ::LoadResource((HMODULE) wxhInstance, hresInfo);
-
- if (waveData)
- {
- m_waveData= (wxByte*)::LockResource(waveData);
- m_waveLength = (int) ::SizeofResource((HMODULE) wxhInstance, hresInfo);
- }
-
- return (m_waveData ? TRUE : FALSE);
-*/
- return FALSE;
- }
- else
- {
- m_isResource = FALSE;
-#if wxUSE_FILE
-
- wxFile fileWave;
- if (!fileWave.Open(fileName, wxFile::read))
- return FALSE;
-
- m_waveLength = (int) fileWave.Length();
-// TODO:
-/*
- m_waveData = (wxByte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
- if (!m_waveData)
- return FALSE;
-
- fileWave.Read(m_waveData, m_waveLength);
-*/
- return TRUE;
-#else
- return FALSE;
-#endif //wxUSE_FILE
- }
-}
-
-bool wxWave::Create(int size, const wxByte* data)
-{
- Free();
- m_isResource = FALSE;
- m_waveLength=size;
- m_waveData = NULL; // (wxByte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
- if (!m_waveData)
- return FALSE;
-
- for (int i=0; i<size; i++) m_waveData[i] = data[i];
- return TRUE;
-}
-
-bool wxWave::Play(bool async, bool looped) const
-{
- 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 FALSE;
-}
-
-bool wxWave::Free()
-{
- if (m_waveData)
- {
-// HGLOBAL waveData = ::GlobalHandle(m_waveData);
-
-// TODO:
-/*
- if (waveData)
- {
- if (m_isResource)
- ::FreeResource(waveData);
- else
- {
- ::GlobalUnlock(waveData);
- ::GlobalFree(waveData);
- }
-
- m_waveData = NULL;
- m_waveLength = 0;
- return TRUE;
- }
-*/
- }
- return FALSE;
-}
-
wxExecute__FRC8wxStringiP9wxProcess
;From object file: ..\os2\wave.cpp
;PUBDEFs (Symbols available from object file):
- ;wxWave::Create(const wxString&,unsigned long)
- Create__6wxWaveFRC8wxStringUl
- __vft6wxWave8wxObject
- ;wxWave::~wxWave()
- __dt__6wxWaveFv
- ;wxWave::Free()
- Free__6wxWaveFv
- ;wxWave::wxWave(const wxString&,unsigned long)
- __ct__6wxWaveFRC8wxStringUl
- ;wxWave::wxWave(int,const unsigned char*)
- __ct__6wxWaveFiPCUc
- ;wxWave::Create(int,const unsigned char*)
- Create__6wxWaveFiPCUc
- ;wxWave::Play(unsigned long,unsigned long) const
- Play__6wxWaveCFUlT1
- ;wxWave::wxWave()
- __ct__6wxWaveFv
+ ;wxSound::Create(const wxString&,unsigned long)
+ Create__6wxSoundFRC8wxStringUl
+ __vft6wxSound8wxObject
+ ;wxSound::~wxSound()
+ __dt__6wxSoundFv
+ ;wxSound::Free()
+ Free__6wxSoundFv
+ ;wxSound::wxSound(const wxString&,unsigned long)
+ __ct__6wxSoundFRC8wxStringUl
+ ;wxSound::wxSound(int,const unsigned char*)
+ __ct__6wxSoundFiPCUc
+ ;wxSound::Create(int,const unsigned char*)
+ Create__6wxSoundFiPCUc
+ ;wxSound::Play(unsigned long,unsigned long) const
+ Play__6wxSoundCFUlT1
+ ;wxSound::wxSound()
+ __ct__6wxSoundFv
;From object file: ..\os2\window.cpp
;PUBDEFs (Symbols available from object file):
;wxFindWinFromHandle(unsigned long)