This class represents a short sound (loaded from Windows WAV file), that can be stored in memory and played.
Currently this class is implemented on Windows and Unix (and uses either Open Sound System or Simple DirectMedia Layer).
|
| wxSound () |
| Default ctor.
|
|
| wxSound (const wxString &fileName, bool isResource=false) |
| Constructs a wave object from a file or, under Windows, from a Windows resource.
|
|
| wxSound (size_t size, const void *data) |
| Constructs a wave object from in-memory data.
|
|
virtual | ~wxSound () |
| Destroys the wxSound object.
|
|
bool | Create (const wxString &fileName, bool isResource=false) |
| Constructs a wave object from a file or resource.
|
|
bool | Create (size_t size, const void *data) |
| Constructs a wave object from in-memory data.
|
|
bool | IsOk () const |
| Returns true if the object contains a successfully loaded file or resource, false otherwise.
|
|
| wxObject () |
| Default ctor; initializes to NULL the internal reference data.
|
|
| wxObject (const wxObject &other) |
| Copy ctor.
|
|
virtual | ~wxObject () |
| Destructor.
|
|
virtual wxClassInfo * | GetClassInfo () const |
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar).
|
|
wxObjectRefData * | GetRefData () const |
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
|
|
bool | IsKindOf (const wxClassInfo *info) const |
| Determines whether this class is a subclass of (or the same class as) the given class.
|
|
bool | IsSameAs (const wxObject &obj) const |
| Returns true if this object has the same data pointer as obj.
|
|
void | Ref (const wxObject &clone) |
| Makes this object refer to the data in clone.
|
|
void | SetRefData (wxObjectRefData *data) |
| Sets the wxObject::m_refData pointer.
|
|
void | UnRef () |
| Decrements the reference count in the associated data, and if it is zero, deletes the data.
|
|
void | UnShare () |
| This is the same of AllocExclusive() but this method is public.
|
|
void | operator delete (void *buf) |
| The delete operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
|
|
void * | operator new (size_t size, const wxString &filename=NULL, int lineNum=0) |
| The new operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
|
|
Plays the sound file.
If another sound is playing, it will be interrupted.
Returns true on success, false otherwise. Note that in general it is possible to delete the object which is being asynchronously played any time after calling this function and the sound would continue playing, however this currently doesn't work under Windows for sound objects loaded from memory data.
The possible values for flags are:
- wxSOUND_SYNC:
Play
will block and wait until the sound is replayed.
- wxSOUND_ASYNC: Sound is played asynchronously,
Play
returns immediately.
- wxSOUND_ASYNC|wxSOUND_LOOP: Sound is played asynchronously and loops until another sound is played, Stop() is called or the program terminates.
The static form is shorthand for this code:
Plays the sound file.
If another sound is playing, it will be interrupted.
Returns true on success, false otherwise. Note that in general it is possible to delete the object which is being asynchronously played any time after calling this function and the sound would continue playing, however this currently doesn't work under Windows for sound objects loaded from memory data.
The possible values for flags are:
- wxSOUND_SYNC:
Play
will block and wait until the sound is replayed.
- wxSOUND_ASYNC: Sound is played asynchronously,
Play
returns immediately.
- wxSOUND_ASYNC|wxSOUND_LOOP: Sound is played asynchronously and loops until another sound is played, Stop() is called or the program terminates.
The static form is shorthand for this code: