Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

wftk::Sample Class Reference

Sample - for loading / playing sounds. More...

#include <sample.h>

Inheritance diagram for wftk::Sample:

wftk::Sound List of all members.

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.


Detailed Description

Sample - for loading / playing sounds.


Member Data Documentation

ResourceRegistry< Sample * > wftk::Sample::registry [static]
 

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");
Use the find() function to retrieve a pointer to the Sample object. If the named sample has not been registered, find() will return 0.
Sample::registry.find("alert")->play();


The documentation for this class was generated from the following files:

Generated Fri Mar 5 08:11:01 2004.
Copyright © 1998-2003 by the respective authors.

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.