|
|
This class holds a sound file along with an output device used to play it
| inline ClientSound (const char* name, const char* file, const char* device = 0)
| ClientSound |
Constructor
Parameters:
| name | The name of this object |
| file | The file to play (should contain the whole path and the file name) |
| device | Optional device used to play the file. Set to 0 to use the default one |
| ~ClientSound ()
| ~ClientSound |
[virtual]
Destructor. Stop playing the file
| void destruct ()
| destruct |
[virtual]
Stop playing. Release memory
Reimplemented from GenObject.
| inline bool native ()
| native |
[const]
Check if this sound is a system dependent one
Returns: True if the sound is played using a system dependent method, false if played using a yate module (like wavefile)
| inline bool started ()
| started |
[const]
Check if this sound is started
Returns: True if this sound is started
| inline const String& device ()
| device |
[const]
Get the device used to play this sound
Returns: The device used to play sound
| inline void device (const char* dev)
| device |
Set the device used to play this sound
Parameters:
| dev | The device used to play sound |
| inline const String& file ()
| file |
[const]
Get the file played by this sound
Returns: The file played by this sound
| inline void file (const char* filename, bool stereo)
| file |
Set the file played by this sound. The new file will not be used until the next time the sound is started
Parameters:
| filename | The new file played by this sound |
| stereo | True if the file contains 2 channel audio |
| inline void setRepeat (unsigned int count)
| setRepeat |
Set the repeat counter.
Parameters:
| count | The number of times to play the sound, 0 to repeat until explicitely stopped |
| inline bool stereo ()
| stereo |
[const]
Check if this sound's file contains 2 channel audio
Returns: True if the sound file contains 2 channel audio
| bool start (bool force = true)
| start |
Start playing the file
Parameters:
| force | True to start playing the file even if already started |
Returns: True on success
| void stop ()
| stop |
Stop playing the file
| void setChannel (const String& chan, bool ok)
| setChannel |
Set/reset channel on sound start/stop
Parameters:
| chan | The channel id |
| ok | Operation: true to start, false to stop |
| bool attachSource (ClientChannel* chan)
| attachSource |
Attach this sound to a channel
Parameters:
| chan | The channel to attach to |
Returns: True on success
| bool build (const String& id, const char* file, const char* device = 0,
unsigned int repeat = 0, bool resetExisting = true, bool stereo = false)
| build |
[static]
Build a client sound
Parameters:
| id | The name of the object |
| file | The file to play (should contain the whole path and the file name) |
| device | Optional device used to play the file. Set to 0 to use the default one |
| repeat | The number of times to play the sound, 0 to repeat until explicitely stopped |
| resetExisting | True to reset the file of an already created sound |
| stereo | True if the sound file contains 2 channel audio |
Returns: True on success, false if the sound already exists
| bool started (const String& name)
| started |
[static]
Check if a sound is started
Parameters:
| name | The name of the sound to check |
Returns: True if the given sound is started
| bool start (const String& name, bool force = true)
| start |
[static]
Start playing a given sound
Parameters:
| name | The name of the sound to play |
| force | True to start playing the file even if already started |
Returns: True on success
| void stop (const String& name)
| stop |
[static]
Stop playing a given sound
Parameters:
| name | The name of the sound to stop |
| ClientSound* find (const String& token, bool byName = true)
| find |
[static]
Find a sound object
Parameters:
| token | The token used to match the sound |
| byName | True to match the sound's name, false to match its file |
Returns: ClientSound pointer or 0 if not found
Reimplemented from String.
| static ObjList s_sounds | s_sounds |
| static Mutex s_soundsMutex | s_soundsMutex |
| static String s_calltoPrefix | s_calltoPrefix |
| bool doStart ()
| doStart |
[protected virtual]
The prefix to be added to the file when an utility channel is started or a sound is played in a regular client channel
| void doStop ()
| doStop |
[protected virtual]
| bool m_native | m_native |
[protected]
| String m_file | m_file |
[protected]
| String m_device | m_device |
[protected]
| unsigned int m_repeat | m_repeat |
[protected]
| bool m_started | m_started |
[protected]
| bool m_stereo | m_stereo |
[protected]
| String m_channel | m_channel |
[protected]
| Generated by: paulc on bussard on Sun Oct 20 21:06:06 2013, using kdoc 2.0a54. |