File Coverage

blib/lib/Audio/XMMSClient/XMLRPC.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package Audio::XMMSClient::XMLRPC;
2              
3 2     2   79535 use strict;
  2         6  
  2         95  
4 2     2   12 use warnings;
  2         6  
  2         67  
5 2     2   1186 use RPC::XML::Server;
  0            
  0            
6             use Audio::XMMSClient;
7             use base qw( Class::Accessor::Fast );
8              
9             __PACKAGE__->mk_accessors(qw(
10             name
11             no_http
12             no_default
13             no_default
14             path
15             host
16             port
17             queue
18             timeout
19             _server
20             _xmms
21             ));
22              
23             =head1 NAME
24              
25             Audio::XMMSClient::XMLRPC - XMLRPC interface to xmms2
26              
27             =head1 VERSION
28              
29             Version 0.03
30              
31             =cut
32              
33             our $VERSION = '0.03';
34              
35             =head1 SYNOPSIS
36              
37             use Audio::XMMSClient::XMLRPC;
38              
39             my $rpc = Audio::XMMSClient::XMLRPC->new();
40             $rpc->loop;
41              
42             =head1 FUNCTIONS
43              
44             =head2 new
45              
46             my $rpc = Audio::XMMSClient::XMLRPC->new( \%options );
47              
48             Creates a new Audio::XMMSClient::XMLRPC instance with the given C<%options>.
49             Valid options are:
50              
51             =over
52              
53             =item B
54              
55             If passed with a "true" value, prevents the creation and storage of the
56             HTTP::Daemon object. This allows for deployment of a server object in other
57             environments. Note that if this is set, the loop method described below will
58             silently attempt to use the L module.
59              
60             =item B
61              
62             If passed with a "true" value, prevents the loading of the default methods
63             provided with the L distribution. The methods themselves are described
64             below (see "The Default Methods Provided").
65              
66             =item B
67              
68             =item B
69              
70             =item B
71              
72             =item B
73              
74             These four are specific to the HTTP-based nature of the server. The B
75             argument sets the additional URI path information that clients would use to
76             contact the server. Internally, it is not used except in outgoing status and
77             introspection reports. The B, B and B arguments are passed
78             to the L constructor if they are passed. They set the hostname,
79             TCP/IP port, and socket listening queue, respectively. They may also be used if
80             the server object tries to use L as an alternative server core.
81              
82             =back
83              
84             =cut
85              
86             sub new {
87             my $base = shift;
88              
89             my $self = $base->SUPER::new(@_);
90              
91             (my $default_name = __PACKAGE__) =~ s/::/-/g;
92             $self->name( $default_name ) unless defined $self->name;
93             $self->port( 9000 ) unless defined $self->port;
94              
95             my $xmms = Audio::XMMSClient->new( $self->name );
96             $xmms->connect or die $xmms->get_last_error;
97              
98             $self->_xmms( $xmms );
99              
100             my $server = RPC::XML::Server->new(
101             (no_http => $self->no_http) x! ! $self->no_http,
102             (no_default => $self->no_default) x! ! $self->no_default,
103             (path => $self->path) x! ! $self->path,
104             (port => $self->port) x! ! $self->port,
105             (queue => $self->queue) x! ! $self->queue,
106             (timeout => $self->timeout) x! ! $self->timeout,
107             );
108              
109             $self->_server( $server );
110             $self->_add_methods;
111              
112             return $self;
113             }
114              
115             {
116             my $method_help = {
117             quit => 'Tell the server to quit.',
118             plugin_list => 'Get a list of loaded plugins from the server.',
119             main_stats => 'Get a list of statistics from the server.',
120             playlist_shuffle => 'Shuffles the current playlist.',
121             playlist_add => 'Add the url to the playlist.',
122             playlist_add_args => 'Add the url to the playlist with arguments.',
123             playlist_add_id => 'Add a medialib id to the playlist.',
124             playlist_add_encoded => 'Add the url to the playlist.',
125             playlist_remove => 'Remove an entry from the playlist.',
126             playlist_clear => 'Clears the current playlist.',
127             playlist_list => 'List current playlist.',
128             playlist_sort => 'Sorts the playlist according to the property.',
129             playlist_set_next => 'Set next entry in the playlist.',
130             playlist_set_next_rel => 'Same as xmms.playlist.set_next but relative to the current postion.',
131             playlist_move => 'Move a playlist entry to a new position (absolute move).',
132             playlist_current_pos => 'Retrive the current position in the playlist.',
133             playlist_insert => 'Insert entry at given position in playlist.',
134             playlist_insert_args => 'Insert entry at given position in playlist wit args.',
135             playlist_insert_encoded => 'Insert entry at given position in playlist.',
136             playlist_insert_id => 'Insert a medialib id at given position in playlist.',
137             playlist_radd => 'Adds a directory recursivly to the playlist.',
138             playlist_radd_encoded => 'Adds a directory recursivly to the playlist.',
139             playback_stop => 'Stops the current playback.',
140             playback_tickle => 'Stop decoding of current song.',
141             playback_start => 'Starts playback if server is idle.',
142             playback_pause => 'Pause the current playback, will tell the output to not read nor write.',
143             playback_current_id => 'Make server emit the current id.',
144             playback_seek_ms => 'Seek to a absolute time in the current playback.',
145             playback_seek_ms_rel => 'Seek to a time relative to the current position in the current playback.',
146             playback_seek_samples => 'Seek to a absoulte number of samples in the current playback.',
147             playback_seek_samples_rel => 'Seek to a number of samples relative to the current position in the current playback.',
148             playback_playtime => 'Request the playback_playtime signal.',
149             playback_status => 'Make server emit the playback status.',
150             playback_volume_set => 'Set the volume on a given channel.',
151             playback_volume_get => 'Get the current volume.',
152             configval_set => 'Sets a configvalue in the server.',
153             configval_list => 'Lists all configuration values.',
154             configval_get => 'Retrives a list of configvalues in server.',
155             configval_register => 'Registers a config property in the server.',
156             userconfdir_get => 'Get the absolute path to the user config dir.',
157             medialib_select => 'Make a SQL query to the server medialib.',
158             medialib_playlist_save_current => 'Save the current playlist to a serverside playlist.',
159             medialib_playlist_load => 'Load a playlist from the medialib to the current active playlist.',
160             medialib_add_entry => 'Add a URL to the medialib.',
161             medialib_add_entry_args => 'Add a URL with arguments to the medialib.',
162             medialib_add_entry_encoded => 'Add a URL to the medialib.',
163             medialib_get_info => 'Retrieve information about a entry from the medialib.',
164             medialib_add_to_playlist => 'Queries the medialib for files and adds the matching ones to the current playlist.',
165             medialib_playlists_list => 'Returns a list of all available playlists.',
166             medialib_playlist_list => 'This will make the server list the given playlist.',
167             medialib_playlist_import => 'Import a playlist from a playlist file.',
168             medialib_playlist_export => 'Export a serverside playlist to a format that could be read from another mediaplayer',
169             medialib_playlist_remove => 'Remove a playlist from the medialib, keeping the songs of course.',
170             medialib_path_import => 'Import a all files recursivly from the directory passed as argument.',
171             medialib_path_import_encoded => 'Import a all files recursivly from the directory passed as argument which must already be url encoded.',
172             medialib_rehash => 'Rehash the medialib, this will check data in the medialib still is the same as the data in files.',
173             medialib_get_id => 'Search for a entry (URL) in the medialib db and return its ID number.',
174             medialib_remove_entry => 'Remove a entry from the medialib.',
175             medialib_entry_property_set_int => 'Associate a int value with a medialib entry.',
176             medialib_entry_property_set_int_with_source => '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.',
177             medialib_entry_property_set_str => 'Associate a value with a medialib entry.',
178             medialib_entry_property_set_str_with_source => '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.',
179             medialib_entry_property_remove => 'Remove a custom field in the medialib associated with an entry.',
180             medialib_entry_property_remove_with_source => 'Remove a custom field in the medialib associated with an entry. Identical to xmms.medialib.entry_property.remove except with specifying your own source.',
181             xform_media_browse => 'Browse available media in a path.',
182             xform_media_browse_encoded => 'Browse available media in a (already encoded) path.',
183             bindata_add => 'Add some binary data to be stored in the server. Returns a string which uniquely identifies the data.',
184             bindata_retrieve => 'Retrieve some binary data identified by a given hash.',
185             bindata_remove => 'Remove some binary data identified by a given hash.',
186             };
187              
188             sub _rpc_procedure {
189             my ($self, $method, $opts) = @_;
190              
191             return RPC::XML::Procedure->new({
192             help => $method_help->{$method},
193             %{$opts},
194             name => 'xmms.'. $opts->{name},
195             code => $opts->{code}
196             ? sub { $opts->{code}->($self, @_) }
197             : sub { $self->_rpc_generic_wrapper($method, @_) },
198             });
199             }
200             }
201              
202             sub _methods {
203             my $methods = {
204             quit => {
205             name => 'quit',
206             version => '0.01',
207             signature => [ 'boolean' ],
208             },
209             plugin_list => {
210             name => 'plugin_list',
211             version => '0.01',
212             signature => [ 'array' ],
213             },
214             main_stats => {
215             name => 'main_stats',
216             version => '0.01',
217             signature => [ 'struct' ],
218             },
219             playlist_shuffle => {
220             name => 'playlist.shuffle',
221             version => '0.01',
222             signature => [ 'boolean' ],
223             },
224             playlist_add => {
225             name => 'playlist.add',
226             version => '0.01',
227             signature => [ 'boolean string' ],
228             },
229             playlist_add_args => {
230             name => 'playlist.add_args',
231             version => '0.01',
232             signature => [ 'boolean string struct' ],
233             },
234             playlist_add_id => {
235             name => 'playlist.add_id',
236             version => '0.01',
237             signature => [ 'boolean int' ],
238             },
239             playlist_add_encoded => {
240             name => 'playlist.add_encoded',
241             version => '0.01',
242             signature => [ 'boolean string' ],
243             },
244             playlist_remove => {
245             name => 'playlist.remove',
246             version => '0.01',
247             signature => [ 'boolean int' ],
248             },
249             playlist_clear => {
250             name => 'playlist.clear',
251             version => '0.01',
252             signature => [ 'boolean' ],
253             },
254             playlist_list => {
255             name => 'playlist.list',
256             version => '0.01',
257             signature => [ 'array' ],
258             },
259             playlist_sort => {
260             name => 'playlist.sort',
261             version => '0.01',
262             signature => [ 'boolean string' ],
263             },
264             playlist_set_next => {
265             name => 'playlist.set_next',
266             version => '0.01',
267             signature => [ 'boolean int' ],
268             },
269             playlist_set_next_rel => {
270             name => 'playlist.set_next_rel',
271             version => '0.01',
272             signature => [ 'boolean int' ],
273             },
274             playlist_move => {
275             name => 'playlist.move',
276             version => '0.01',
277             signature => [ 'boolean int int' ],
278             },
279             playlist_current_pos => {
280             name => 'playlist.current_pos',
281             version => '0.01',
282             signature => [ 'int' ],
283             },
284             playlist_insert => {
285             name => 'playlist.insert',
286             version => '0.01',
287             signature => [ 'boolean int string' ],
288             },
289             playlist_insert_args => {
290             name => 'playlist.insert_args',
291             version => '0.01',
292             signature => [ 'boolean int string struct' ],
293             },
294             playlist_insert_encoded => {
295             name => 'playlist.insert_encoded',
296             version => '0.01',
297             signature => [ 'boolean int string' ],
298             },
299             playlist_insert_id => {
300             name => 'playlist.insert_id',
301             version => '0.01',
302             signature => [ 'boolean int int' ],
303             },
304             playlist_radd => {
305             name => 'playlist.radd',
306             version => '0.01',
307             signature => [ 'boolean string' ],
308             },
309             playlist_radd_encoded => {
310             name => 'playlist.radd_encoded',
311             version => '0.01',
312             signature => [ 'boolean string' ],
313             },
314             playback_stop => {
315             name => 'playback.stop',
316             version => '0.01',
317             signature => [ 'boolean' ],
318             },
319             playback_tickle => {
320             name => 'playback.tickle',
321             version => '0.01',
322             signature => [ 'boolean' ],
323             },
324             playback_start => {
325             name => 'playback.start',
326             version => '0.01',
327             signature => [ 'boolean' ],
328             },
329             playback_pause => {
330             name => 'playback.pause',
331             version => '0.01',
332             signature => [ 'boolean' ],
333             },
334             playback_current_id => {
335             name => 'playback.current_id',
336             version => '0.01',
337             signature => [ 'int' ],
338             },
339             playback_seek_ms => {
340             name => 'playback.seek_ms',
341             version => '0.01',
342             signature => [ 'boolean int' ],
343             },
344             playback_seek_ms_rel => {
345             name => 'playback.seek_ms_re',
346             version => '0.01',
347             signature => [ 'boolean int' ],
348             },
349             playback_seek_samples => {
350             name => 'playback.seek_samples',
351             version => '0.01',
352             signature => [ 'boolean int' ],
353             },
354             playback_seek_samples_rel => {
355             name => 'playback.seek_samples_rel',
356             version => '0.01',
357             signature => [ 'boolean int' ],
358             },
359             playback_playtime => {
360             name => 'playback.playtime',
361             version => '0.01',
362             signature => [ 'int' ],
363             },
364             playback_status => {
365             name => 'playback.status',
366             version => '0.01',
367             signature => [ 'int' ], #FIXME: string? Fix perl bindings as well
368             },
369             playback_volume_set => {
370             name => 'playback.volume_set',
371             version => '0.01',
372             signature => [ 'boolean string int' ],
373             },
374             playback_volume_get => {
375             name => 'playback.volume_get',
376             version => '0.01',
377             signature => [ 'struct' ],
378             },
379             configval_set => {
380             name => 'configval.set',
381             version => '0.01',
382             signature => [ 'boolean string string' ],
383             },
384             configval_list => {
385             name => 'configval.list',
386             version => '0.01',
387             signature => [ 'array' ],
388             },
389             configval_get => {
390             name => 'configval.get',
391             version => '0.01',
392             signature => [ 'string string' ],
393             },
394             configval_register => {
395             name => 'configval.register',
396             version => '0.01',
397             signature => [ 'boolean string string' ],
398             },
399             userconfdir_get => {
400             name => 'userconfdir_get',
401             version => '0.01',
402             signature => [ 'string' ],
403             code => \&_rpc_userconfdir_get,
404             },
405             medialib_select => {
406             name => 'medialib.select',
407             version => '0.01',
408             signature => [ 'array string' ],
409             },
410             medialib_playlist_save_current => {
411             name => 'medialib.playlist.save_current',
412             version => '0.01',
413             signature => [ 'boolean string' ],
414             },
415             medialib_playlist_load => {
416             name => 'medialib.playlist.load',
417             version => '0.01',
418             signature => [ 'boolean string' ],
419             },
420             medialib_add_entry => {
421             name => 'medialib.add_entry',
422             version => '0.01',
423             signature => [ 'int string' ],
424             },
425             medialib_add_entry_args => {
426             name => 'medialib.add_entry_args',
427             version => '0.01',
428             signature => [ 'int string struct' ],
429             },
430             medialib_add_entry_encoded => {
431             name => 'medialib.add_entry_encoded',
432             version => '0.01',
433             signature => [ 'int string' ],
434             },
435             medialib_get_info => {
436             name => 'medialib.get_info',
437             version => '0.01',
438             signature => [ 'struct int' ],
439             },
440             medialib_add_to_playlist => {
441             name => 'medialib.add_to_playlist',
442             version => '0.01',
443             signature => [ 'boolean string' ],
444             },
445             medialib_playlists_list => {
446             name => 'medialib.playlists_list',
447             version => '0.01',
448             signature => [ 'array' ],
449             },
450             medialib_playlist_list => {
451             name => 'medialib.playlist.list',
452             version => '0.01',
453             signature => [ 'array string' ],
454             },
455             medialib_playlist_import => {
456             name => 'medialib.playlist.import',
457             version => '0.01',
458             signature => [ 'boolean string string' ],
459             },
460             medialib_playlist_export => {
461             name => 'medialib.playlist.export',
462             version => '0.01',
463             signature => [ 'boolean string string' ],
464             },
465             medialib_playlist_remove => {
466             name => 'medialib.playlist.remove',
467             version => '0.01',
468             signature => [ 'boolean string' ],
469             },
470             medialib_path_import => {
471             name => 'medialib.path_import',
472             version => '0.01',
473             signature => [ 'boolean string' ],
474             },
475             medialib_path_import_encoded => {
476             name => 'medialib.path_import_encoded',
477             version => '0.01',
478             signature => [ 'boolean string' ],
479             },
480             medialib_rehash => {
481             name => 'medialib.rehash',
482             version => '0.01',
483             signature => [ 'boolean int' ],
484             },
485             medialib_get_id => {
486             name => 'medialib.get_id',
487             version => '0.01',
488             signature => [ 'int string' ],
489             },
490             medialib_remove_entry => {
491             name => 'medialib.remove_entry',
492             version => '0.01',
493             signature => [ 'boolean int' ],
494             },
495             medialib_entry_property_set_int => {
496             name => 'medialib.entry_property.set_int',
497             version => '0.01',
498             signature => [ 'boolean int string int' ],
499             },
500             medialib_entry_property_set_int_with_source => {
501             name => 'medialib.entry_property.set_int_with_source',
502             version => '0.01',
503             signature => [ 'boolean int string string int' ],
504             },
505             medialib_entry_property_set_str => {
506             name => 'medialib.entry_property.set_str',
507             version => '0.01',
508             signature => [ 'boolean int string string' ],
509             },
510             medialib_entry_property_set_str_with_source => {
511             name => 'medialib.entry_property.set_str_with_source',
512             version => '0.01',
513             signature => [ 'boolean int string string string' ],
514             },
515             medialib_entry_property_remove => {
516             name => 'medialib.entry_property.remove',
517             version => '0.01',
518             signature => [ 'boolean int string' ],
519             },
520             medialib_entry_property_remove_with_source => {
521             name => 'medialib.entry_property.remove_with_source',
522             version => '0.01',
523             signature => [ 'boolean int string string' ],
524             },
525             xform_media_browse => {
526             name => 'xform.media_browse',
527             version => '0.01',
528             signature => [ 'array string' ],
529             },
530             xform_media_browse_encoded => {
531             name => 'xform.media_browse_encoded',
532             version => '0.01',
533             signature => [ 'array string' ],
534             },
535             bindata_add => {
536             name => 'bindata.add',
537             version => '0.01',
538             signature => [ 'string string' ],
539             },
540             bindata_retrieve => {
541             name => 'bindata.retrieve',
542             version => '0.01',
543             signature => [ 'string string' ],
544             },
545             bindata_remove => {
546             name => 'bindata.remove',
547             version => '0.01',
548             signature => [ 'boolean string' ],
549             },
550             };
551              
552             return $methods;
553             }
554              
555             sub _add_methods {
556             my ($self) = @_;
557              
558             my $srv = $self->_server;
559             my $methods = $self->_methods;
560              
561             for my $method (keys %{ $methods }) {
562             $srv->add_method( $self->_rpc_procedure( $method => $methods->{$method} ) );
563             }
564             }
565              
566             sub _rpc_generic_wrapper {
567             my ($self, $method, @opts) = @_;
568              
569             @opts = map {
570             ref && ref eq 'HASH'
571             ? %{$_}
572             : $_
573             } @opts;
574              
575             my $res;
576             eval {
577             $res = $self->_xmms->$method( @opts );
578             };
579              
580             if ($@) {
581             return RPC::XML::fault->new( 500, $@ );
582             }
583              
584             $res->wait;
585             return $res->value;
586             }
587              
588             sub _rpc_userconfdir_get {
589             my ($self) = @_;
590              
591             return $self->_xmms->userconfdir_get;
592             }
593              
594             =head2 loop
595              
596             $server->loop;
597              
598             Enters the connection-accept loop, which generally does not return.
599              
600             =cut
601              
602             sub loop {
603             my ($self) = @_;
604              
605             $self->_server->server_loop;
606             }
607              
608             =head1 METHODS
609              
610             =head2 The xmms.* Methods
611              
612             =over
613              
614             =item B
615              
616             boolean playback_seek_ms (int)
617              
618             Seek to a absolute time in the current playback.
619              
620             =item B
621              
622             boolean medialib_playlist_remove (string)
623              
624             Remove a playlist from the medialib, keeping the songs of course.
625              
626             =item B
627              
628             boolean medialib_entry_property_remove (int, string)
629              
630             Remove a custom field in the medialib associated with an entry.
631              
632             =item B
633              
634             boolean playlist_set_next (int)
635              
636             Set next entry in the playlist.
637              
638             =item B
639              
640             int medialib_add_entry_args (string, struct)
641              
642             Add a URL with arguments to the medialib.
643              
644             =item B
645              
646             boolean playlist_insert_args (int, string, struct)
647              
648             Insert entry at given position in playlist wit args.
649              
650             =item B
651              
652             boolean medialib_entry_property_set_int_with_source (int, string, string, int)
653              
654             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.
655              
656             =item B
657              
658             boolean configval_set (string, string)
659              
660             Sets a configvalue in the server.
661              
662             =item B
663              
664             boolean medialib_path_import_encoded (string)
665              
666             Import a all files recursivly from the directory passed as argument which must already be url encoded.
667              
668             =item B
669              
670             array configval_list ()
671              
672             Lists all configuration values.
673              
674             =item B
675              
676             int medialib_add_entry_encoded (string)
677              
678             Add a URL to the medialib.
679              
680             =item B
681              
682             boolean playback_seek_samples_rel (int)
683              
684             Seek to a number of samples relative to the current position in the current playback.
685              
686             =item B
687              
688             boolean playback_pause ()
689              
690             Pause the current playback, will tell the output to not read nor write.
691              
692             =item B
693              
694             struct main_stats ()
695              
696             Get a list of statistics from the server.
697              
698             =item B
699              
700             boolean medialib_entry_property_set_str_with_source (int, string, string, string)
701              
702             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.
703              
704             =item B
705              
706             boolean medialib_playlist_export (string, string)
707              
708             Export a serverside playlist to a format that could be read from another mediaplayer
709              
710             =item B
711              
712             string bindata_retrieve (string)
713              
714             Retrieve some binary data identified by a given hash.
715              
716             =item B
717              
718             array medialib_select (string)
719              
720             Make a SQL query to the server medialib.
721              
722             =item B
723              
724             boolean playlist_remove (int)
725              
726             Remove an entry from the playlist.
727              
728             =item B
729              
730             boolean playlist_insert_id (int, int)
731              
732             Insert a medialib id at given position in playlist.
733              
734             =item B
735              
736             boolean medialib_entry_property_set_str (int, string, string)
737              
738             Associate a value with a medialib entry.
739              
740             =item B
741              
742             boolean playback_start ()
743              
744             Starts playback if server is idle.
745              
746             =item B
747              
748             boolean playback_seek_samples (int)
749              
750             Seek to a absoulte number of samples in the current playback.
751              
752             =item B
753              
754             boolean playlist_sort (string)
755              
756             Sorts the playlist according to the property.
757              
758             =item B
759              
760             boolean playback_seek_ms_rel (int)
761              
762             Seek to a time relative to the current position in the current playback.
763              
764             =item B
765              
766             int playback_status ()
767              
768             Make server emit the playback status.
769              
770             =item B
771              
772             int playlist_current_pos ()
773              
774             Retrive the current position in the playlist.
775              
776             =item B
777              
778             int medialib_get_id (string)
779              
780             Search for a entry (URL) in the medialib db and return its ID number.
781              
782             =item B
783              
784             struct medialib_get_info (int)
785              
786             Retrieve information about a entry from the medialib.
787              
788             =item B
789              
790             array xform_media_browse (string)
791              
792             Browse available media in a path.
793              
794             =item B
795              
796             boolean playback_tickle ()
797              
798             Stop decoding of current song.
799              
800             =item B
801              
802             array xform_media_browse_encoded (string)
803              
804             Browse available media in a (already encoded) path.
805              
806             =item B
807              
808             boolean playlist_insert_encoded (int, string)
809              
810             Insert entry at given position in playlist.
811              
812             =item B
813              
814             array plugin_list ()
815              
816             Get a list of loaded plugins from the server.
817              
818             =item B
819              
820             boolean playlist_add_id (int)
821              
822             Add a medialib id to the playlist.
823              
824             =item B
825              
826             struct playback_volume_get ()
827              
828             Get the current volume.
829              
830             =item B
831              
832             boolean playlist_add (string)
833              
834             Add the url to the playlist.
835              
836             =item B
837              
838             boolean playback_volume_set (string, int)
839              
840             Set the volume on a given channel.
841              
842             =item B
843              
844             boolean medialib_playlist_save_current (string)
845              
846             Save the current playlist to a serverside playlist.
847              
848             =item B
849              
850             boolean medialib_playlist_import (string, string)
851              
852             Import a playlist from a playlist file.
853              
854             =item B
855              
856             boolean playlist_clear ()
857              
858             Clears the current playlist.
859              
860             =item B
861              
862             boolean playlist_radd (string)
863              
864             Adds a directory recursivly to the playlist.
865              
866             =item B
867              
868             boolean medialib_remove_entry (int)
869              
870             Remove a entry from the medialib.
871              
872             =item B
873              
874             boolean medialib_rehash (int)
875              
876             Rehash the medialib, this will check data in the medialib still is the same as the data in files.
877              
878             =item B
879              
880             boolean playlist_set_next_rel (int)
881              
882             Same as xmms.playlist.set_next but relative to the current postion.
883              
884             =item B
885              
886             boolean configval_register (string, string)
887              
888             Registers a config property in the server.
889              
890             =item B
891              
892             boolean medialib_add_to_playlist (string)
893              
894             Queries the medialib for files and adds the matching ones to the current playlist.
895              
896             =item B
897              
898             boolean playlist_add_args (string, struct)
899              
900             Add the url to the playlist with arguments.
901              
902             =item B
903              
904             boolean playlist_shuffle ()
905              
906             Shuffles the current playlist.
907              
908             =item B
909              
910             boolean medialib_playlist_load (string)
911              
912             Load a playlist from the medialib to the current active playlist.
913              
914             =item B
915              
916             boolean bindata_remove (string)
917              
918             Remove some binary data identified by a given hash.
919              
920             =item B
921              
922             boolean medialib_entry_property_remove_with_source (int, string, string)
923              
924             Remove a custom field in the medialib associated with an entry. Identical to xmms.medialib.entry_property.remove except with specifying your own source.
925              
926             =item B
927              
928             boolean playlist_insert (int, string)
929              
930             Insert entry at given position in playlist.
931              
932             =item B
933              
934             boolean medialib_path_import (string)
935              
936             Import a all files recursivly from the directory passed as argument.
937              
938             =item B
939              
940             boolean playlist_radd_encoded (string)
941              
942             Adds a directory recursivly to the playlist.
943              
944             =item B
945              
946             array playlist_list ()
947              
948             List current playlist.
949              
950             =item B
951              
952             int medialib_add_entry (string)
953              
954             Add a URL to the medialib.
955              
956             =item B
957              
958             string configval_get (string)
959              
960             Retrives a list of configvalues in server.
961              
962             =item B
963              
964             string bindata_add (string)
965              
966             Add some binary data to be stored in the server. Returns a string which uniquely identifies the data.
967              
968             =item B
969              
970             string userconfdir_get ()
971              
972             Get the absolute path to the user config dir.
973              
974             =item B
975              
976             boolean quit ()
977              
978             Tell the server to quit.
979              
980             =item B
981              
982             boolean playlist_add_encoded (string)
983              
984             Add the url to the playlist.
985              
986             =item B
987              
988             int playback_playtime ()
989              
990             Request the playback_playtime signal.
991              
992             =item B
993              
994             array medialib_playlists_list ()
995              
996             Returns a list of all available playlists.
997              
998             =item B
999              
1000             boolean medialib_entry_property_set_int (int, string, int)
1001              
1002             Associate a int value with a medialib entry.
1003              
1004             =item B
1005              
1006             boolean playback_stop ()
1007              
1008             Stops the current playback.
1009              
1010             =item B
1011              
1012             array medialib_playlist_list (string)
1013              
1014             This will make the server list the given playlist.
1015              
1016             =item B
1017              
1018             boolean playlist_move (int, int)
1019              
1020             Move a playlist entry to a new position (absolute move).
1021              
1022             =item B
1023              
1024             int playback_current_id ()
1025              
1026             Make server emit the current id.
1027              
1028             =back
1029              
1030             =head2 The Default Methods Provided
1031              
1032             The following methods are provided with this package, and are the ones
1033             installed on newly-created server objects unless told not to. These are
1034             identified by their published names, as they are compiled internally as
1035             anonymous subroutines and thus cannot be called directly:
1036              
1037             =over
1038              
1039             =item B
1040              
1041             returns a B value identifying the server name, version, and possibly a
1042             capability level. takes no arguments.
1043              
1044             =item B
1045              
1046             returns a series of B objects that give overview documentation of one
1047             or more of the published methods. it may be called with a B
1048             identifying a single routine, in which case the return value is a
1049             B. it may be called with an B of B values, in which
1050             case an B of B values, one per element in, is returned. lastly,
1051             it may be called with no input parameters, in which case all published
1052             routines are documented. note that routines may be configured to be hidden
1053             from such introspection queries.
1054              
1055             =item B
1056              
1057             returns a list of the published methods or a subset of them as an B of
1058             B values. if called with no parameters, returns all (non-hidden)
1059             method names. if called with a single B pattern, returns only those
1060             names that contain the string as a substring of their name (case-sensitive,
1061             and this is i a regular expression evaluation).
1062              
1063             =item B
1064              
1065             takes either a single method name as a B, or a series of them as an
1066             B of B. the return value is the help text for the method, as
1067             either a B or B of B value. if the method(s) have no
1068             help text, the string will be null.
1069              
1070             =item B
1071              
1072             as above, but returns the signatures that the method accepts, as B of
1073             B representations. if only one method is requests via a B
1074             parameter, then the return value is the corresponding array. if the parameter
1075             in is an B, then the returned value will be an B of B of
1076             B.
1077              
1078             =item B
1079              
1080             this is a simple implementation of composite function calls in a single
1081             request. it takes an B of B values. each B has at least
1082             a c member, which provides the name of the method to call. if
1083             there is also a c member, it refers to an B of the parameters
1084             that should be passed to the call.
1085              
1086             =item B
1087              
1088             takes no arguments and returns a B containing a number of system
1089             status values including (but not limited to) the current time on the server,
1090             the time the server was started (both of these are returned in both iso 8601
1091             and unix-style integer formats), number of requests dispatched, and some
1092             identifying information (hostname, port, etc.).
1093              
1094             =back
1095              
1096             =head1 AUTHOR
1097              
1098             Florian Ragwitz, C<< >>
1099              
1100             =head1 BUGS
1101              
1102             Please report any bugs or feature requests to
1103             C, or through the web interface at
1104             L.
1105             I will be notified, and then you'll automatically be notified of progress on
1106             your bug as I make changes.
1107              
1108             =head1 SUPPORT
1109              
1110             You can find documentation for this module with the perldoc command.
1111              
1112             perldoc Audio::XMMSClient::XMLRPC
1113              
1114             You can also look for information at:
1115              
1116             =over 4
1117              
1118             =item * AnnoCPAN: Annotated CPAN documentation
1119              
1120             L
1121              
1122             =item * CPAN Ratings
1123              
1124             L
1125              
1126             =item * RT: CPAN's request tracker
1127              
1128             L
1129              
1130             =item * Search CPAN
1131              
1132             L
1133              
1134             =back
1135              
1136             =head1 ACKNOWLEDGEMENTS
1137              
1138             =head1 COPYRIGHT & LICENSE
1139              
1140             Copyright 2006 Florian Ragwitz, all rights reserved.
1141              
1142             This program is free software; you can redistribute it and/or modify it
1143             under the same terms as Perl itself.
1144              
1145             =cut
1146              
1147             1; # End of Audio::XMMSClient::XMLRPC