1999-01-01 11:05:26 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2004-02-02 08:15:51 -05:00
|
|
|
// Name: sound.h
|
|
|
|
// Purpose: wxSound class (loads and plays short Windows .wav files).
|
1999-01-01 11:05:26 -05:00
|
|
|
// Optional on non-Windows platforms.
|
2003-02-28 16:54:04 -05:00
|
|
|
// Author: Stefan Csomor
|
1999-01-01 11:05:26 -05:00
|
|
|
// Modified by:
|
2003-02-28 16:54:04 -05:00
|
|
|
// Created: 1998-01-01
|
1999-01-01 11:05:26 -05:00
|
|
|
// RCS-ID: $Id$
|
2003-02-28 16:54:04 -05:00
|
|
|
// Copyright: (c) Stefan Csomor
|
2003-02-28 18:48:13 -05:00
|
|
|
// Licence: wxWindows licence
|
1999-01-01 11:05:26 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
#ifndef _WX_SOUND_H_
|
|
|
|
#define _WX_SOUND_H_
|
1999-01-01 11:05:26 -05:00
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2004-02-02 08:15:51 -05:00
|
|
|
#pragma interface "sound.h"
|
1999-01-01 11:05:26 -05:00
|
|
|
#endif
|
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
#if wxUSE_SOUND
|
2002-12-17 16:26:21 -05:00
|
|
|
|
1999-01-01 11:05:26 -05:00
|
|
|
#include "wx/object.h"
|
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
class WXDLLEXPORT wxSound : public wxSoundBase
|
1999-01-01 11:05:26 -05:00
|
|
|
{
|
|
|
|
public:
|
2004-02-02 08:15:51 -05:00
|
|
|
wxSound();
|
|
|
|
wxSound(const wxString& fileName, bool isResource = FALSE);
|
|
|
|
wxSound(int size, const wxByte* data);
|
|
|
|
~wxSound();
|
1999-01-01 11:05:26 -05:00
|
|
|
|
|
|
|
public:
|
|
|
|
bool Create(const wxString& fileName, bool isResource = FALSE);
|
2001-02-08 16:13:12 -05:00
|
|
|
bool IsOk() const { return !m_sndname.IsEmpty(); }
|
1999-01-01 11:05:26 -05:00
|
|
|
|
|
|
|
protected:
|
2002-06-29 12:25:18 -04:00
|
|
|
// prevent collision with some BSD definitions of macro Free()
|
|
|
|
bool FreeData();
|
2004-02-02 08:15:51 -05:00
|
|
|
|
|
|
|
bool DoPlay(unsigned flags) const;
|
1999-01-01 11:05:26 -05:00
|
|
|
|
|
|
|
private:
|
2002-01-04 12:13:39 -05:00
|
|
|
void* m_sndChan;
|
2002-12-17 16:26:21 -05:00
|
|
|
|
2001-02-08 16:13:12 -05:00
|
|
|
wxString m_sndname;
|
2002-01-04 12:13:39 -05:00
|
|
|
void* m_hSnd;
|
1999-01-01 11:05:26 -05:00
|
|
|
int m_waveLength;
|
|
|
|
bool m_isResource;
|
|
|
|
};
|
|
|
|
|
2002-12-17 16:26:21 -05:00
|
|
|
#endif
|
1999-01-01 11:05:26 -05:00
|
|
|
#endif
|
2004-02-02 08:15:51 -05:00
|
|
|
// _WX_SOUND_H_
|