]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia/wave.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxWave class
4 // Author: Guilhem Lavaux / API by Julian Smart
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "wave.h"
15 #include <wx/wfstream.h>
24 wxWave::wxWave(const wxString
& fileName
, bool isResource
= FALSE
)
26 Create(fileName
, isResource
);
34 bool wxWave::Create(const wxString
& sFileName
, bool isResource
= FALSE
)
36 m_iowave
= new wxFileInputStream(sFileName
);
37 m_wave
= new wxSndWavCodec(*m_iowave
);
42 bool wxWave::Play(bool async
, bool looped
) const
48 m_wave
->Set(wxSND_LOOP
);
49 if (!m_wave
->StartPlay());
54 m_wave
->Clear(wxSND_LOOP
);