#include <music.h>
Inheritance diagram for wftk::Music:

Public Types | |
| typedef Resource< Music * > | Resource |
| refcounted resource type | |
Public Member Functions | |
| Music () | |
| default constructor | |
| Music (const std::string &) | |
| create music object from file on disk | |
| virtual bool | load (const std::string &) |
| load a sound from a file | |
| virtual bool | play (int loops=0) const |
| play the sound | |
| virtual int | setVolume (int vol) |
| set volume (0..100) | |
| virtual void | stop () const |
| cease playback | |
| virtual bool | playing () const |
| true if music is playing | |
| virtual bool | paused () const |
| true if music is paused | |
| virtual void | pause () const |
| pause playback | |
| virtual void | rewind () const |
| rewind song to beginning | |
| virtual void | resume () const |
| resume song (if paused) | |
Static Public Attributes | |
| static ResourceRegistry< Music * > | registry |
| Load Music resource from file. | |
|
|
Load Music resource from file. Use the load() function to load an mp3 from a file on disk and register it with wftk's Resources engine, e.g.: Music::registry.load("town_music", "town.mp3"); Use the find() function to retrieve a pointer to the Music object. If the named object has not been registered, find() will return 0. Music* noise = Music::registry.find("ambient");
Use the wftk::Mixer::instance()->setMusic("town_music"); |
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.