The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Audio::XMMSClient::XMLRPC - XMLRPC interface to xmms2

VERSION

Version 0.03

SYNOPSIS

    use Audio::XMMSClient::XMLRPC;

    my $rpc = Audio::XMMSClient::XMLRPC->new();
    $rpc->loop;

FUNCTIONS

new

    my $rpc = Audio::XMMSClient::XMLRPC->new( \%options );

Creates a new Audio::XMMSClient::XMLRPC instance with the given %options. Valid options are:

no_httpd

If passed with a "true" value, prevents the creation and storage of the HTTP::Daemon object. This allows for deployment of a server object in other environments. Note that if this is set, the loop method described below will silently attempt to use the Net::Server module.

no_default

If passed with a "true" value, prevents the loading of the default methods provided with the RPC::XML distribution. The methods themselves are described below (see "The Default Methods Provided").

path
port
queue
timeout

These four are specific to the HTTP-based nature of the server. The path argument sets the additional URI path information that clients would use to contact the server. Internally, it is not used except in outgoing status and introspection reports. The host, port and queue arguments are passed to the HTTP::Daemon constructor if they are passed. They set the hostname, TCP/IP port, and socket listening queue, respectively. They may also be used if the server object tries to use Net::Server as an alternative server core.

loop

    $server->loop;

Enters the connection-accept loop, which generally does not return.

METHODS

The xmms.* Methods

playback_seek_ms
    boolean playback_seek_ms (int)

Seek to a absolute time in the current playback.

medialib_playlist_remove
    boolean medialib_playlist_remove (string)

Remove a playlist from the medialib, keeping the songs of course.

medialib_entry_property_remove
    boolean medialib_entry_property_remove (int, string)

Remove a custom field in the medialib associated with an entry.

playlist_set_next
    boolean playlist_set_next (int)

Set next entry in the playlist.

medialib_add_entry_args
    int medialib_add_entry_args (string, struct)

Add a URL with arguments to the medialib.

playlist_insert_args
    boolean playlist_insert_args (int, string, struct)

Insert entry at given position in playlist wit args.

medialib_entry_property_set_int_with_source
    boolean medialib_entry_property_set_int_with_source (int, string, string, int)

Set a custom int field in the medialib associated with a entry, the same as xmms.medialib.entry_property.set_int but with specifing your own source.

configval_set
    boolean configval_set (string, string)

Sets a configvalue in the server.

medialib_path_import_encoded
    boolean medialib_path_import_encoded (string)

Import a all files recursivly from the directory passed as argument which must already be url encoded.

configval_list
    array configval_list ()

Lists all configuration values.

medialib_add_entry_encoded
    int medialib_add_entry_encoded (string)

Add a URL to the medialib.

playback_seek_samples_rel
    boolean playback_seek_samples_rel (int)

Seek to a number of samples relative to the current position in the current playback.

playback_pause
    boolean playback_pause ()

Pause the current playback, will tell the output to not read nor write.

main_stats
    struct main_stats ()

Get a list of statistics from the server.

medialib_entry_property_set_str_with_source
    boolean medialib_entry_property_set_str_with_source (int, string, string, string)

Set a custom field in the medialib associated with a entry, the same as xmms.medialib.entry_property.set_str but with specifing your own source.

medialib_playlist_export
    boolean medialib_playlist_export (string, string)

Export a serverside playlist to a format that could be read from another mediaplayer

bindata_retrieve
    string bindata_retrieve (string)

Retrieve some binary data identified by a given hash.

medialib_select
    array medialib_select (string)

Make a SQL query to the server medialib.

playlist_remove
    boolean playlist_remove (int)

Remove an entry from the playlist.

playlist_insert_id
    boolean playlist_insert_id (int, int)

Insert a medialib id at given position in playlist.

medialib_entry_property_set_str
    boolean medialib_entry_property_set_str (int, string, string)

Associate a value with a medialib entry.

playback_start
    boolean playback_start ()

Starts playback if server is idle.

playback_seek_samples
    boolean playback_seek_samples (int)

Seek to a absoulte number of samples in the current playback.

playlist_sort
    boolean playlist_sort (string)

Sorts the playlist according to the property.

playback_seek_ms_rel
    boolean playback_seek_ms_rel (int)

Seek to a time relative to the current position in the current playback.

playback_status
    int playback_status ()

Make server emit the playback status.

playlist_current_pos
    int playlist_current_pos ()

Retrive the current position in the playlist.

medialib_get_id
    int medialib_get_id (string)

Search for a entry (URL) in the medialib db and return its ID number.

medialib_get_info
    struct medialib_get_info (int)

Retrieve information about a entry from the medialib.

xform_media_browse
    array xform_media_browse (string)

Browse available media in a path.

playback_tickle
    boolean playback_tickle ()

Stop decoding of current song.

xform_media_browse_encoded
    array xform_media_browse_encoded (string)

Browse available media in a (already encoded) path.

playlist_insert_encoded
    boolean playlist_insert_encoded (int, string)

Insert entry at given position in playlist.

plugin_list
    array plugin_list ()

Get a list of loaded plugins from the server.

playlist_add_id
    boolean playlist_add_id (int)

Add a medialib id to the playlist.

playback_volume_get
    struct playback_volume_get ()

Get the current volume.

playlist_add
    boolean playlist_add (string)

