1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2004-02-02 08:15:51 -05:00
|
|
|
// Name: sound.h
|
|
|
|
// Purpose: wxSound class (loads and plays short Windows .wav files).
|
1999-07-29 01:11:30 -04:00
|
|
|
// Optional on non-Windows platforms.
|
1999-10-17 23:30:47 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-17 23:30:47 -04:00
|
|
|
// Created: 10/17/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-17 23:30:47 -04:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
#ifndef _WX_SOUND_H_
|
|
|
|
#define _WX_SOUND_H_
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
#include "wx/object.h"
|
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
class wxSound : public wxSoundBase
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
public:
|
2004-02-02 08:15:51 -05:00
|
|
|
wxSound();
|
|
|
|
wxSound(const wxString& fileName, bool isResource = FALSE);
|
|
|
|
wxSound(int size, const wxByte* data);
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxSound();
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
public:
|
1999-10-17 23:30:47 -04:00
|
|
|
// Create from resource or file
|
1999-07-29 01:11:30 -04:00
|
|
|
bool Create(const wxString& fileName, bool isResource = FALSE);
|
1999-10-17 23:30:47 -04:00
|
|
|
// Create from data
|
|
|
|
bool Create(int size, const wxByte* data);
|
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool Free();
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
bool DoPlay(unsigned flags) const;
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
private:
|
1999-10-17 23:30:47 -04:00
|
|
|
wxByte* m_waveData;
|
1999-07-29 01:11:30 -04:00
|
|
|
int m_waveLength;
|
|
|
|
bool m_isResource;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2004-02-02 08:15:51 -05:00
|
|
|
// _WX_SOUND_H_
|