<refentry id="streamtuner-st-action-api">
<refmeta>
<refentrytitle>st-action</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>STREAMTUNER Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>st-action</refname><refpurpose>functions for defining and executing actions.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>

<synopsis>



<link linkend="void">void</link>        <link linkend="st-action-register">st_action_register</link>              (const <link linkend="char">char</link> *id,
                                             const <link linkend="char">char</link> *label,
                                             const <link linkend="char">char</link> *command);
<link linkend="gboolean">gboolean</link>    <link linkend="st-action-run">st_action_run</link>                   (const <link linkend="char">char</link> *id,
                                             const <link linkend="char">char</link> *uri,
                                             <link linkend="GError">GError</link> **err);
</synopsis>
</refsynopsisdiv>









<refsect1>
<title>Description</title>
<para>
These functions provide support for defining actions which can be
customized from the streamtuner preferences, and for running them with
an URI parameter.
</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="st-action-register"/>st_action_register ()</title>
<indexterm><primary>st_action_register</primary></indexterm><programlisting><link linkend="void">void</link>        st_action_register              (const <link linkend="char">char</link> *id,
                                             const <link linkend="char">char</link> *label,
                                             const <link linkend="char">char</link> *command);</programlisting>
<para>
Registers a new action. The action will appear in the applications
page of the streamtuner preferences, and the user will be able to
modify its associated command.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>id</parameter>&nbsp;:</term>
<listitem><simpara> an unique id for the action.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>label</parameter>&nbsp;:</term>
<listitem><simpara> a human-readable label for the action.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>command</parameter>&nbsp;:</term>
<listitem><simpara> the default command for the action, or <literal>NULL</literal>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="st-action-run"/>st_action_run ()</title>
<indexterm><primary>st_action_run</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    st_action_run                   (const <link linkend="char">char</link> *id,
                                             const <link linkend="char">char</link> *uri,
                                             <link linkend="GError">GError</link> **err);</programlisting>
<para>
Runs action <parameter>id</parameter> with <parameter>uri</parameter> as parameter. The action must have been
previously registered with <link linkend="st-action-register"><function>st_action_register()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>id</parameter>&nbsp;:</term>
<listitem><simpara> the id of the action to run.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&nbsp;:</term>
<listitem><simpara> the URI to run the action on.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>err</parameter>&nbsp;:</term>
<listitem><simpara> a location to report errors, or <literal>NULL</literal>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <literal>TRUE</literal> on success, <literal>FALSE</literal> on failure.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