Add the url to the playlist.

playback_volume_set
    boolean playback_volume_set (string, int)

Set the volume on a given channel.

medialib_playlist_save_current
    boolean medialib_playlist_save_current (string)

Save the current playlist to a serverside playlist.

medialib_playlist_import
    boolean medialib_playlist_import (string, string)

Import a playlist from a playlist file.

playlist_clear
    boolean playlist_clear ()

Clears the current playlist.

playlist_radd
    boolean playlist_radd (string)

Adds a directory recursivly to the playlist.

medialib_remove_entry
    boolean medialib_remove_entry (int)

Remove a entry from the medialib.

medialib_rehash
    boolean medialib_rehash (int)

Rehash the medialib, this will check data in the medialib still is the same as the data in files.

playlist_set_next_rel
    boolean playlist_set_next_rel (int)

Same as xmms.playlist.set_next but relative to the current postion.

configval_register
    boolean configval_register (string, string)

Registers a config property in the server.

medialib_add_to_playlist
    boolean medialib_add_to_playlist (string)

Queries the medialib for files and adds the matching ones to the current playlist.

playlist_add_args
    boolean playlist_add_args (string, struct)

Add the url to the playlist with arguments.

playlist_shuffle
    boolean playlist_shuffle ()

Shuffles the current playlist.

medialib_playlist_load
    boolean medialib_playlist_load (string)

Load a playlist from the medialib to the current active playlist.

bindata_remove
    boolean bindata_remove (string)

Remove some binary data identified by a given hash.

medialib_entry_property_remove_with_source
    boolean medialib_entry_property_remove_with_source (int, string, string)

Remove a custom field in the medialib associated with an entry. Identical to xmms.medialib.entry_property.remove except with specifying your own source.

playlist_insert
    boolean playlist_insert (int, string)

Insert entry at given position in playlist.

medialib_path_import
    boolean medialib_path_import (string)

Import a all files recursivly from the directory passed as argument.

playlist_radd_encoded
    boolean playlist_radd_encoded (string)

Adds a directory recursivly to the playlist.

playlist_list
    array playlist_list ()

List current playlist.

medialib_add_entry
    int medialib_add_entry (string)

Add a URL to the medialib.

configval_get
    string configval_get (string)

Retrives a list of configvalues in server.

bindata_add
    string bindata_add (string)

Add some binary data to be stored in the server. Returns a string which uniquely identifies the data.

userconfdir_get
    string userconfdir_get ()

Get the absolute path to the user config dir.

quit
    boolean quit ()

Tell the server to quit.

playlist_add_encoded
    boolean playlist_add_encoded (string)

Add the url to the playlist.

playback_playtime
    int playback_playtime ()

Request the playback_playtime signal.

medialib_playlists_list
    array medialib_playlists_list ()

Returns a list of all available playlists.

medialib_entry_property_set_int
    boolean medialib_entry_property_set_int (int, string, int)

Associate a int value with a medialib entry.

playback_stop
    boolean playback_stop ()

Stops the current playback.

medialib_playlist_list
    array medialib_playlist_list (string)

This will make the server list the given playlist.

playlist_move
    boolean playlist_move (int, int)

Move a playlist entry to a new position (absolute move).

playback_current_id
    int playback_current_id ()

Make server emit the current id.

The Default Methods Provided

The following methods are provided with this package, and are the ones installed on newly-created server objects unless told not to. These are identified by their published names, as they are compiled internally as anonymous subroutines and thus cannot be called directly:

system.identity

returns a string value identifying the server name, version, and possibly a capability level. takes no arguments.

system.introspection

returns a series of struct objects that give overview documentation of one or more of the published methods. it may be called with a string identifying a single routine, in which case the return value is a struct. it may be called with an array of string values, in which case an array of struct values, one per element in, is returned. lastly, it may be called with no input parameters, in which case all published routines are documented. note that routines may be configured to be hidden from such introspection queries.

system.listmethods

returns a list of the published methods or a subset of them as an array of string values. if called with no parameters, returns all (non-hidden) method names. if called with a single string pattern, returns only those names that contain the string as a substring of their name (case-sensitive, and this is i<not> a regular expression evaluation).

system.methodhelp

takes either a single method name as a string, or a series of them as an array of string. the return value is the help text for the method, as either a string or array of string value. if the method(s) have no help text, the string will be null.

system.methodsignature

as above, but returns the signatures that the method accepts, as array of string representations. if only one method is requests via a string parameter, then the return value is the corresponding array. if the parameter in is an array, then the returned value will be an array of array of string.

system.multicall

this is a simple implementation of composite function calls in a single request. it takes an array of struct values. each struct has at least a c<methodname> member, which provides the name of the method to call. if there is also a c<params> member, it refers to an array of the parameters that should be passed to the call.

system.status

takes no arguments and returns a struct containing a number of system status values including (but not limited to) the current time on the server, the time the server was started (both of these are returned in both iso 8601 and unix-style integer formats), number of requests dispatched, and some identifying information (hostname, port, etc.).

AUTHOR

Florian Ragwitz, <rafl at debian.org>

BUGS

Please report any bugs or feature requests to bug-audio-xmmsclient-xmlrpc at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Audio-XMMSClient-XMLRPC. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Audio::XMMSClient::XMLRPC

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2006 Florian Ragwitz, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.