#include <sample.h>
Inheritance diagram for wftk::Sample:
Public Types | |
typedef Resource< Sample * > | Resource |
refcounted resource type | |
Public Member Functions | |
Sample (const Sample &) | |
make a copy of a sample | |
Sample (const std::string &filename) | |
load a sample from a file | |
virtual int | setVolume (int vol) |
set volume (0..100) | |
virtual bool | load (const std::string &) |
load a sound from a file | |
virtual bool | play (int loops=0) const |
play the sound | |
virtual void | stop () const |
stop playing the sound | |
virtual bool | playing () const |
is the sound currently playing? | |
Static Public Attributes | |
ResourceRegistry< Sample * > | registry |
Load digital sound (wav) from file. |
|
Load digital sound (wav) from file. Use the load() function to load a sample (wav) from a file on disk and register it with wftk's Resources engine, e.g.: Sample::registry.load("press","press.wav"); Sample::registry.find("alert")->play();
|
This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.