<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Python: module xmms.control</title> </head><body bgcolor="#f0f0f8"> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> <tr bgcolor="#7799ee"> <td valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="xmms.html"><font color="#ffffff">xmms</font></a>.control</strong></big></big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/mandrake/rpm/BUILD/pyxmms-2.07/build/lib.linux-i686-2.6/xmms/control.py">/home/mandrake/rpm/BUILD/pyxmms-2.07/build/lib.linux-i686-2.6/xmms/control.py</a></font></td></tr></table> <p><tt>Python interface to XMMS --- control module.<br> <br> This module provides a Python interface to control XMMS (the X<br> MultiMedia System), an audio and video player for Unix-like<br> platforms.<br> <br> This module provides bindings for all the xmms_remote_* functions<br> accessible through the libxmms library (which comes with XMMS), plus<br> a few higher-level functions that I (Florent Rougon) find useful.<br> <br> The function names and mappings between the calling syntax of the C<br> functions from libxmms and that of their Python bindings are meant to<br> be mechanical (see below).<br> <br> Note: I use the expression "Python binding for foo()" for a Python<br> function that wraps (thus calls) directly, not doing additional work,<br> the C function foo() defined in libxmms.<br> <br> <br> Function names<br> --------------<br> <br> The binding for the libxmms function xmms_remote_foo() will be called<br> foo; therefore, you will probably use it in this way:<br> <br> import xmms.control<br> <br> res = xmms.control.foo(arg, ...)<br> <br> <br> Calling syntax -- passing arguments and getting results<br> -------------------------------------------------------<br> <br> Each xmms_remote_* function from libxmms takes as its first argument<br> the XMMS session to control. With xmms.control, this argument is<br> optional (defaulting to 0, which is generally what you want if you<br> don't launch multiple XMMS sessions at once) and comes last.<br> <br> For the other arguments:<br> - the type mapping should be obvious (if the C function expects a<br> gint, the Python binding expects a Python integer, same for char *<br> and strings, gfloats and floats, etc.); when the C function<br> expects a list (such as a GList *), the Python binding expects a<br> sequence (like a list or a tuple). gboolean types are mapped to<br> Python integers (FALSE is mapped to 0 and TRUE to 1).<br> <br> Except for 'session', which has to come last so as to be optional,<br> the order of the arguments is always preserved.<br> <br> Example:<br> <br> void xmms_remote_set_volume(gint session, gint vl, gint vr)<br> <br> is mapped to:<br> <br> <a href="#-set_volume">set_volume</a>(vl, vr, session)<br> <br> where 'vl' and 'vr' have to be Python integers and 'session' (also<br> an integer), is optional and defaults to 0.<br> Note: 'vl' and 'vr' stand for left and right volume, respectively.<br> <br> - if the C function returns values through the use of pointers,<br> these are returned by the corresponding Python binding and<br> therefore are removed from the argument list of the Python<br> binding. The type/structure of the return value is the most<br> obvious one I could think of (e.g. a single integer if the<br> function returns a gboolean). The most non-obvious example is<br> indeed quite simple, as you can see:<br> <br> void xmms_remote_get_eq(gint session, gfloat *preamp,<br> gfloat **bands)<br> <br> which returns a global preamp gain (in dB) and a list of gains for<br> 10 frequeny bands. It is called like this in Python:<br> <br> (preamp, bands) = <a href="#-get_eq">get_eq</a>(session)<br> <br> where 'session' is optional (see above), 'preamp' is a float and<br> 'bands' is a 10-tuple of floats.<br> <br> Note: this is written from this module's scope, but in real life,<br> you would of course probably have:<br> <br> import xmms.control<br> <br> [...]<br> <br> (preamp, bands) = xmms.control.<a href="#-get_eq">get_eq</a>(session)<br> <br> <br> Functions exported by this module<br> ---------------------------------<br> <br> * From libxmms<br> <br> playlist<br> playlist_add<br> playlist_delete<br> playlist_clear<br> playlist_add_url_string<br> playlist_ins_url_string<br> <br> get_playlist_length<br> get_playlist_pos<br> set_playlist_pos<br> <br> get_playlist_file<br> get_playlist_title<br> get_playlist_time<br> <br> play<br> pause<br> play_pause<br> stop<br> eject<br> playlist_prev<br> playlist_next<br> jump_to_time<br> <br> is_running<br> is_playing<br> is_paused<br> <br> get_output_time<br> get_info<br> <br> get_volume<br> set_volume<br> get_main_volume<br> set_main_volume<br> <br> get_balance<br> set_balance<br> <br> get_eq<br> set_eq<br> get_eq_preamp<br> set_eq_preamp<br> get_eq_band<br> set_eq_band<br> <br> get_skin<br> set_skin<br> <br> main_win_toggle<br> pl_win_toggle<br> eq_win_toggle<br> <br> is_main_win<br> is_pl_win<br> is_eq_win<br> <br> show_prefs_box<br> show_about_box<br> <br> toggle_aot<br> <br> toggle_repeat<br> toggle_shuffle<br> <br> is_repeat<br> is_shuffle<br> <br> get_version<br> <br> quit<br> <br> play_files (deprecated in libxmms)<br> <br> <br> * Specific to this module (no direct binding in libxmms)<br> <br> playlist_add_allow_relative<br> enqueue_and_play<br> enqueue_and_play_launch_if_session_not_started<br> fade_out<br> <br> <br> Exceptions specific to this module<br> ----------------------------------<br> <br> <a href="#ExecutableNotFound">ExecutableNotFound</a><br> <a href="#RequestedSessionDoesNotComeUp">RequestedSessionDoesNotComeUp</a><br> <a href="#InvalidFadeOutAction">InvalidFadeOutAction</a><br> <br> They are all subclasses of xmms.<a href="xmms.common.html#error">error</a>.</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#aa55cc"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="xmms.common.html">xmms.common</a><br> <a href="os.html">os</a><br> </td><td width="25%" valign=top><a href="re.html">re</a><br> <a href="string.html">string</a><br> </td><td width="25%" valign=top><a href="sys.html">sys</a><br> <a href="time.html">time</a><br> </td><td width="25%" valign=top></td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ee77aa"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> <td width="100%"><dl> <dt><font face="helvetica, arial"><a href="xmms.common.html#error">xmms.common.error</a>(<a href="exceptions.html#Exception">exceptions.Exception</a>) </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="xmms.control.html#ExecutableNotFound">ExecutableNotFound</a> </font></dt><dt><font face="helvetica, arial"><a href="xmms.control.html#InvalidFadeOutAction">InvalidFadeOutAction</a> </font></dt><dt><font face="helvetica, arial"><a href="xmms.control.html#RequestedSessionDoesNotComeUp">RequestedSessionDoesNotComeUp</a> </font></dt></dl> </dd> </dl> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="ExecutableNotFound">class <strong>ExecutableNotFound</strong></a>(<a href="xmms.common.html#error">xmms.common.error</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Exception raised when the XMMS executable can't be found.<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="xmms.control.html#ExecutableNotFound">ExecutableNotFound</a></dd> <dd><a href="xmms.common.html#error">xmms.common.error</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> </dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>ExceptionShortDescription</strong> = 'Executable not found'</dl> <hr> Methods inherited from <a href="xmms.common.html#error">xmms.common.error</a>:<br> <dl><dt><a name="ExecutableNotFound-__init__"><strong>__init__</strong></a>(self, message<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="ExecutableNotFound-__str__"><strong>__str__</strong></a>(self)</dt></dl> <dl><dt><a name="ExecutableNotFound-complete_message"><strong>complete_message</strong></a>(self)</dt></dl> <hr> Data descriptors inherited from <a href="xmms.common.html#error">xmms.common.error</a>:<br> <dl><dt><strong>__weakref__</strong></dt> <dd><tt>list of weak references to the object (if defined)</tt></dd> </dl> <hr> Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object at 0xb7f22f20><dd><tt>T.<a href="#ExecutableNotFound-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl> <hr> Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><a name="ExecutableNotFound-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#ExecutableNotFound-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> <dl><dt><a name="ExecutableNotFound-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#ExecutableNotFound-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> <dl><dt><a name="ExecutableNotFound-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#ExecutableNotFound-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> <dl><dt><a name="ExecutableNotFound-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#ExecutableNotFound-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> <br> Use of negative indices is not supported.</tt></dd></dl> <dl><dt><a name="ExecutableNotFound-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> <dl><dt><a name="ExecutableNotFound-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#ExecutableNotFound-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> <dl><dt><a name="ExecutableNotFound-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#ExecutableNotFound-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> <dl><dt><a name="ExecutableNotFound-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> <dl><dt><a name="ExecutableNotFound-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> <hr> Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><strong>__dict__</strong></dt> </dl> <dl><dt><strong>args</strong></dt> </dl> <dl><dt><strong>message</strong></dt> </dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="InvalidFadeOutAction">class <strong>InvalidFadeOutAction</strong></a>(<a href="xmms.common.html#error">xmms.common.error</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Exception raised when fade_out is given an invalid action.<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="xmms.control.html#InvalidFadeOutAction">InvalidFadeOutAction</a></dd> <dd><a href="xmms.common.html#error">xmms.common.error</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> </dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>ExceptionShortDescription</strong> = 'Invalid action'</dl> <hr> Methods inherited from <a href="xmms.common.html#error">xmms.common.error</a>:<br> <dl><dt><a name="InvalidFadeOutAction-__init__"><strong>__init__</strong></a>(self, message<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="InvalidFadeOutAction-__str__"><strong>__str__</strong></a>(self)</dt></dl> <dl><dt><a name="InvalidFadeOutAction-complete_message"><strong>complete_message</strong></a>(self)</dt></dl> <hr> Data descriptors inherited from <a href="xmms.common.html#error">xmms.common.error</a>:<br> <dl><dt><strong>__weakref__</strong></dt> <dd><tt>list of weak references to the object (if defined)</tt></dd> </dl> <hr> Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object at 0xb7f22f20><dd><tt>T.<a href="#InvalidFadeOutAction-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl> <hr> Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><a name="InvalidFadeOutAction-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidFadeOutAction-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> <dl><dt><a name="InvalidFadeOutAction-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidFadeOutAction-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> <dl><dt><a name="InvalidFadeOutAction-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidFadeOutAction-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> <dl><dt><a name="InvalidFadeOutAction-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidFadeOutAction-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> <br> Use of negative indices is not supported.</tt></dd></dl> <dl><dt><a name="InvalidFadeOutAction-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> <dl><dt><a name="InvalidFadeOutAction-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidFadeOutAction-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> <dl><dt><a name="InvalidFadeOutAction-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#InvalidFadeOutAction-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> <dl><dt><a name="InvalidFadeOutAction-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> <dl><dt><a name="InvalidFadeOutAction-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> <hr> Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><strong>__dict__</strong></dt> </dl> <dl><dt><strong>args</strong></dt> </dl> <dl><dt><strong>message</strong></dt> </dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="RequestedSessionDoesNotComeUp">class <strong>RequestedSessionDoesNotComeUp</strong></a>(<a href="xmms.common.html#error">xmms.common.error</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Exception raised when a started XMMS session still doesn't answer after a specified timeout.<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="xmms.control.html#RequestedSessionDoesNotComeUp">RequestedSessionDoesNotComeUp</a></dd> <dd><a href="xmms.common.html#error">xmms.common.error</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> </dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>ExceptionShortDescription</strong> = "Requested session doesn't come up"</dl> <hr> Methods inherited from <a href="xmms.common.html#error">xmms.common.error</a>:<br> <dl><dt><a name="RequestedSessionDoesNotComeUp-__init__"><strong>__init__</strong></a>(self, message<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="RequestedSessionDoesNotComeUp-__str__"><strong>__str__</strong></a>(self)</dt></dl> <dl><dt><a name="RequestedSessionDoesNotComeUp-complete_message"><strong>complete_message</strong></a>(self)</dt></dl> <hr> Data descriptors inherited from <a href="xmms.common.html#error">xmms.common.error</a>:<br> <dl><dt><strong>__weakref__</strong></dt> <dd><tt>list of weak references to the object (if defined)</tt></dd> </dl> <hr> Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object at 0xb7f22f20><dd><tt>T.<a href="#RequestedSessionDoesNotComeUp-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl> <hr> Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><a name="RequestedSessionDoesNotComeUp-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestedSessionDoesNotComeUp-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> <dl><dt><a name="RequestedSessionDoesNotComeUp-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestedSessionDoesNotComeUp-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> <dl><dt><a name="RequestedSessionDoesNotComeUp-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestedSessionDoesNotComeUp-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> <dl><dt><a name="RequestedSessionDoesNotComeUp-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestedSessionDoesNotComeUp-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> <br> Use of negative indices is not supported.</tt></dd></dl> <dl><dt><a name="RequestedSessionDoesNotComeUp-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> <dl><dt><a name="RequestedSessionDoesNotComeUp-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestedSessionDoesNotComeUp-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> <dl><dt><a name="RequestedSessionDoesNotComeUp-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestedSessionDoesNotComeUp-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> <dl><dt><a name="RequestedSessionDoesNotComeUp-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> <dl><dt><a name="RequestedSessionDoesNotComeUp-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> <hr> Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> <dl><dt><strong>__dict__</strong></dt> </dl> <dl><dt><strong>args</strong></dt> </dl> <dl><dt><strong>message</strong></dt> </dl> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#eeaa77"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> <td width="100%"><dl><dt><a name="-eject"><strong>eject</strong></a>(...)</dt><dd><tt>Show the eject dialog box.<br> <br> <a href="#-eject">eject</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-enqueue_and_play"><strong>enqueue_and_play</strong></a>(seq, session<font color="#909090">=0</font>)</dt><dd><tt>Add files/URLs to the playlist and start playing from the first one.<br> <br> seq -- a sequence of files/URLs<br> session -- the XMMS session to act on<br> <br> The files/URLs in seq are added to the playlist and XMMS is asked<br> to play starting at the first element of seq.<br> <br> Return None.</tt></dd></dl> <dl><dt><a name="-enqueue_and_play_launch_if_session_not_started"><strong>enqueue_and_play_launch_if_session_not_started</strong></a>(seq, xmms_prg<font color="#909090">='xmms'</font>, session<font color="#909090">=0</font>, poll_delay<font color="#909090">=0.10000000000000001</font>, timeout<font color="#909090">=10.0</font>, stdout_to_dev_null<font color="#909090">=False</font>, stderr_to_dev_null<font color="#909090">=False</font>)</dt><dd><tt>Add files/URLs to the playlist and start playing from the first one.<br> <br> seq -- a sequence of files/URLs<br> xmms_prg -- the name (absolute or looked up in the PATH)<br> of an XMMS binary to invoke in case the specified<br> session is not running<br> session -- the XMMS session to act on<br> poll_delay -- poll delay, in seconds (float, see below)<br> timeout -- timeout while polling, in seconds (float, see below)<br> stdout_to_dev_null<br> -- boolean indicating whether to redirect XMMS's standard<br> output to the null device (/dev/null on POSIX systems)<br> stderr_to_dev_null<br> -- boolean indicating whether to redirect XMMS's standard<br> <a href="xmms.common.html#error">error</a> to the null device (/dev/null on POSIX systems)<br> <br> This function is identical to enqueue_and_play except that it<br> spawns an XMMS process if the requested session is not running.<br> <br> When it does spawn an XMMS process, it has to wait until XMMS is<br> ready to handle requests (here, the first request will be<br> enqueue_and_play). It will therefore check every 'poll_delay'<br> seconds whether the requested session is ready, and abort after<br> 'timeout' seconds of unsuccessful checks, raising<br> xmms.control.<a href="#RequestedSessionDoesNotComeUp">RequestedSessionDoesNotComeUp</a>. If we get that far,<br> it may be that your system is very slow, or more likely that the<br> XMMS session that was started by this function is not the one<br> numbered 'session': there is currently no way to start an XMMS<br> session for a chosen number; we have to guess the number of the<br> session that will be started...<br> <br> Return None.<br> <br> Notable exceptions:<br> - xmms.control.<a href="#ExecutableNotFound">ExecutableNotFound</a> is raised if 'xmms_prg'<br> can't be found, read and executed.<br> - xmms.control.<a href="#RequestedSessionDoesNotComeUp">RequestedSessionDoesNotComeUp</a> is raised if the<br> requested session is still unable to handle requests<br> 'timeout' seconds after the XMMS process was started by<br> this function.</tt></dd></dl> <dl><dt><a name="-eq_win_toggle"><strong>eq_win_toggle</strong></a>(...)</dt><dd><tt>Hide or show the equalizer window.<br> <br> <a href="#-eq_win_toggle">eq_win_toggle</a>(display, session=0) -> None<br> <br> This is not a real toggle function: you have to specify the<br> `display' argument.<br> <br> display -- 1 to display the window, 0 to hide it<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-fade_out"><strong>fade_out</strong></a>(action<font color="#909090">='stop'</font>, nb_steps<font color="#909090">=20</font>, step_duration<font color="#909090">=0.5</font>, restore_volume<font color="#909090">=1</font>, session<font color="#909090">=0</font>)</dt><dd><tt>Fade out the volume to stop or pause the playback.<br> <br> Progressively decrease the main volume, then stop or pause<br> (depending on the 'action' argument), then optionally restore<br> the original main volume setting.<br> <br> action -- a string, either "stop" or "pause"<br> nb_steps -- number of decrease-volume steps to use<br> step_duration -- duration of a step (float, in seconds)<br> restore_volume -- boolean (0 = false, 1 = true) telling whether<br> to restore the original main volume setting<br> after the fade out<br> session -- the XMMS session to act on<br> <br> Return None.<br> <br> Notable exception: xmms.control.<a href="#InvalidFadeOutAction">InvalidFadeOutAction</a> is raised if<br> 'action' is invalid.</tt></dd></dl> <dl><dt><a name="-get_balance"><strong>get_balance</strong></a>(...)</dt><dd><tt>Get the balance value.<br> <br> <a href="#-get_balance">get_balance</a>(session=0) -> balance (integer)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_eq"><strong>get_eq</strong></a>(...)</dt><dd><tt>Get the equalizer settings.<br> <br> <a href="#-get_eq">get_eq</a>(session=0) -> (preamp, (band0, band1, ... band9))<br> <br> preamp, band0, ... band9 are all floats (gains in dB).<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_eq_band"><strong>get_eq_band</strong></a>(...)</dt><dd><tt>Get the equalizer setting for a given band.<br> <br> <a href="#-get_eq_band">get_eq_band</a>(band, session=0) -> gain in dB (float)<br> <br> band -- integer between 0 and 9 (both inclusive), specifying<br> the equalizer band from which the setting is to be<br> retrieved. 0 is for the lowest frequency and 9 for the<br> highest one.<br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_eq_preamp"><strong>get_eq_preamp</strong></a>(...)</dt><dd><tt>Get the equalizer preamp value.<br> <br> <a href="#-get_eq_preamp">get_eq_preamp</a>(session=0) -> preamp in dB (float)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_info"><strong>get_info</strong></a>(...)</dt><dd><tt>Get information about the current playlist entry.<br> <br> <a href="#-get_info">get_info</a>(session=0) -> (rate, frequency, number_of_channels)<br> <br> The elements of the returned tuple are all integers.<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_main_volume"><strong>get_main_volume</strong></a>(...)</dt><dd><tt>Get the greater of left and right volumes.<br> <br> <a href="#-get_main_volume">get_main_volume</a>(session=0) -> volume (integer)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_output_time"><strong>get_output_time</strong></a>(...)</dt><dd><tt>Get the time since the beginning of the current playlist entry.<br> <br> <a href="#-get_output_time">get_output_time</a>(session=0) -> integer value in ms<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_playlist_file"><strong>get_playlist_file</strong></a>(...)</dt><dd><tt>Get the file name corresponding to a given entry in the playlist.<br> <br> <a href="#-get_playlist_file">get_playlist_file</a>(index, session=0) -> absolute filename (string)<br> <br> index -- index (starting at 0) of the playlist entry<br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_playlist_length"><strong>get_playlist_length</strong></a>(...)</dt><dd><tt>Get the playlist length (number of files/URLs).<br> <br> <a href="#-get_playlist_length">get_playlist_length</a>(session=0) -> length (integer)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_playlist_pos"><strong>get_playlist_pos</strong></a>(...)</dt><dd><tt>Get the current playlist position.<br> <br> <a href="#-get_playlist_pos">get_playlist_pos</a>(session=0) -> position (integer)<br> <br> The count starts at 0 (first playlist entry).<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_playlist_time"><strong>get_playlist_time</strong></a>(...)</dt><dd><tt>Get the duration of a given entry in the playlist.<br> <br> <a href="#-get_playlist_time">get_playlist_time</a>(index, session=0) -> duration in ms (integer)<br> <br> index -- index (starting at 0) of the playlist entry<br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_playlist_title"><strong>get_playlist_title</strong></a>(...)</dt><dd><tt>Get the title of a given entry in the playlist.<br> <br> <a href="#-get_playlist_title">get_playlist_title</a>(index, session=0) -> title (string)<br> <br> index -- index (starting at 0) of the playlist entry<br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_skin"><strong>get_skin</strong></a>(...)</dt><dd><tt>Get the current skin file.<br> <br> <a href="#-get_skin">get_skin</a>(session=0) -> absolute file name for the skin (string)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-get_version"><strong>get_version</strong></a>(...)</dt><dd><tt>Get version (of what?).<br> <br> <a href="#-get_version">get_version</a>(session=0) -> version of what? (integer)<br> <br> The code fragment that answers to this request in XMMS 1.2.6 is:<br> <br> case CMD_GET_VERSION:<br> ctrl_write_gint(pkt->fd, 0x09a3);<br> ...<br> <br> I suspect it is the version of the protocol in use through the<br> XMMS control socket (which is how libxmms talks to XMMS, by the<br> way).<br> <br> If you understand this better than I, please let me know.</tt></dd></dl> <dl><dt><a name="-get_volume"><strong>get_volume</strong></a>(...)</dt><dd><tt>Get left and right volumes.<br> <br> <a href="#-get_volume">get_volume</a>(session=0) -> (left volume, right volume)<br> <br> The volumes are integers.<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-is_eq_win"><strong>is_eq_win</strong></a>(...)</dt><dd><tt>Tell whether the equalizer window is visible.<br> <br> <a href="#-is_eq_win">is_eq_win</a>(session=0) -> boolean (0 = false, 1 = true)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-is_main_win"><strong>is_main_win</strong></a>(...)</dt><dd><tt>Tell whether the main window is visible.<br> <br> <a href="#-is_main_win">is_main_win</a>(session=0) -> boolean (0 = false, 1 = true)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-is_paused"><strong>is_paused</strong></a>(...)</dt><dd><tt>Tell whether XMMS is paused.<br> <br> <a href="#-is_paused">is_paused</a>(session=0) -> boolean (0 = false, 1 = true)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-is_pl_win"><strong>is_pl_win</strong></a>(...)</dt><dd><tt>Tell whether the playlist window is visible.<br> <br> <a href="#-is_pl_win">is_pl_win</a>(session=0) -> boolean (0 = false, 1 = true)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-is_playing"><strong>is_playing</strong></a>(...)</dt><dd><tt>Tell whether XMMS is playing (= not stopped).<br> <br> <a href="#-is_playing">is_playing</a>(session=0) -> boolean (0 = false, 1 = true)<br> <br> When in pause, XMMS is considered to be playing for this<br> function.<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-is_repeat"><strong>is_repeat</strong></a>(...)</dt><dd><tt>Tell whether repeat mode is active.<br> <br> <a href="#-is_repeat">is_repeat</a>(session=0) -> boolean (0 = false, 1 = true)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-is_running"><strong>is_running</strong></a>(...)</dt><dd><tt>Tell whether the specified XMMS session is running.<br> <br> <a href="#-is_running">is_running</a>(session=0) -> boolean (0 = false, 1 = true)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-is_shuffle"><strong>is_shuffle</strong></a>(...)</dt><dd><tt>Tell whether shuffle mode is active.<br> <br> <a href="#-is_shuffle">is_shuffle</a>(session=0) -> boolean (0 = false, 1 = true)<br> <br> session -- the XMMS session to contact</tt></dd></dl> <dl><dt><a name="-jump_to_time"><strong>jump_to_time</strong></a>(...)</dt><dd><tt>Jump to a given time since the beginning of the current playlist entry.<br> <br> <a href="#-jump_to_time">jump_to_time</a>(time, session=0) -> None<br> <br> time -- time to jump to, in ms (integer)<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-main_win_toggle"><strong>main_win_toggle</strong></a>(...)</dt><dd><tt>Hide or show the main window.<br> <br> <a href="#-main_win_toggle">main_win_toggle</a>(display, session=0) -> None<br> <br> This is not a real toggle function: you have to specify the<br> `display' argument.<br> <br> display -- 1 to display the window, 0 to hide it<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-pause"><strong>pause</strong></a>(...)</dt><dd><tt>Pause.<br> <br> <a href="#-pause">pause</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-pl_win_toggle"><strong>pl_win_toggle</strong></a>(...)</dt><dd><tt>Hide or show the playlist window.<br> <br> <a href="#-pl_win_toggle">pl_win_toggle</a>(display, session=0) -> None<br> <br> This is not a real toggle function: you have to specify the<br> `display' argument.<br> <br> display -- 1 to display the window, 0 to hide it<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-play"><strong>play</strong></a>(...)</dt><dd><tt>Play the current playlist entry.<br> <br> <a href="#-play">play</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-play_files"><strong>play_files</strong></a>(...)</dt><dd><tt>Set the playlist and play.<br> <br> Warning: this function is deprecated in libxmms.<br> <br> <a href="#-play_files">play_files</a>(seq, session=0) -> None<br> <br> Clear the playlist, add the specified files/URLs to it and start<br> playing.<br> <br> seq -- a sequence of files/URLs<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-play_pause"><strong>play_pause</strong></a>(...)</dt><dd><tt>Play or pause (toggle).<br> <br> <a href="#-play_pause">play_pause</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-playlist"><strong>playlist</strong></a>(...)</dt><dd><tt>Set the playlist contents and start playing, or enqueue files/URLs.<br> <br> <a href="#-playlist">playlist</a>(seq, enqueue, session=0) -> None<br> <br> seq -- a sequence of files/URLs<br> enqueue -- boolean (0 = false, 1 = true)<br> session -- the XMMS session to act on<br> <br> If `enqueue' is false, the playlist is set according to `seq' and<br> XMMS starts playing from the first entry. If true, the files or<br> URLs are simply added to the playlist and the playing/not playing<br> status is left unchanged.</tt></dd></dl> <dl><dt><a name="-playlist_add"><strong>playlist_add</strong></a>(...)</dt><dd><tt>Add files/URLs to the playlist.<br> <br> <a href="#-playlist_add">playlist_add</a>(seq, session=0) -> None<br> <br> seq -- a sequence of files/URLs<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-playlist_add_allow_relative"><strong>playlist_add_allow_relative</strong></a>(seq, session<font color="#909090">=0</font>)</dt><dd><tt>Add files/URLs to the playlist, allowing relative file names.<br> <br> seq -- a sequence of files/URLs<br> session -- the XMMS session to act on<br> <br> Return None.</tt></dd></dl> <dl><dt><a name="-playlist_add_url_string"><strong>playlist_add_url_string</strong></a>(...)</dt><dd><tt>Append a file/URL to the playlist.<br> <br> <a href="#-playlist_add_url_string">playlist_add_url_string</a>(string, session=0) -> None<br> <br> string -- an absolute file name or a URL<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-playlist_clear"><strong>playlist_clear</strong></a>(...)</dt><dd><tt>Clear the playlist.<br> <br> <a href="#-playlist_clear">playlist_clear</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-playlist_delete"><strong>playlist_delete</strong></a>(...)</dt><dd><tt>Delete one element of the playlist.<br> <br> <a href="#-playlist_delete">playlist_delete</a>(index, session=0) -> None<br> <br> index -- the index (starting at 0) of the playlist entry to<br> delete<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-playlist_ins_url_string"><strong>playlist_ins_url_string</strong></a>(...)</dt><dd><tt>Insert a file/URL at a given position in the playlist.<br> <br> <a href="#-playlist_ins_url_string">playlist_ins_url_string</a>(string, pos, session=0) -> None<br> <br> string -- an absolute file name or a URL<br> pos -- index (starting at 0) of the playlist entry before<br> which the entry for `string' will be inserted<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-playlist_next"><strong>playlist_next</strong></a>(...)</dt><dd><tt>Jump to the next entry in the playlist.<br> <br> <a href="#-playlist_next">playlist_next</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-playlist_prev"><strong>playlist_prev</strong></a>(...)</dt><dd><tt>Jump to the previous entry in the playlist.<br> <br> <a href="#-playlist_prev">playlist_prev</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-quit"><strong>quit</strong></a>(...)</dt><dd><tt>Quit the specified XMMS session.<br> <br> <a href="#-quit">quit</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-set_balance"><strong>set_balance</strong></a>(...)</dt><dd><tt>Set the balance.<br> <br> <a href="#-set_balance">set_balance</a>(balance, session=0) -> None<br> <br> balance -- balance value (integer)<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-set_eq"><strong>set_eq</strong></a>(...)</dt><dd><tt>Set all equalizer settings (preamp and all bands).<br> <br> <a href="#-set_eq">set_eq</a>(preamp, seq, session=0) -> None<br> <br> preamp -- gain in dB (float)<br> seq -- a sequence of 10 floats, which are the gains in dB of<br> for the 10 frequency bands predefined in XMMS<br> (first = lowest frequency, last = highest frequency)<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-set_eq_band"><strong>set_eq_band</strong></a>(...)</dt><dd><tt>Set the equalizer setting for a given band.<br> <br> <a href="#-set_eq_band">set_eq_band</a>(band, gain, session=0) -> None<br> <br> band -- number of the band (integer between 0 and 9, both<br> inclusive, specifying the equalizer band from which<br> the setting is to be set; 0 is for the lowest<br> frequency and 9 for the highest one).<br> gain -- value of the gain to set (float)<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-set_eq_preamp"><strong>set_eq_preamp</strong></a>(...)</dt><dd><tt>Set the equalizer preamp value.<br> <br> <a href="#-set_eq_preamp">set_eq_preamp</a>(preamp, session=0) -> None<br> <br> preamp -- gain in dB (float)<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-set_main_volume"><strong>set_main_volume</strong></a>(...)</dt><dd><tt>Set the "main" volume.<br> <br> <a href="#-set_main_volume">set_main_volume</a>(volume, session=0) -> None<br> <br> The left and right volumes are calculated (and set) from the<br> supplied `volume' argument and the current balance.<br> <br> volume -- "main" volume (integer)<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-set_playlist_pos"><strong>set_playlist_pos</strong></a>(...)</dt><dd><tt>Set the current playlist position.<br> <br> <a href="#-set_playlist_pos">set_playlist_pos</a>(position, session=0) -> None<br> <br> pos -- the target playlist index (counting from 0)<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-set_skin"><strong>set_skin</strong></a>(...)</dt><dd><tt>Set the skin from a specified file.<br> <br> <a href="#-set_skin">set_skin</a>(skin_file, session=0) -> None<br> <br> skin_file -- the target skin file<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-set_volume"><strong>set_volume</strong></a>(...)</dt><dd><tt>Set left and right volumes.<br> <br> <a href="#-set_volume">set_volume</a>(left_volume, right_volume, session=0) -> None<br> <br> left_volume -- left volume (integer)<br> right_volume -- right volume (integer)<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-show_about_box"><strong>show_about_box</strong></a>(...)</dt><dd><tt>Show about box.<br> <br> <a href="#-show_about_box">show_about_box</a>(session=0) -> None<br> <br> Does not to work in XMMS 1.2.6.<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-show_prefs_box"><strong>show_prefs_box</strong></a>(...)</dt><dd><tt>Show the preferences dialog box.<br> <br> <a href="#-show_prefs_box">show_prefs_box</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-stop"><strong>stop</strong></a>(...)</dt><dd><tt>Stop.<br> <br> <a href="#-stop">stop</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-toggle_aot"><strong>toggle_aot</strong></a>(...)</dt><dd><tt>Set the always-on-top flag for the main window.<br> <br> <a href="#-toggle_aot">toggle_aot</a>(always, session=0) -> None<br> <br> The implementation of this function in XMMS 1.2.6 is weird,<br> I cannot tell you more about `always' than "it seems not<br> to be used".<br> <br> always -- should be a boolean (0 or 1)<br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-toggle_repeat"><strong>toggle_repeat</strong></a>(...)</dt><dd><tt>Toggle repeat mode.<br> <br> <a href="#-toggle_repeat">toggle_repeat</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> <dl><dt><a name="-toggle_shuffle"><strong>toggle_shuffle</strong></a>(...)</dt><dd><tt>Toggle shuffle mode.<br> <br> <a href="#-toggle_shuffle">toggle_shuffle</a>(session=0) -> None<br> <br> session -- the XMMS session to act on</tt></dd></dl> </td></tr></table> </body></html>