<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>Yate: ClientSound Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespaceTelEngine.html">TelEngine</a>::<a class="el" href="classTelEngine_1_1ClientSound.html">ClientSound</a> </div> </div> <div class="contents"> <h1>ClientSound Class Reference</h1><!-- doxytag: class="TelEngine::ClientSound" --><!-- doxytag: inherits="TelEngine::String" -->A sound file. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="yatecbase_8h-source.html">yatecbase.h</a>></code> <p> <div class="dynheader"> Inheritance diagram for ClientSound:</div> <div class="dynsection"> <p><center><img src="classTelEngine_1_1ClientSound.png" usemap="#ClientSound_map" border="0" alt=""></center> <map name="ClientSound_map"> <area href="classTelEngine_1_1String.html" alt="String" shape="rect" coords="0,56,80,80"> <area href="classTelEngine_1_1GenObject.html" alt="GenObject" shape="rect" coords="0,0,80,24"> </map> </div> <p> <a href="classTelEngine_1_1ClientSound-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#16965d3f5010bea6fb8feac2cecdc5a8">ClientSound</a> (const char *name, const char *file, const char *device=0)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#f088db9b25188e89fbf686687e0f93f3">~ClientSound</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#757ca89703a72ac56715edb379958716">destruct</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#de061155643ea9800e0d385caa9ddc5a">started</a> () const </td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classTelEngine_1_1String.html">String</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#df0ece380edc09ad86568471b353fab9">file</a> () const </td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#6000d186c986cfe31345bc6b9f51b9bd">file</a> (const char *filename)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#0e38419e93008747cb5f6418644716d7">start</a> (int repeat=-1, bool force=true)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#8c528baf37154d347366083f0f816846">stop</a> ()</td></tr> <tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#eedfa97a4b6f95d13795861cafcb8e5a">started</a> (const <a class="el" href="classTelEngine_1_1String.html">String</a> &name)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#82ce6eecc3e0fca77534fae9458231d6">start</a> (const <a class="el" href="classTelEngine_1_1String.html">String</a> &name, int repeat=-1, bool force=true)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#bb23c776246cbfcebb34f7829671b9e2">stop</a> (const <a class="el" href="classTelEngine_1_1String.html">String</a> &name)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classTelEngine_1_1ClientSound.html">ClientSound</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#49ddb36817b29118a53b3e27efe448aa">find</a> (const <a class="el" href="classTelEngine_1_1String.html">String</a> &token, bool byName=true)</td></tr> <tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classTelEngine_1_1ObjList.html">ObjList</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#725bec73ebc271c2fd60ee5da5681a99">s_sounds</a></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classTelEngine_1_1Mutex.html">Mutex</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTelEngine_1_1ClientSound.html#087574ff49b5f3bbef7d7acaf67afeb9">s_soundsMutex</a></td></tr> <tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dc4473366c52b65038dfad13740361a2"></a><!-- doxytag: member="TelEngine::ClientSound::doStart" ref="dc4473366c52b65038dfad13740361a2" args="()" --> virtual bool </td><td class="memItemRight" valign="bottom"><b>doStart</b> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d7bd3251ce4d8d95e8c01679074a2ada"></a><!-- doxytag: member="TelEngine::ClientSound::doStop" ref="d7bd3251ce4d8d95e8c01679074a2ada" args="()" --> virtual void </td><td class="memItemRight" valign="bottom"><b>doStop</b> ()</td></tr> <tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f72642de28849d155af0789393364711"></a><!-- doxytag: member="TelEngine::ClientSound::m_file" ref="f72642de28849d155af0789393364711" args="" --> <a class="el" href="classTelEngine_1_1String.html">String</a> </td><td class="memItemRight" valign="bottom"><b>m_file</b></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f2df3821c89db086a5921dadb04bc9ef"></a><!-- doxytag: member="TelEngine::ClientSound::m_device" ref="f2df3821c89db086a5921dadb04bc9ef" args="" --> <a class="el" href="classTelEngine_1_1String.html">String</a> </td><td class="memItemRight" valign="bottom"><b>m_device</b></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9bed7c1b230d4c4b753a9809d10d7f80"></a><!-- doxytag: member="TelEngine::ClientSound::m_repeat" ref="9bed7c1b230d4c4b753a9809d10d7f80" args="" --> int </td><td class="memItemRight" valign="bottom"><b>m_repeat</b></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="28aab4c8c7ed694a633c97f2f3c6d3f2"></a><!-- doxytag: member="TelEngine::ClientSound::m_started" ref="28aab4c8c7ed694a633c97f2f3c6d3f2" args="" --> bool </td><td class="memItemRight" valign="bottom"><b>m_started</b></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> A sound file. <p> This class holds a sound file along with an output device used to play it <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="16965d3f5010bea6fb8feac2cecdc5a8"></a><!-- doxytag: member="TelEngine::ClientSound::ClientSound" ref="16965d3f5010bea6fb8feac2cecdc5a8" args="(const char *name, const char *file, const char *device=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classTelEngine_1_1ClientSound.html">ClientSound</a> </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>file</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>device</em> = <code>0</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Constructor <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The name of this object </td></tr> <tr><td valign="top"></td><td valign="top"><em>file</em> </td><td>The file to play (should contain the whole path and the file name) </td></tr> <tr><td valign="top"></td><td valign="top"><em>device</em> </td><td>Optional device used to play the file. Set to 0 to use the default one </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="f088db9b25188e89fbf686687e0f93f3"></a><!-- doxytag: member="TelEngine::ClientSound::~ClientSound" ref="f088db9b25188e89fbf686687e0f93f3" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual ~<a class="el" href="classTelEngine_1_1ClientSound.html">ClientSound</a> </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Destructor. Stop playing the file </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="757ca89703a72ac56715edb379958716"></a><!-- doxytag: member="TelEngine::ClientSound::destruct" ref="757ca89703a72ac56715edb379958716" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual void destruct </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Stop playing. Release memory <p>Reimplemented from <a class="el" href="classTelEngine_1_1GenObject.html#757ca89703a72ac56715edb379958716">GenObject</a>.</p> <p>References <a class="el" href="yateclass_8h-source.html#l00650">TelEngine::destruct()</a>.</p> </div> </div><p> <a class="anchor" name="6000d186c986cfe31345bc6b9f51b9bd"></a><!-- doxytag: member="TelEngine::ClientSound::file" ref="6000d186c986cfe31345bc6b9f51b9bd" args="(const char *filename)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void file </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>filename</em> </td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Set the file played by this sound. The new file will not be used until the next time the sound is started <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>filename</em> </td><td>The new file played by this sound </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="df0ece380edc09ad86568471b353fab9"></a><!-- doxytag: member="TelEngine::ClientSound::file" ref="df0ece380edc09ad86568471b353fab9" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classTelEngine_1_1String.html">String</a>& file </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Get the file played by this sound <dl class="return" compact><dt><b>Returns:</b></dt><dd>The file played by this sound </dd></dl> </div> </div><p> <a class="anchor" name="49ddb36817b29118a53b3e27efe448aa"></a><!-- doxytag: member="TelEngine::ClientSound::find" ref="49ddb36817b29118a53b3e27efe448aa" args="(const String &token, bool byName=true)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classTelEngine_1_1ClientSound.html">ClientSound</a>* find </td> <td>(</td> <td class="paramtype">const <a class="el" href="classTelEngine_1_1String.html">String</a> & </td> <td class="paramname"> <em>token</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"> <em>byName</em> = <code>true</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Find a sound object <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>token</em> </td><td>The token used to match the sound </td></tr> <tr><td valign="top"></td><td valign="top"><em>byName</em> </td><td>True to match the sound's name, false to match its file </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>True on success </dd></dl> </div> </div><p> <a class="anchor" name="82ce6eecc3e0fca77534fae9458231d6"></a><!-- doxytag: member="TelEngine::ClientSound::start" ref="82ce6eecc3e0fca77534fae9458231d6" args="(const String &name, int repeat=-1, bool force=true)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static bool start </td> <td>(</td> <td class="paramtype">const <a class="el" href="classTelEngine_1_1String.html">String</a> & </td> <td class="paramname"> <em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>repeat</em> = <code>-1</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"> <em>force</em> = <code>true</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Start playing a given sound <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The name of the sound to play </td></tr> <tr><td valign="top"></td><td valign="top"><em>repeat</em> </td><td>The number of times to play the file if positive, play until explicitely stopped otherwise </td></tr> <tr><td valign="top"></td><td valign="top"><em>force</em> </td><td>True to start playing the file even if already started </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>True on success </dd></dl> </div> </div><p> <a class="anchor" name="0e38419e93008747cb5f6418644716d7"></a><!-- doxytag: member="TelEngine::ClientSound::start" ref="0e38419e93008747cb5f6418644716d7" args="(int repeat=-1, bool force=true)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool start </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>repeat</em> = <code>-1</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"> <em>force</em> = <code>true</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Start playing the file <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>repeat</em> </td><td>The number of times to play the file if positive, play until explicitely stopped otherwise </td></tr> <tr><td valign="top"></td><td valign="top"><em>force</em> </td><td>True to start playing the file even if already started </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>True on success </dd></dl> </div> </div><p> <a class="anchor" name="eedfa97a4b6f95d13795861cafcb8e5a"></a><!-- doxytag: member="TelEngine::ClientSound::started" ref="eedfa97a4b6f95d13795861cafcb8e5a" args="(const String &name)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static bool started </td> <td>(</td> <td class="paramtype">const <a class="el" href="classTelEngine_1_1String.html">String</a> & </td> <td class="paramname"> <em>name</em> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Check if a sound is started <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The name of the sound to check </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>True if the given sound is started </dd></dl> </div> </div><p> <a class="anchor" name="de061155643ea9800e0d385caa9ddc5a"></a><!-- doxytag: member="TelEngine::ClientSound::started" ref="de061155643ea9800e0d385caa9ddc5a" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool started </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Check if this sound is started <dl class="return" compact><dt><b>Returns:</b></dt><dd>True if this sound is started </dd></dl> </div> </div><p> <a class="anchor" name="bb23c776246cbfcebb34f7829671b9e2"></a><!-- doxytag: member="TelEngine::ClientSound::stop" ref="bb23c776246cbfcebb34f7829671b9e2" args="(const String &name)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static void stop </td> <td>(</td> <td class="paramtype">const <a class="el" href="classTelEngine_1_1String.html">String</a> & </td> <td class="paramname"> <em>name</em> </td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Stop playing a given sound <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The name of the sound to stop </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="8c528baf37154d347366083f0f816846"></a><!-- doxytag: member="TelEngine::ClientSound::stop" ref="8c528baf37154d347366083f0f816846" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void stop </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Stop playing the file </div> </div><p> <hr><h2>Member Data Documentation</h2> <a class="anchor" name="725bec73ebc271c2fd60ee5da5681a99"></a><!-- doxytag: member="TelEngine::ClientSound::s_sounds" ref="725bec73ebc271c2fd60ee5da5681a99" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classTelEngine_1_1ObjList.html">ObjList</a> <a class="el" href="classTelEngine_1_1ClientSound.html#725bec73ebc271c2fd60ee5da5681a99">s_sounds</a><code> [static]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> The list of sounds </div> </div><p> <a class="anchor" name="087574ff49b5f3bbef7d7acaf67afeb9"></a><!-- doxytag: member="TelEngine::ClientSound::s_soundsMutex" ref="087574ff49b5f3bbef7d7acaf67afeb9" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classTelEngine_1_1Mutex.html">Mutex</a> <a class="el" href="classTelEngine_1_1ClientSound.html#087574ff49b5f3bbef7d7acaf67afeb9">s_soundsMutex</a><code> [static]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> <a class="el" href="classTelEngine_1_1Mutex.html" title="Mutex support.">Mutex</a> used to lock the sounds list operations </div> </div><p> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="yatecbase_8h-source.html">yatecbase.h</a></ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Sun Dec 7 21:36:12 2008 for Yate by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.7.1 </small></address> </body> </html>