Documentation by YARD 0.8.7.6
+Alphabetic Index
+ + +Namespace Listing A-Z
+ + + + +
+
+
+
|
+
+
+
|
+
diff --git a/src/clients/lib/ruby/.yardoc/checksums b/src/clients/lib/ruby/.yardoc/checksums new file mode 100644 index 000000000..538d42070 --- /dev/null +++ b/src/clients/lib/ruby/.yardoc/checksums @@ -0,0 +1,14 @@ +async.rb ba967bf49824bea5e096c0594e079cbcd236d889 +rb_collection.c f6116f8422d4d35094f5b011ad5eb8dcf0dfa542 +rb_collection.h 1fc25c5878c2e6c1543b750c3894863bb3e69af8 +rb_playlist.c 09a39cd2c58fd56d451eafe3dd5f05b0f38e9381 +rb_playlist.h 8be787cc7f4a9e889ed9ece89dc15fb0c4fdbc63 +rb_result.c 38a0fc799557694d42b4df98ecea76810235c536 +rb_result.h 5dc69d213fd95f929fdf50e8d28e9dafa57c3802 +rb_xmmsclient.c d1684ca5b02cf4943d0524625c33825708d3f51f +rb_xmmsclient_ecore.c de8108ed430dac27e5323a31464fb177e0da7cad +rb_xmmsclient_glib.c 0b48ccb9903a38f5701233cd52e49994ab5d6439 +rb_xmmsclient.h bb3a22855f30d7a2f04e2640a54342b0e1ae97f2 +rb_xmmsclient_main.c 1056eba3db3c1b5fafa5bd93e97b96df225d60db +sync.rb f3c2fb0486455382821e7473892b021f9b829556 +xmmsclient.rb b926424354004c479daea960790c911b1863d8cb diff --git a/src/clients/lib/ruby/.yardoc/object_types b/src/clients/lib/ruby/.yardoc/object_types new file mode 100644 index 000000000..d60e07a2b Binary files /dev/null and b/src/clients/lib/ruby/.yardoc/object_types differ diff --git a/src/clients/lib/ruby/.yardoc/objects/root.dat b/src/clients/lib/ruby/.yardoc/objects/root.dat new file mode 100644 index 000000000..6904bb5d2 Binary files /dev/null and b/src/clients/lib/ruby/.yardoc/objects/root.dat differ diff --git a/src/clients/lib/ruby/.yardoc/proxy_types b/src/clients/lib/ruby/.yardoc/proxy_types new file mode 100644 index 000000000..beefda1ae Binary files /dev/null and b/src/clients/lib/ruby/.yardoc/proxy_types differ diff --git a/src/clients/lib/ruby/async.rb b/src/clients/lib/ruby/async.rb index 089c65aca..6de2616bb 100644 --- a/src/clients/lib/ruby/async.rb +++ b/src/clients/lib/ruby/async.rb @@ -15,65 +15,67 @@ require 'xmmsclient' -class Xmms::Client::Async - attr_reader(:real) +module Xmms + class Client::Async + attr_reader(:real) - def initialize(name) - @real = Xmms::Client.new(name) - end + def initialize(name) + @real = Xmms::Client.new(name) + end - def method_missing(id, *args, &block) - args.push(&block) if(id == 'on_disconnect') - ret = @real.send(id, *args) - if(block_given? && (ret.is_a?(Xmms::Result) || - ret.is_a?(Xmms::BroadcastResult) || ret.is_a?(Xmms::SignalResult))) - ret.notifier(&block) - elsif(ret.is_a?(Xmms::Client)) - self - elsif(ret.is_a?(Xmms::Collection)) - Xmms::Collection::Async.new(ret) - elsif(ret.is_a?(Xmms::Playlist)) - Xmms::Playlist::Async.new(ret) - else - ret + def method_missing(id, *args, &block) + args.push(&block) if(id == 'on_disconnect') + ret = @real.send(id, *args) + if(block_given? && (ret.is_a?(Xmms::Result) || + ret.is_a?(Xmms::BroadcastResult) || ret.is_a?(Xmms::SignalResult))) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Client)) + self + elsif(ret.is_a?(Xmms::Collection)) + Xmms::Collection::Async.new(ret) + elsif(ret.is_a?(Xmms::Playlist)) + Xmms::Playlist::Async.new(ret) + else + ret + end end end -end -class Xmms::Collection::Async - attr_reader(:real) + class Collection::Async + attr_reader(:real) - def initialize(coll) - @real = coll - end + def initialize(coll) + @real = coll + end - def method_missing(id, *args, &block) - ret = @real.send(id, *args) - if(block_given? && ret.is_a?(Xmms::Result)) - ret.notifier(&block) - elsif(ret.is_a?(Xmms::Collection)) - self - else - ret + def method_missing(id, *args, &block) + ret = @real.send(id, *args) + if(block_given? && ret.is_a?(Xmms::Result)) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end end end -end -class Xmms::Playlist::Async - attr_reader(:real) + class Playlist::Async + attr_reader(:real) - def initialize(plist) - @real = plist - end + def initialize(plist) + @real = plist + end - def method_missing(id, *args, &block) - ret = @real.send(id, *args) - if(block_given? && ret.is_a?(Xmms::Result)) - ret.notifier(&block) - elsif(ret.is_a?(Xmms::Collection)) - self - else - ret + def method_missing(id, *args, &block) + ret = @real.send(id, *args) + if(block_given? && ret.is_a?(Xmms::Result)) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end end end end diff --git a/src/clients/lib/ruby/doc/Xmms.html b/src/clients/lib/ruby/doc/Xmms.html new file mode 100644 index 000000000..6f5de434f --- /dev/null +++ b/src/clients/lib/ruby/doc/Xmms.html @@ -0,0 +1,232 @@ + + + +
+ + +Decodes a url-encoded string url and returns it in UNKNOWN +ENCODING. Use with caution.
+ + + + +static VALUE +m_decode_url (VALUE self, VALUE str) +{ + const unsigned char *burl; + unsigned int blen; + xmmsv_t *strv, *decoded; + VALUE url = Qnil; + + strv = xmmsv_new_string (StringValuePtr (str)); + + decoded = xmmsv_decode_url (strv); + + if (!decoded) + goto out; + + if (!xmmsv_get_bin (decoded, &burl, &blen)) + goto out; + + url = rb_str_new ((char *) burl, blen); + +out: + if (decoded) + xmmsv_unref (decoded); + + xmmsv_unref (strv); + + return url; +}+
Returns the xmms2 configuration directory for the current user.
+ + + + +static VALUE +m_userconfdir_get (VALUE self) +{ + const char *p; + char path[XMMS_PATH_MAX]; + + p = xmmsc_userconfdir_get (path, XMMS_PATH_MAX); + + return p ? rb_str_new2 (p) : Qnil; +}+
static VALUE +c_disconnect (VALUE self) +{ + RbResult *res = NULL; + + Data_Get_Struct (self, RbResult, res); + + xmmsc_result_disconnect (res->real); + + return self; +}+
Creates an Xmms::Client object.
+ + + + +static VALUE +c_init (VALUE self, VALUE name) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + if (!(xmms->real = xmmsc_init (StringValuePtr (name)))) { + rb_raise (rb_eNoMemError, "failed to allocate memory"); + return Qnil; + } + + xmms->deleted = false; + xmms->result_callbacks = rb_ary_new (); + xmms->disconnect_cb = Qnil; + xmms->io_need_out_cb = Qnil; + + return self; +}+
Stores binary data on the server.
+ + + + +static VALUE +c_bindata_add (VALUE self, VALUE data) +{ + METHOD_ADD_HANDLER_BIN (bindata_add, data); +}+
List all bindata hashes stored on the server.
+ + + + +static VALUE +c_bindata_list (VALUE self) +{ + METHOD_ADD_HANDLER (bindata_list); +}+
Remove a datafile from the server.
+ + + + +static VALUE +c_bindata_remove (VALUE self, VALUE hash) +{ + METHOD_ADD_HANDLER_STR (bindata_remove, hash); +}+
Retrieves the bindata entry specified by hash (hex string) from the server.
+ + + + +static VALUE +c_bindata_retrieve (VALUE self, VALUE hash) +{ + METHOD_ADD_HANDLER_STR (bindata_retrieve, hash); +}+
The collection_changed broadcast, if requested, is called anytime a +collection is altered.
+ + + + +static VALUE +c_broadcast_coll_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_collection_changed) +}+
Retrieves configuration properties as a broadcast.
+ + + + +static VALUE +c_broadcast_config_value_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_config_value_changed); +}+
Requests the status of the mediainfo reader.
+ + + + +static VALUE +c_broadcast_mediainfo_reader_status (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_mediainfo_reader_status); +}+
Retrieves the id of an added medialib entry as a broadcast.
+ + + + +static VALUE +c_broadcast_medialib_entry_added (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_medialib_entry_added); +}+
Retrieves the id of a changed medialib entry as a broadcast.
+ + + + +static VALUE +c_broadcast_medialib_entry_changed (VALUE self) +{ + RB_XMMS_DEPRECATED (broadcast_medialib_entry_changed, broadcast_medialib_entry_updated); + METHOD_ADD_HANDLER (broadcast_medialib_entry_updated); +}+
Retrieves the id of an removed medialib entry as a broadcast.
+ + + + +static VALUE +c_broadcast_medialib_entry_removed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_medialib_entry_removed); +}+
Retrieves the id of a changed medialib entry as a broadcast.
+ + + + +static VALUE +c_broadcast_medialib_entry_updated (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_medialib_entry_updated); +}+
Retrieves the media id of the currently played track as a broadcast.
+ + + + +static VALUE +c_broadcast_playback_current_id (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playback_current_id); +}+
Retrieves the playback status as a broadcast.
+ + + + +static VALUE +c_broadcast_playback_status (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playback_status); +}+
Registers a broadcast handler that's evoked when the playback volume +changes.
+ + + + +static VALUE +c_broadcast_playback_volume_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playback_volume_changed); +}+
Retrieves a hash describing the change to the playlist as a broadcast.
+ + + + +static VALUE +c_broadcast_playlist_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playlist_changed); +}+
Retrieves the current playlist position as a broadcast. See +playlist_current_pos.
+ + + + +static VALUE +c_broadcast_playlist_current_pos (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playlist_current_pos); +}+
Will be called when a playlist has been loaded.
+ + + + +static VALUE +c_broadcast_playlist_loaded (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playlist_loaded); +}+
Will be called when the server is terminating.
+ + + + +static VALUE +c_broadcast_quit (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_quit); +}+
Find all collections in the given namespace ns which contain +id.
+ + + + +static VALUE +c_coll_find (VALUE self, VALUE id, VALUE ns) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_coll_find (xmms->real, check_int32 (id), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Returns a result containing an Xmms::Collection object referencing the +collection named name. The namespace ns is searched or +all namespaces if unspecified.
+ + + + +static VALUE +c_coll_get (int argc, VALUE *argv, VALUE self) +{ + VALUE name, ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "11", &name, &ns); + + if (NIL_P (ns)) + res = xmmsc_coll_get (xmms->real, StringValuePtr (name), + XMMS_COLLECTION_NS_ALL); + else + res = xmmsc_coll_get (xmms->real, StringValuePtr (name), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Returns a collection of the idlist type from the playlist file at +path. path must be an unencoded string.
+ + + + +static VALUE +c_coll_idlist_from_playlist_file (VALUE self, VALUE path) +{ + METHOD_ADD_HANDLER_STR (coll_idlist_from_playlist_file, path) +}+
Retrieves an array of the names of all the collections stored in the +medialib under the namespace ns. If ns is not specified, +it defaults to ALL.
+ + + + +static VALUE +c_coll_list (int argc, VALUE *argv, VALUE self) +{ + VALUE ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "01", &ns); + + if (NIL_P (ns)) + ns = rb_str_new2 (XMMS_COLLECTION_NS_ALL); + + res = xmmsc_coll_list (xmms->real, StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
static VALUE +c_coll_query (int argc, VALUE *argv, VALUE self) +{ + VALUE coll, spec; + xmmsv_t *cspec; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "2", &coll, &spec); + + cspec = xmmsv_new_dict (); + + VALUE args = rb_ary_new3(4, xmms, coll, spec, (VALUE) cspec); + + res = (xmmsc_result_t *) rb_ensure (c_coll_query_fragile, args, + c_coll_query_cleanup, (VALUE) cspec); + + METHOD_HANDLER_FOOTER +}+
Retrieves a list of all the ids of media matched by the collection. +order specifies a list of properties to order by or no order if +omitted. start and len determine the offset at which to +start retrieving ids and the maximum number of ids to retrieve, +respectively.
+ + + + +static VALUE +c_coll_query_ids (int argc, VALUE *argv, VALUE self) +{ + VALUE coll, order = Qnil, start, len = Qnil; + xmmsv_t *corder = NULL; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "13", &coll, &order, &start, &len); + + if (!NIL_P (order)) + corder = parse_string_array2 (order); + + res = xmmsc_coll_query_ids (xmms->real, + FROM_XMMS_CLIENT_COLLECTION (coll), + corder, + NIL_P (start) ? 0 : NUM2INT (start), + NIL_P (start) ? 0 : NUM2INT (len)); + + if (corder) + xmmsv_unref (corder); + + METHOD_HANDLER_FOOTER +}+
Retrieves media info of media matched by the collection. fetch +should contain an array of properties to retrieve from the collection. +order specifies a list of properties to order by or no order if +omitted. start and len determine the offset at which to +start retrieving info and the maximum number of ids to retrieve, +respectively. group defines a list of properties to group by or no +grouping if omitted.
+ + + + +static VALUE +c_coll_query_info (int argc, VALUE *argv, VALUE self) +{ + VALUE coll, order = Qnil, start, len, fetch, group = Qnil; + xmmsv_t *cfetch = NULL, *corder = NULL, *cgroup = NULL; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "24", &coll, &fetch, &order, &start, &len, + &group); + + cfetch = parse_string_array2 (fetch); + + if (!NIL_P (order)) + corder = parse_string_array2 (order); + + if (!NIL_P (group)) + cgroup = parse_string_array2 (group); + + res = xmmsc_coll_query_infos (xmms->real, + FROM_XMMS_CLIENT_COLLECTION (coll), + corder, + NIL_P (start) ? 0 : NUM2INT (start), + NIL_P (start) ? 0 : NUM2INT (len), + cfetch, + cgroup); + xmmsv_unref (cfetch); + if (corder) { + xmmsv_unref (corder); + } + if (cgroup) { + xmmsv_unref (cgroup); + } + + METHOD_HANDLER_FOOTER +}+
Remove the collection named name from the media library. The +collection is removed from the namespace ns or all namespaces if +unspecified.
+ + + + +static VALUE +c_coll_remove (int argc, VALUE *argv, VALUE self) +{ + VALUE name, ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "11", &name, &ns); + + if (NIL_P (ns)) + res = xmmsc_coll_remove (xmms->real, StringValuePtr (name), + XMMS_COLLECTION_NS_ALL); + else + res = xmmsc_coll_remove (xmms->real, StringValuePtr (name), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Rename the saved collection from old to new within the +namespace ns or all namespaces.
+ + + + +static VALUE +c_coll_rename (int argc, VALUE *argv, VALUE self) +{ + VALUE old, new, ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "21", &old, &new, &ns); + + if (NIL_P (ns)) + res = xmmsc_coll_rename (xmms->real, + StringValuePtr (old), + StringValuePtr (new), + XMMS_COLLECTION_NS_ALL); + else + res = xmmsc_coll_rename (xmms->real, + StringValuePtr (old), + StringValuePtr (new), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Save the collection coll named name under the namespace +ns to the media library.
+ + + + +static VALUE +c_coll_save (VALUE self, VALUE coll, VALUE name, VALUE ns) +{ + METHOD_HANDLER_HEADER + + /* FIXME: Check that we actually have a Collection object */ + + res = xmmsc_coll_save (xmms->real, + FROM_XMMS_CLIENT_COLLECTION (coll), + StringValuePtr (name), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Retrieves the value of the configuration property at key.
+ + + + +static VALUE +c_config_get_value (VALUE self, VALUE key) +{ + METHOD_ADD_HANDLER_STR (config_get_value, key); +}+
Retrieves a list of all config values.
+ + + + +static VALUE +c_config_list_values (VALUE self) +{ + METHOD_ADD_HANDLER (config_list_values); +}+
Registers a configuration property at key with the given default +value.
+ + + + +static VALUE +c_config_register_value (VALUE self, VALUE key, VALUE defval) +{ + METHOD_ADD_HANDLER_STR_STR (config_register_value, key, defval); +}+
Sets the value of the configuration property at key to +value.
+ + + + +static VALUE +c_config_set_value (VALUE self, VALUE key, VALUE val) +{ + METHOD_ADD_HANDLER_STR_STR (config_set_value, key, val); +}+
Connects xc to the XMMS2 daemon listening at path. If +path isn't given, the default path is used.
+ + + + +static VALUE +c_connect (int argc, VALUE *argv, VALUE self) +{ + VALUE path; + RbXmmsClient *xmms = NULL; + char *p = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + rb_scan_args (argc, argv, "01", &path); + + if (!NIL_P (path)) + p = StringValuePtr (path); + + if (!xmmsc_connect (xmms->real, p)) + rb_raise (eClientError, + "cannot connect to daemon (%s)", + xmmsc_get_last_error (xmms->real)); + + return self; +}+
static VALUE +c_delete (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_unref (xmms->real); + xmms->deleted = true; + + return Qnil; +}+
Disconnects the IPC socket. This should only be used by event loop +implementations.
+ + + + +static VALUE +c_io_disconnect (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_io_disconnect (xmms->real); + + return Qnil; +}+
Returns the file descriptor of the Xmms::Client +IPC socket.
+ + + + +static VALUE +c_io_fd (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + return INT2NUM (xmmsc_io_fd_get (xmms->real)); +}+
Retrieves one incoming (from server) clientlib command if there are any in +the buffer.
+ + + + +static VALUE +c_io_in_handle (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_io_in_handle (xmms->real); + + return Qnil; +}+
Sets the block that's called when the output socket state changes.
+ + + + +static VALUE +c_io_on_need_out (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + if (!rb_block_given_p ()) + return Qnil; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmms->io_need_out_cb = rb_block_proc (); + + xmmsc_io_need_out_callback_set (xmms->real, + on_io_need_out, (void *) self); + + return Qnil; +}+
Sends one outgoing (to server) clientlib command. You should check io_want_out before calling this +method.
+ + + + +static VALUE +c_io_out_handle (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_io_out_handle (xmms->real); + + return Qnil; +}+
Returns true
if an outgoing (to server) clientlib command is
+pending, false
otherwise.
static VALUE +c_io_want_out (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + return xmmsc_io_want_out (xmms->real) ? Qtrue : Qfalse; +}+
Returns the last error that occured in xc or nil
, if
+no error occured yet.
static VALUE +c_last_error_get (VALUE self) +{ + RbXmmsClient *xmms = NULL; + const char *s; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + s = xmmsc_get_last_error (xmms->real); + + return s ? rb_str_new2 (s) : Qnil; +}+
Retrieves a hash containing statistics about the daemon.
+ + + + +static VALUE +c_main_stats (VALUE self) +{ + METHOD_ADD_HANDLER (main_stats); +}+
Adds url to the medialib.
+ + + + +static VALUE +c_medialib_add_entry (VALUE self, VALUE url) +{ + METHOD_ADD_HANDLER_STR (medialib_add_entry, url); +}+
Moves the entry specified by id to a new URL without changing +mediainfo.
+ + + + +static VALUE +c_medialib_entry_move (VALUE self, VALUE id, VALUE url) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_medialib_move_entry (xmms->real, check_int32 (id), + StringValuePtr (url)); + + METHOD_HANDLER_FOOTER +}+
Remove a custom field in the medialib associated with the entry +id. source is an optional argument that describes where +to write the mediainfo. If source is omitted, +“client/<yourclient>” is used, where <yourclient> is the name +you specified in ::new.
+ + + + +static VALUE +c_medialib_entry_property_remove (int argc, VALUE *argv, VALUE self) +{ + VALUE tmp, key, src = Qnil; + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + const char *ckey; + int32_t id; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + rb_scan_args (argc, argv, "21", &tmp, &key, &src); + + id = check_int32 (tmp); + Check_Type (key, T_SYMBOL); + + ckey = rb_id2name (SYM2ID (key)); + + if (NIL_P (src)) + res = xmmsc_medialib_entry_property_remove (xmms->real, id, + ckey); + else + res = xmmsc_medialib_entry_property_remove_with_source ( + xmms->real, id, + StringValuePtr (src), + ckey); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Write info to the medialib at id. source is an optional +argument that describes where to write the mediainfo. If source is +omitted, the mediainfo is written to “client/<yourclient>” where +<yourclient> is the name you specified in ::new.
+ + + + +static VALUE +c_medialib_entry_property_set (int argc, VALUE *argv, VALUE self) +{ + VALUE tmp, key, value, src = Qnil; + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + const char *ckey; + bool is_str = false; + int32_t id, ivalue; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + rb_scan_args (argc, argv, "31", &tmp, &key, &value, &src); + + id = check_int32 (tmp); + Check_Type (key, T_SYMBOL); + + if (!NIL_P (rb_check_string_type (value))) + is_str = true; + else + ivalue = check_int32 (value); + + ckey = rb_id2name (SYM2ID (key)); + + if (NIL_P (src) && is_str) + res = xmmsc_medialib_entry_property_set_str (xmms->real, id, + ckey, + StringValuePtr (value)); + else if (NIL_P (src)) + res = xmmsc_medialib_entry_property_set_int (xmms->real, id, + ckey, ivalue); + else if (is_str) + res = xmmsc_medialib_entry_property_set_str_with_source ( + xmms->real, id, + StringValuePtr (src), + ckey, + StringValuePtr (value)); + else + res = xmmsc_medialib_entry_property_set_int_with_source ( + xmms->real, id, + StringValuePtr (src), + ckey, ivalue); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Removes the entry specified by id from the medialib.
+ + + + +static VALUE +c_medialib_entry_remove (VALUE self, VALUE id) +{ + METHOD_ADD_HANDLER_INT (medialib_remove_entry, id) +}+
Retrieves the id corresponding to url.
+ + + + +static VALUE +c_medialib_get_id (VALUE self, VALUE url) +{ + METHOD_ADD_HANDLER_STR (medialib_get_id, url); +}+
Retrieves medialib info for id.
+ + + + +static VALUE +c_medialib_get_info (VALUE self, VALUE id) +{ + METHOD_ADD_HANDLER_INT (medialib_get_info, id); +}+
Recursively imports all media files under path to the medialib.
+ + + + +static VALUE +c_medialib_path_import (VALUE self, VALUE path) +{ + METHOD_ADD_HANDLER_STR (medialib_import_path, path); +}+
Recursively imports all media files under the url encoded path to +the medialib.
+ + + + +static VALUE +c_medialib_path_import_encoded (VALUE self, VALUE path) +{ + METHOD_ADD_HANDLER_STR (medialib_import_path_encoded, path); +}+
Rehashes the medialib entry at id or the whole medialib if +id == 0.
+ + + + +static VALUE +c_medialib_rehash (VALUE self, VALUE id) +{ + METHOD_ADD_HANDLER_INT (medialib_rehash, id); +}+
Sets the block that's executed when xc is disconnected from +the XMMS2 daemon.
+ + + + +static VALUE +c_on_disconnect (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + if (!rb_block_given_p ()) + return Qnil; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmms->disconnect_cb = rb_block_proc (); + + xmmsc_disconnect_callback_set (xmms->real, + on_disconnect, (void *) self); + + return self; +}+
Retrieves the media id of the currently played track.
+ + + + +static VALUE +c_playback_current_id (VALUE self) +{ + METHOD_ADD_HANDLER (playback_current_id); +}+
Pauses playback.
+ + + + +static VALUE +c_playback_pause (VALUE self) +{ + METHOD_ADD_HANDLER (playback_pause); +}+
Retrieves the playtime.
+ + + + +static VALUE +c_playback_playtime (VALUE self) +{ + METHOD_ADD_HANDLER (playback_playtime); +}+
Seek to the song position given in ms.
+ + + + +static VALUE +c_playback_seek_ms (VALUE self, VALUE ms) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_ms (xmms->real, + check_int32 (ms), + XMMS_PLAYBACK_SEEK_SET); + + METHOD_HANDLER_FOOTER +}+
Seek in the song by the offset given in ms.
+ + + + +static VALUE +c_playback_seek_ms_rel (VALUE self, VALUE ms) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_ms (xmms->real, + check_int32 (ms), + XMMS_PLAYBACK_SEEK_CUR); + + METHOD_HANDLER_FOOTER +}+
Seek to the song position given in samples.
+ + + + +static VALUE +c_playback_seek_samples (VALUE self, VALUE samples) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_samples (xmms->real, + check_int32 (samples), + XMMS_PLAYBACK_SEEK_SET); + + METHOD_HANDLER_FOOTER +}+
Seek in the song position by the offset given in samples.
+ + + + +static VALUE +c_playback_seek_samples_rel (VALUE self, VALUE samples) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_samples (xmms->real, + check_int32 (samples), + XMMS_PLAYBACK_SEEK_CUR); + + METHOD_HANDLER_FOOTER +}+
Starts playback.
+ + + + +static VALUE +c_playback_start (VALUE self) +{ + METHOD_ADD_HANDLER (playback_start); +}+
Retrieves the playback status.
+ + + + +static VALUE +c_playback_status (VALUE self) +{ + METHOD_ADD_HANDLER (playback_status); +}+
Stops playback.
+ + + + +static VALUE +c_playback_stop (VALUE self) +{ + METHOD_ADD_HANDLER (playback_stop); +}+
Advances to the next playlist entry.
+ + + + +static VALUE +c_playback_tickle (VALUE self) +{ + METHOD_ADD_HANDLER (playback_tickle); +}+
Gets the current playback volume.
+ + + + +static VALUE +c_playback_volume_get (VALUE self) +{ + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + res = xmmsc_playback_volume_get (xmms->real); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Sets playback volume for channel to volume.
+ + + + +static VALUE +c_playback_volume_set (VALUE self, VALUE channel, VALUE volume) +{ + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + Check_Type (channel, T_SYMBOL); + Check_Type (volume, T_FIXNUM); + + res = xmmsc_playback_volume_set (xmms->real, + rb_id2name (SYM2ID (channel)), + NUM2INT (volume)); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Shortcut for Xmms::Playlist.new. +Creates a new Xmms::Playlist object tied to the +current Xmms::Client instance. name is +is the name of the playlist and the active playlist will be used if it is +not specified. Raises PlaylistError if the playlist name is invalid.
+ + + + +static VALUE +c_playlist (int argc, VALUE *argv, VALUE self) +{ + VALUE args[2] = {self, Qnil}; + + rb_scan_args (argc, argv, "01", &args[1]); + + return rb_class_new_instance (2, args, cPlaylist); +}+
Retrieves the name of the active playlist.
+ + + + +static VALUE +c_playlist_current_active (VALUE self) +{ + METHOD_ADD_HANDLER (playlist_current_active); +}+
Retrieves a list of all saved playlists from the medialib. Note that +clients should treat internally used playlists (marked with a leading +underscore) carefully.
+ + + + +static VALUE +c_playlist_list (VALUE self) +{ + METHOD_ADD_HANDLER (playlist_list); +}+
Sets the next song to be played to pos (an absolute position).
+ + + + +static VALUE +c_playlist_set_next (VALUE self, VALUE pos) +{ + METHOD_ADD_HANDLER_INT (playlist_set_next, pos); +}+
Sets the next song to be played based on the current position where +pos is a value relative to the current position.
+ + + + +static VALUE +c_playlist_set_next_rel (VALUE self, VALUE pos) +{ + METHOD_ADD_HANDLER_INT (playlist_set_next_rel, pos); +}+
Retrieves an array containing a hash of information for each plugin.
+ + + + +static VALUE +c_plugin_list (int argc, VALUE *argv, VALUE self) +{ + VALUE type = Qnil; + + rb_scan_args (argc, argv, "01", &type); + + if (NIL_P (type)) + type = INT2FIX (XMMS_PLUGIN_TYPE_ALL); + + METHOD_ADD_HANDLER_INT (main_list_plugins, type); +}+
Shuts down the XMMS2 daemon.
+ + + + +static VALUE +c_quit (VALUE self) +{ + METHOD_ADD_HANDLER (quit); +}+
Requests the number of unindexed entries in the medialib.
+ + + + +static VALUE +c_signal_mediainfo_reader_unindexed (VALUE self) +{ + METHOD_ADD_HANDLER (signal_mediainfo_reader_unindexed); +}+
Retrieves the playtime as a signal.
+ + + + +static VALUE +c_signal_playback_playtime (VALUE self) +{ + METHOD_ADD_HANDLER (signal_playback_playtime); +}+
returns a list of files from the server
+ + + + +static VALUE +c_xform_media_browse (VALUE self, VALUE url) +{ + METHOD_ADD_HANDLER_STR (xform_media_browse, url); +}+
# File async.rb, line 21 +def initialize(name) + @real = Xmms::Client.new(name) +end+
# File async.rb, line 25 +def method_missing(id, *args, &block) + args.push(&block) if(id == 'on_disconnect') + ret = @real.send(id, *args) + if(block_given? && (ret.is_a?(Xmms::Result) || + ret.is_a?(Xmms::BroadcastResult) || ret.is_a?(Xmms::SignalResult))) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Client)) + self + elsif(ret.is_a?(Xmms::Collection)) + Xmms::Collection::Async.new(ret) + elsif(ret.is_a?(Xmms::Playlist)) + Xmms::Playlist::Async.new(ret) + else + ret + end +end+
# File sync.rb, line 21 +def initialize(name) + @real = Xmms::Client.new(name) +end+
# File sync.rb, line 25 +def method_missing(id, *args) + args.push(&block) if(id == 'on_disconnect') + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result) || ret.is_a?(Xmms::BroadcastResult) || + ret.is_a?(Xmms::SignalResult)) + ret.wait.value + elsif(ret.is_a?(Xmms::Client)) + self + elsif(ret.is_a?(Xmms::Collection)) + Xmms::Collection::Sync.new(ret) + elsif(ret.is_a?(Xmms::Playlist)) + Xmms::Playlist::Sync.new(ret) + else + ret + end +end+
Returns a new Xmms::Collection object of type +type.
+ + + + +static VALUE +c_coll_init (VALUE self, VALUE type) +{ + COLL_METHOD_HANDLER_HEADER + + coll->real = xmmsv_new_coll (check_int32 (type)); + + return self; +}+
Returns a collection matching a String pattern. See the wiki for +details on how to construct a pattern string.
+ + + + +static VALUE +c_coll_parse (VALUE klass, VALUE pattern) +{ + VALUE obj = rb_obj_alloc (klass); + RbCollection *coll = NULL; + + Data_Get_Struct (obj, RbCollection, coll); + + if (!xmmsv_coll_parse (StringValuePtr (pattern), &coll->real)) { + rb_raise (ePatternError, "invalid pattern"); + } + + return obj; +}+
Returns a collection referencing the “All Media” set.
+ + + + +static VALUE +c_coll_universe (VALUE klass) +{ + VALUE obj = rb_obj_alloc (klass); + RbCollection *coll = NULL; + + Data_Get_Struct (obj, RbCollection, coll); + + coll->real = xmmsv_new_coll (XMMS_COLLECTION_TYPE_UNIVERSE); + + return obj; +}+
Returns the attributes of the collection.
+ + + + +static VALUE +c_coll_attributes (VALUE self) +{ + RbCollection *coll = NULL; + + Data_Get_Struct (self, RbCollection, coll); + + if (NIL_P (coll->attributes)) + coll->attributes = rb_class_new_instance (1, &self, cAttributes); + + return coll->attributes; +}+
Returns a new collection that is the logical complement of c.
+ + + + +# File xmmsclient.rb, line 49 +def complement + c = Xmms::Collection.new(Xmms::Collection::TYPE_COMPLEMENT) + c.operands << self + c +end+
Gets the list of media ids that make up the collection.
+ + + + +static VALUE +c_coll_idlist_get (VALUE self) +{ + VALUE ary = rb_ary_new (); + xmmsv_t *ret = NULL; + xmmsv_list_iter_t *it = NULL; + int32_t entry; + + COLL_METHOD_ADD_HANDLER_RET (idlist_get) + + xmmsv_get_list_iter (ret, &it); + for (xmmsv_list_iter_first (it); + xmmsv_list_iter_valid (it); + xmmsv_list_iter_next (it)) { + + xmmsv_list_iter_entry_int (it, &entry); + rb_ary_push (ary, INT2NUM (entry)); + } + xmmsv_list_iter_explicit_destroy (it); + + return ary; +}+
Sets the list of media ids that make up the collection.
+ + + + +static VALUE +c_coll_idlist_set (VALUE self, VALUE ids) +{ + int i; + int *ary = NULL; + VALUE *rb_ary; + int rb_ary_len; + + Check_Type (ids, T_ARRAY); + COLL_METHOD_HANDLER_HEADER + + rb_ary = RARRAY_PTR (ids); + rb_ary_len = RARRAY_LEN (ids); + + ary = malloc (sizeof (int) * (rb_ary_len + 1)); + + for (i = 0; i < rb_ary_len; i++) + ary[i] = NUM2INT (rb_ary[i]); + + ary[i] = 0; + + xmmsv_coll_set_idlist (coll->real, ary); + + return self; +}+
Returns a new collection that is the logical AND of c and +other.
+ + + + +# File xmmsclient.rb, line 37 +def intersect(other) + c = Xmms::Collection.new(Xmms::Collection::TYPE_INTERSECTION) + c.operands << self + c.operands << other + c +end+
Gets a list of the operands that make up the collection.
+ + + + +static VALUE +c_coll_operands (VALUE self) +{ + RbCollection *coll = NULL; + + Data_Get_Struct (self, RbCollection, coll); + + if (NIL_P (coll->operands)) + coll->operands = rb_class_new_instance (1, &self, cOperands); + + return coll->operands; +}+
Returns the type of the collection as an Integer.
+ + + + +static VALUE +c_coll_type_get (VALUE self) +{ + xmmsc_coll_type_t ret; + + COLL_METHOD_ADD_HANDLER_RET (get_type) + + return INT2NUM (ret); +}+
Returns a new collection that is the logical OR of c and +other.
+ + + + +# File xmmsclient.rb, line 25 +def union(other) + c = Xmms::Collection.new(Xmms::Collection::TYPE_UNION) + c.operands << self + c.operands << other + c +end+
# File async.rb, line 46 +def initialize(coll) + @real = coll +end+
# File async.rb, line 50 +def method_missing(id, *args, &block) + ret = @real.send(id, *args) + if(block_given? && ret.is_a?(Xmms::Result)) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
static VALUE +c_attrs_init (VALUE self, VALUE collection) +{ + rb_iv_set (self, "collection", collection); + + return self; +}+
HAVE_RB_PROTECT_INSPECT
+ + + + +static VALUE +c_attrs_aref (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + int s; + const char *value; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + s = xmmsv_coll_attribute_get_string (coll->real, StringValuePtr (key), &value); + if (!s) + return Qnil; + + return rb_str_new2 (value); +}+
static VALUE +c_attrs_aset (VALUE self, VALUE key, VALUE value) +{ + RbCollection *coll = NULL; + VALUE tmp; + + StringValue (key); + StringValue (value); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + xmmsv_coll_attribute_set_string (coll->real, StringValuePtr (key), + StringValuePtr (value)); + + return Qnil; +}+
static VALUE +c_attrs_delete (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + xmmsv_coll_attribute_remove (coll->real, StringValuePtr (key)); + + return Qnil; +}+
static VALUE +c_attrs_each (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_PAIR)); + + return self; +}+
static VALUE +c_attrs_each_key (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_KEY)); + + return self; +}+
static VALUE +c_attrs_each_value (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_VALUE)); + + return self; +}+
static VALUE +c_attrs_has_key (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + int s; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + s = xmmsv_coll_attribute_get_string (coll->real, StringValuePtr (key), NULL); + + return s ? Qtrue : Qfalse; +}+
static VALUE +c_attrs_inspect (VALUE self) +{ + return rb_protect_inspect (attrs_inspect, self, 0); +}+
static VALUE +c_operands_init (VALUE self, VALUE collection) +{ + rb_iv_set (self, "collection", collection); + + return self; +}+
static VALUE +c_operands_delete (VALUE self, VALUE arg) +{ + RbCollection *coll = NULL, *coll2 = NULL; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + Data_Get_Struct (arg, RbCollection, coll2); + + xmmsv_coll_remove_operand (coll->real, coll2->real); + + return Qnil; +}+
static VALUE +c_operands_each (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *operands_list; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + operands_list = xmmsv_coll_operands_get (coll->real); + + xmmsv_list_foreach (operands_list, operands_each, NULL); + + return self; +}+
static VALUE +c_operands_push (VALUE self, VALUE arg) +{ + RbCollection *coll = NULL, *coll2 = NULL; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + Data_Get_Struct (arg, RbCollection, coll2); + + xmmsv_coll_add_operand (coll->real, coll2->real); + + return self; +}+
# File sync.rb, line 46 +def initialize(coll) + @real = coll +end+
# File sync.rb, line 50 +def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
static VALUE +c_dict_aref (VALUE self, VALUE key) +{ + RbDict *dict = NULL; + xmmsv_dict_iter_t *it; + xmmsv_t *value; + const char *ckey; + int s; + + Check_Type (key, T_SYMBOL); + + Data_Get_Struct (self, RbDict, dict); + + ckey = rb_id2name (SYM2ID (key)); + + xmmsv_get_dict_iter (dict->real, &it); + + s = xmmsv_dict_iter_find (it, ckey); + if (!s) + return Qnil; + + xmmsv_dict_iter_pair (it, NULL, &value); + + return extract_value (self, value); +}+
static VALUE +c_dict_each (VALUE self) +{ + RbDict *dict = NULL; + + Data_Get_Struct (self, RbDict, dict); + + xmmsv_dict_foreach (dict->real, dict_each_pair, &self); + + return self; +}+
static VALUE +c_dict_each_key (VALUE self) +{ + RbDict *dict = NULL; + + Data_Get_Struct (self, RbDict, dict); + + xmmsv_dict_foreach (dict->real, dict_each_key, NULL); + + return self; +}+
static VALUE +c_dict_each_value (VALUE self) +{ + RbDict *dict = NULL; + + Data_Get_Struct (self, RbDict, dict); + + xmmsv_dict_foreach (dict->real, dict_each_value, &self); + + return self; +}+
static VALUE +c_dict_empty (VALUE self) +{ + RbDict *dict = NULL; + int size; + + Data_Get_Struct (self, RbDict, dict); + + size = xmmsv_dict_get_size (dict->real); + + return size == 0 ? Qtrue : Qfalse; +}+
static VALUE +c_dict_has_key (VALUE self, VALUE key) +{ + RbDict *dict = NULL; + xmmsv_dict_iter_t *it; + const char *ckey; + + Check_Type (key, T_SYMBOL); + + Data_Get_Struct (self, RbDict, dict); + + ckey = rb_id2name (SYM2ID (key)); + + xmmsv_get_dict_iter (dict->real, &it); + + return xmmsv_dict_iter_find (it, ckey) ? Qtrue : Qfalse; +}+
static VALUE +c_dict_inspect (VALUE self) +{ + return rb_protect_inspect (dict_inspect, self, 0); +}+
static VALUE +c_dict_size (VALUE self) +{ + RbDict *dict = NULL; + int size; + + Data_Get_Struct (self, RbDict, dict); + + size = xmmsv_dict_get_size (dict->real); + + return INT2NUM (size); +}+
Initializes a new Xmms::Playlist using the +playlist named name and the Xmms::Client +instance xc. Xmms::Client#playlist is a useful +shortcut. name is is the name of the playlist and the active +playlist will be used if it is not specified. Raises PlaylistError if the playlist name +is invalid.
+ + + + +static VALUE +c_init (int argc, VALUE *argv, VALUE self) +{ + RbPlaylist *pl = NULL; + VALUE name, xmms = Qnil; + + Data_Get_Struct (self, RbPlaylist, pl); + + rb_scan_args (argc, argv, "11", &xmms, &name); + + /* FIXME: Check type! */ + pl->xmms = xmms; + + if (NIL_P (name)) + pl->name_value = rb_str_new2 (XMMS_ACTIVE_PLAYLIST); + else + pl->name_value = rb_str_dup (name); + + OBJ_FREEZE (pl->name_value); + + pl->name = StringValuePtr (pl->name_value); + + return self; +}+
Adds the collection coll to the playlist.
+ + + + +static VALUE +c_add_collection (int argc, VALUE *argv, VALUE self) +{ + PLAYLIST_METHOD_HANDLER_HEADER + + VALUE rbcoll, order = Qnil; + xmmsv_t *corder = NULL; + xmmsc_coll_t *coll; + + rb_scan_args (argc, argv, "11", &rbcoll, &order); + + coll = FROM_XMMS_CLIENT_COLLECTION (rbcoll); + + if (!NIL_P (order)) + corder = parse_string_array2 (order); + + res = xmmsc_playlist_add_collection (xmms->real, pl->name, + coll, corder); + + if (corder) + xmmsv_unref (corder); + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
Adds an entry to the playlist. arg can be either a URL or an id.
+ + + + +static VALUE +c_add_entry (VALUE self, VALUE arg) +{ + int32_t id; + + PLAYLIST_METHOD_HANDLER_HEADER + + if (!NIL_P (rb_check_string_type (arg))) + res = xmmsc_playlist_add_url (xmms->real, pl->name, + StringValuePtr (arg)); + else { + id = check_int32 (arg); + res = xmmsc_playlist_add_id (xmms->real, pl->name, id); + } + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
Clears the playlist.
+ + + + +static VALUE +c_clear (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (clear) +}+
Retrieves the current position of the playlist. May raise an Xmms::Result::ValueError exception if the +current position is undefined.
+ + + + +static VALUE +c_current_pos (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (current_pos) +}+
Retrieves an array containing ids for each position of the playlist.
+ + + + +static VALUE +c_list_entries (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (list_entries) +}+
Inserts an entry to the current playlist at position pos in the +playlist. arg can be either a URL or an id.
+ + + + +static VALUE +c_insert_entry (VALUE self, VALUE pos, VALUE arg) +{ + int32_t id; + int32_t ipos; + + PLAYLIST_METHOD_HANDLER_HEADER + + ipos = check_int32 (pos); + + if (!NIL_P (rb_check_string_type (arg))) + res = xmmsc_playlist_insert_url (xmms->real, pl->name, + ipos, StringValuePtr (arg)); + else { + id = check_int32 (arg); + res = xmmsc_playlist_insert_id (xmms->real, pl->name, + ipos, id); + } + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
Loads the playlist as the current active playlist.
+ + + + +static VALUE +c_load (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (load); +}+
Moves the entry at current_pos to new_pos in the +playlist.
+ + + + +static VALUE +c_move_entry (VALUE self, VALUE cur_pos, VALUE new_pos) +{ + PLAYLIST_METHOD_ADD_HANDLER_INT_INT (move_entry, cur_pos, new_pos) +}+
Returns the name of the playlist in the medialib as a String.
+ + + + +static VALUE +c_name (VALUE self) +{ + RbPlaylist *pl = NULL; + + Data_Get_Struct (self, RbPlaylist, pl); + + return pl->name_value; +}+
Recursively imports all media files under path to the playlist.
+ + + + +static VALUE +c_radd (VALUE self, VALUE path) +{ + PLAYLIST_METHOD_ADD_HANDLER_STR (radd, path); +}+
Removes the playlist from the medialib.
+ + + + +static VALUE +c_remove (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (remove); +}+
Removes the entry at pos from the playlist.
+ + + + +static VALUE +c_remove_entry (VALUE self, VALUE pos) +{ + PLAYLIST_METHOD_ADD_HANDLER_INT (remove_entry, pos) +}+
Recursively imports all media files under path at position +pos in the playlist.
+ + + + +static VALUE +c_rinsert (VALUE self, VALUE pos, VALUE path) +{ + PLAYLIST_METHOD_ADD_HANDLER_INT_STR (rinsert, pos, path); +}+
Shuffles the playlist.
+ + + + +static VALUE +c_shuffle (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (shuffle) +}+
Sorts the playlist on properties, which is an array of medialib +properties such as [“title”, “artist”].
+ + + + +static VALUE +c_sort (VALUE self, VALUE props) +{ + xmmsv_t *cprops; + PLAYLIST_METHOD_HANDLER_HEADER + + cprops = parse_string_array2 (props); + res = xmmsc_playlist_sort (xmms->real, pl->name, cprops); + xmmsv_unref (cprops); + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
# File async.rb, line 65 +def initialize(plist) + @real = plist +end+
# File async.rb, line 69 +def method_missing(id, *args, &block) + ret = @real.send(id, *args) + if(block_given? && ret.is_a?(Xmms::Result)) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
# File sync.rb, line 65 +def initialize(plist) + @real = plist +end+
# File sync.rb, line 69 +def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
Transforms a RawDict (key-source-value) to a +regular key-value dict. The optional src_prefs argument restricts which +sources are considered. The value may be a string or an array of strings, +which may contain wildcards. Example: rawdict.to_propdict( +['server','plugin/*'] )
+ + + + +static VALUE +c_raw_dict_to_propdict (int argc, VALUE *argv, VALUE self) +{ + VALUE value, sources = Qnil; + RbDict *dict = NULL, *dict2 = NULL; + xmmsv_t *inner_dict; + const char **csources = NULL; + + Data_Get_Struct (self, RbDict, dict); + + rb_scan_args (argc, argv, "01", &sources); + + if (!NIL_P (sources)) + csources = parse_string_array (sources); + inner_dict = xmmsv_propdict_to_dict (dict->real, csources); + if (csources) + free (csources); + + value = Data_Make_Struct (cDict, RbDict, + c_dict_mark, c_dict_free, + dict2); + + // don't add a second reference here + dict2->real = inner_dict; + dict2->parent = dict->parent; + + rb_obj_call_init (value, 0, NULL); + + return value; +}+
static VALUE +c_get_error (VALUE self) +{ + RbResult *res; + xmmsv_t *val; + const char *error; + int ret; + + Data_Get_Struct (self, RbResult, res); + + val = xmmsc_result_get_value (res->real); + + ret = xmmsv_get_error (val, &error); + + return rb_str_new2 (ret ? error : ""); +}+
static VALUE +c_is_error (VALUE self) +{ + RbResult *res; + + Data_Get_Struct (self, RbResult, res); + + return xmmsc_result_iserror (res->real) ? Qtrue : Qfalse; +}+
Sets the block that's executed when res is handled. Used by +asyncronous results only.
+ + + + +static VALUE +c_notifier_set (VALUE self) +{ + VALUE callback; + RbResult *res = NULL; + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbResult, res); + + if (!rb_block_given_p ()) + return Qnil; + + callback = rb_block_proc (); + + Data_Get_Struct (res->xmms, RbXmmsClient, xmms); + rb_ary_push (xmms->result_callbacks, callback); + + xmmsc_result_notifier_set (res->real, on_signal, (void *) callback); + + return Qnil; +}+
static VALUE +c_value_get (VALUE self) +{ + RbResult *res = NULL; + xmmsv_t *val; + + Data_Get_Struct (self, RbResult, res); + + val = xmmsc_result_get_value (res->real); + + return extract_value (self, val); +}+
Waits for res to be handled.
+ + + + +static VALUE +c_wait (VALUE self) +{ + RbResult *res = NULL; + + Data_Get_Struct (self, RbResult, res); + + xmmsc_result_wait (res->real); + + return self; +}+
static VALUE +c_disconnect (VALUE self) +{ + RbResult *res = NULL; + + Data_Get_Struct (self, RbResult, res); + + xmmsc_result_disconnect (res->real); + + return self; +}+
This is the API documentation for RDoc Documentation. +
import os from waflib import Options, Utils, Logs
+ +def build(bld):
+ +source = """ +rb_xmmsclient_main.c +rb_xmmsclient.c +rb_playlist.c +rb_collection.c +rb_result.c +""".split() + +bld(features = 'c cshlib rubyext', + target = 'xmmsclient_ext', + source = source, + uselib = 'DISABLE_STRICTPROTOTYPES', + use = 'xmmsclient', + includes = '../../../.. ../../../include ../../../includepriv', + install_path = '${ARCHDIR_RUBY}', + mac_bundle = bld.env.mac_bundle_enabled + ) + +bld.install_files('${LIBDIR_RUBY}', 'xmmsclient.rb') +bld.install_files('${LIBDIR_RUBY}/xmmsclient', 'sync.rb') +bld.install_files('${LIBDIR_RUBY}/xmmsclient', 'async.rb') + +# glib +bld(features = 'c cshlib rubyext', + target = 'xmmsclient_glib', + source = 'rb_xmmsclient_glib.c', + uselib = 'glib2 DISABLE_STRICTPROTOTYPES', + use = 'xmmsclient-glib xmmsclient', + includes = '../../../.. ../../../include ../../../includepriv', + install_path = '${ARCHDIR_RUBY}', + mac_bundle = bld.env.mac_bundle_enabled + ) + +# ecore +if 'src/clients/lib/xmmsclient-ecore' in bld.env.XMMS_OPTIONAL_BUILD: + bld(features = 'c cshlib rubyext', + target = 'xmmsclient_ecore', + source = 'rb_xmmsclient_ecore.c', + uselib = 'ecore DISABLE_STRICTPROTOTYPES', + use = 'xmmsclient-ecore xmmsclient', + includes = '../../../.. ../../../include ../../../includepriv', + install_path = '${ARCHDIR_RUBY}', + mac_bundle = bld.env.mac_bundle_enabled + )+ +
def configure(conf):
+ +conf.load("ruby") +conf.check_ruby_version((1,8,0)) +conf.check_ruby_ext_devel() + +conf.check_cc(function_name="rb_protect_inspect", header_name="ruby.h", + uselib="RUBYEXT", mandatory=False) + +prefix = os.path.commonprefix([conf.env.ARCHDIR_RUBY, conf.env.PREFIX]) +if prefix != conf.env.PREFIX: + Logs.warn("Default ruby archdir is not under PREFIX. Specify path " + "manually using --with-ruby-archdir if you don't want the " + "ruby bindings to be installed to %s" % conf.env.ARCHDIR_RUBY) + +prefix = os.path.commonprefix([conf.env.LIBDIR_RUBY, conf.env.PREFIX]) +if prefix != conf.env.PREFIX: + Logs.warn("Default ruby libdir is not under PREFIX. Specify path " + "manually using --with-ruby-libdir if you don't want the " + "ruby bindings to be installed to %s" % conf.env.ARCHDIR_RUBY) + +return True+ +
def options(opt):
+ +opt.load('ruby') ++
Returns a new Xmms::Collection object of +type type.
+ + + + +static VALUE +c_coll_init (VALUE self, VALUE type) +{ + COLL_METHOD_HANDLER_HEADER + + coll->real = xmmsv_new_coll (check_int32 (type)); + + return self; +}+
Returns a collection matching a String pattern. See the wiki for +details on how to construct a pattern string.
+ + + + +static VALUE +c_coll_parse (VALUE klass, VALUE pattern) +{ + VALUE obj = rb_obj_alloc (klass); + RbCollection *coll = NULL; + + Data_Get_Struct (obj, RbCollection, coll); + + if (!xmmsv_coll_parse (StringValuePtr (pattern), &coll->real)) { + rb_raise (ePatternError, "invalid pattern"); + } + + return obj; +}+
Returns a collection referencing the “All Media” set.
+ + + + +static VALUE +c_coll_universe (VALUE klass) +{ + VALUE obj = rb_obj_alloc (klass); + RbCollection *coll = NULL; + + Data_Get_Struct (obj, RbCollection, coll); + + coll->real = xmmsv_new_coll (XMMS_COLLECTION_TYPE_UNIVERSE); + + return obj; +}+
Returns the attributes of the collection.
+ + + + +static VALUE +c_coll_attributes (VALUE self) +{ + RbCollection *coll = NULL; + + Data_Get_Struct (self, RbCollection, coll); + + if (NIL_P (coll->attributes)) + coll->attributes = rb_class_new_instance (1, &self, cAttributes); + + return coll->attributes; +}+
Gets the list of media ids that make up the collection.
+ + + + +static VALUE +c_coll_idlist_get (VALUE self) +{ + VALUE ary = rb_ary_new (); + xmmsv_t *ret = NULL; + xmmsv_list_iter_t *it = NULL; + int32_t entry; + + COLL_METHOD_ADD_HANDLER_RET (idlist_get) + + xmmsv_get_list_iter (ret, &it); + for (xmmsv_list_iter_first (it); + xmmsv_list_iter_valid (it); + xmmsv_list_iter_next (it)) { + + xmmsv_list_iter_entry_int (it, &entry); + rb_ary_push (ary, INT2NUM (entry)); + } + xmmsv_list_iter_explicit_destroy (it); + + return ary; +}+
Sets the list of media ids that make up the collection.
+ + + + +static VALUE +c_coll_idlist_set (VALUE self, VALUE ids) +{ + int i; + int *ary = NULL; + VALUE *rb_ary; + int rb_ary_len; + + Check_Type (ids, T_ARRAY); + COLL_METHOD_HANDLER_HEADER + + rb_ary = RARRAY_PTR (ids); + rb_ary_len = RARRAY_LEN (ids); + + ary = malloc (sizeof (int) * (rb_ary_len + 1)); + + for (i = 0; i < rb_ary_len; i++) + ary[i] = NUM2INT (rb_ary[i]); + + ary[i] = 0; + + xmmsv_coll_set_idlist (coll->real, ary); + + return self; +}+
Gets a list of the operands that make up the collection.
+ + + + +static VALUE +c_coll_operands (VALUE self) +{ + RbCollection *coll = NULL; + + Data_Get_Struct (self, RbCollection, coll); + + if (NIL_P (coll->operands)) + coll->operands = rb_class_new_instance (1, &self, cOperands); + + return coll->operands; +}+
Returns the type of the collection as an Integer.
+ + + + +static VALUE +c_coll_type_get (VALUE self) +{ + xmmsc_coll_type_t ret; + + COLL_METHOD_ADD_HANDLER_RET (get_type) + + return INT2NUM (ret); +}+
static VALUE +c_attrs_init (VALUE self, VALUE collection) +{ + rb_iv_set (self, "collection", collection); + + return self; +}+
HAVE_RB_PROTECT_INSPECT
+ + + + +static VALUE +c_attrs_aref (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + int s; + const char *value; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + s = xmmsv_coll_attribute_get_string (coll->real, StringValuePtr (key), &value); + if (!s) + return Qnil; + + return rb_str_new2 (value); +}+
static VALUE +c_attrs_aset (VALUE self, VALUE key, VALUE value) +{ + RbCollection *coll = NULL; + VALUE tmp; + + StringValue (key); + StringValue (value); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + xmmsv_coll_attribute_set_string (coll->real, StringValuePtr (key), + StringValuePtr (value)); + + return Qnil; +}+
static VALUE +c_attrs_delete (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + xmmsv_coll_attribute_remove (coll->real, StringValuePtr (key)); + + return Qnil; +}+
static VALUE +c_attrs_each (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_PAIR)); + + return self; +}+
static VALUE +c_attrs_each_key (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_KEY)); + + return self; +}+
static VALUE +c_attrs_each_value (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_VALUE)); + + return self; +}+
static VALUE +c_attrs_has_key (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + int s; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + s = xmmsv_coll_attribute_get_string (coll->real, StringValuePtr (key), NULL); + + return s ? Qtrue : Qfalse; +}+
static VALUE +c_attrs_inspect (VALUE self) +{ + return rb_protect_inspect (attrs_inspect, self, 0); +}+
static VALUE +c_operands_init (VALUE self, VALUE collection) +{ + rb_iv_set (self, "collection", collection); + + return self; +}+
static VALUE +c_operands_delete (VALUE self, VALUE arg) +{ + RbCollection *coll = NULL, *coll2 = NULL; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + Data_Get_Struct (arg, RbCollection, coll2); + + xmmsv_coll_remove_operand (coll->real, coll2->real); + + return Qnil; +}+
static VALUE +c_operands_each (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *operands_list; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + operands_list = xmmsv_coll_operands_get (coll->real); + + xmmsv_list_foreach (operands_list, operands_each, NULL); + + return self; +}+
static VALUE +c_operands_push (VALUE self, VALUE arg) +{ + RbCollection *coll = NULL, *coll2 = NULL; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + Data_Get_Struct (arg, RbCollection, coll2); + + xmmsv_coll_add_operand (coll->real, coll2->real); + + return self; +}+
Decodes a url-encoded string url and returns it in UNKNOWN +ENCODING. Use with caution.
+ + + + +static VALUE +m_decode_url (VALUE self, VALUE str) +{ + const unsigned char *burl; + unsigned int blen; + xmmsv_t *strv, *decoded; + VALUE url = Qnil; + + strv = xmmsv_new_string (StringValuePtr (str)); + + decoded = xmmsv_decode_url (strv); + + if (!decoded) + goto out; + + if (!xmmsv_get_bin (decoded, &burl, &blen)) + goto out; + + url = rb_str_new ((char *) burl, blen); + +out: + if (decoded) + xmmsv_unref (decoded); + + xmmsv_unref (strv); + + return url; +}+
Returns the xmms2 configuration directory for the current user.
+ + + + +static VALUE +m_userconfdir_get (VALUE self) +{ + const char *p; + char path[XMMS_PATH_MAX]; + + p = xmmsc_userconfdir_get (path, XMMS_PATH_MAX); + + return p ? rb_str_new2 (p) : Qnil; +}+
static VALUE +c_disconnect (VALUE self) +{ + RbResult *res = NULL; + + Data_Get_Struct (self, RbResult, res); + + xmmsc_result_disconnect (res->real); + + return self; +}+
Creates an Xmms::Client object.
+ + + + +static VALUE +c_init (VALUE self, VALUE name) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + if (!(xmms->real = xmmsc_init (StringValuePtr (name)))) { + rb_raise (rb_eNoMemError, "failed to allocate memory"); + return Qnil; + } + + xmms->deleted = false; + xmms->result_callbacks = rb_ary_new (); + xmms->disconnect_cb = Qnil; + xmms->io_need_out_cb = Qnil; + + return self; +}+
Stores binary data on the server.
+ + + + +static VALUE +c_bindata_add (VALUE self, VALUE data) +{ + METHOD_ADD_HANDLER_BIN (bindata_add, data); +}+
List all bindata hashes stored on the server.
+ + + + +static VALUE +c_bindata_list (VALUE self) +{ + METHOD_ADD_HANDLER (bindata_list); +}+
Remove a datafile from the server.
+ + + + +static VALUE +c_bindata_remove (VALUE self, VALUE hash) +{ + METHOD_ADD_HANDLER_STR (bindata_remove, hash); +}+
Retrieves the bindata entry specified by hash (hex string) from the server.
+ + + + +static VALUE +c_bindata_retrieve (VALUE self, VALUE hash) +{ + METHOD_ADD_HANDLER_STR (bindata_retrieve, hash); +}+
The collection_changed broadcast, if requested, is called anytime a +collection is altered.
+ + + + +static VALUE +c_broadcast_coll_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_collection_changed) +}+
Retrieves configuration properties as a broadcast.
+ + + + +static VALUE +c_broadcast_config_value_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_config_value_changed); +}+
Requests the status of the mediainfo reader.
+ + + + +static VALUE +c_broadcast_mediainfo_reader_status (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_mediainfo_reader_status); +}+
Retrieves the id of an added medialib entry as a broadcast.
+ + + + +static VALUE +c_broadcast_medialib_entry_added (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_medialib_entry_added); +}+
Retrieves the id of a changed medialib entry as a broadcast.
+ + + + +static VALUE +c_broadcast_medialib_entry_changed (VALUE self) +{ + RB_XMMS_DEPRECATED (broadcast_medialib_entry_changed, broadcast_medialib_entry_updated); + METHOD_ADD_HANDLER (broadcast_medialib_entry_updated); +}+
Retrieves the id of an removed medialib entry as a broadcast.
+ + + + +static VALUE +c_broadcast_medialib_entry_removed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_medialib_entry_removed); +}+
Retrieves the id of a changed medialib entry as a broadcast.
+ + + + +static VALUE +c_broadcast_medialib_entry_updated (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_medialib_entry_updated); +}+
Retrieves the media id of the currently played track as a broadcast.
+ + + + +static VALUE +c_broadcast_playback_current_id (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playback_current_id); +}+
Retrieves the playback status as a broadcast.
+ + + + +static VALUE +c_broadcast_playback_status (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playback_status); +}+
Registers a broadcast handler that's evoked when the playback volume +changes.
+ + + + +static VALUE +c_broadcast_playback_volume_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playback_volume_changed); +}+
Retrieves a hash describing the change to the playlist as a broadcast.
+ + + + +static VALUE +c_broadcast_playlist_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playlist_changed); +}+
Retrieves the current playlist position as a broadcast. See +playlist_current_pos.
+ + + + +static VALUE +c_broadcast_playlist_current_pos (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playlist_current_pos); +}+
Will be called when a playlist has been loaded.
+ + + + +static VALUE +c_broadcast_playlist_loaded (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playlist_loaded); +}+
Will be called when the server is terminating.
+ + + + +static VALUE +c_broadcast_quit (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_quit); +}+
Find all collections in the given namespace ns which contain +id.
+ + + + +static VALUE +c_coll_find (VALUE self, VALUE id, VALUE ns) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_coll_find (xmms->real, check_int32 (id), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Returns a result containing an Xmms::Collection object referencing the +collection named name. The namespace ns is searched or +all namespaces if unspecified.
+ + + + +static VALUE +c_coll_get (int argc, VALUE *argv, VALUE self) +{ + VALUE name, ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "11", &name, &ns); + + if (NIL_P (ns)) + res = xmmsc_coll_get (xmms->real, StringValuePtr (name), + XMMS_COLLECTION_NS_ALL); + else + res = xmmsc_coll_get (xmms->real, StringValuePtr (name), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Returns a collection of the idlist type from the playlist file at +path. path must be an unencoded string.
+ + + + +static VALUE +c_coll_idlist_from_playlist_file (VALUE self, VALUE path) +{ + METHOD_ADD_HANDLER_STR (coll_idlist_from_playlist_file, path) +}+
Retrieves an array of the names of all the collections stored in the +medialib under the namespace ns. If ns is not specified, +it defaults to ALL.
+ + + + +static VALUE +c_coll_list (int argc, VALUE *argv, VALUE self) +{ + VALUE ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "01", &ns); + + if (NIL_P (ns)) + ns = rb_str_new2 (XMMS_COLLECTION_NS_ALL); + + res = xmmsc_coll_list (xmms->real, StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
static VALUE +c_coll_query (int argc, VALUE *argv, VALUE self) +{ + VALUE coll, spec; + xmmsv_t *cspec; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "2", &coll, &spec); + + cspec = xmmsv_new_dict (); + + VALUE args = rb_ary_new3(4, xmms, coll, spec, (VALUE) cspec); + + res = (xmmsc_result_t *) rb_ensure (c_coll_query_fragile, args, + c_coll_query_cleanup, (VALUE) cspec); + + METHOD_HANDLER_FOOTER +}+
Retrieves a list of all the ids of media matched by the collection. +order specifies a list of properties to order by or no order if +omitted. start and len determine the offset at which to +start retrieving ids and the maximum number of ids to retrieve, +respectively.
+ + + + +static VALUE +c_coll_query_ids (int argc, VALUE *argv, VALUE self) +{ + VALUE coll, order = Qnil, start, len = Qnil; + xmmsv_t *corder = NULL; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "13", &coll, &order, &start, &len); + + if (!NIL_P (order)) + corder = parse_string_array2 (order); + + res = xmmsc_coll_query_ids (xmms->real, + FROM_XMMS_CLIENT_COLLECTION (coll), + corder, + NIL_P (start) ? 0 : NUM2INT (start), + NIL_P (start) ? 0 : NUM2INT (len)); + + if (corder) + xmmsv_unref (corder); + + METHOD_HANDLER_FOOTER +}+
Retrieves media info of media matched by the collection. fetch +should contain an array of properties to retrieve from the collection. +order specifies a list of properties to order by or no order if +omitted. start and len determine the offset at which to +start retrieving info and the maximum number of ids to retrieve, +respectively. group defines a list of properties to group by or no +grouping if omitted.
+ + + + +static VALUE +c_coll_query_info (int argc, VALUE *argv, VALUE self) +{ + VALUE coll, order = Qnil, start, len, fetch, group = Qnil; + xmmsv_t *cfetch = NULL, *corder = NULL, *cgroup = NULL; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "24", &coll, &fetch, &order, &start, &len, + &group); + + cfetch = parse_string_array2 (fetch); + + if (!NIL_P (order)) + corder = parse_string_array2 (order); + + if (!NIL_P (group)) + cgroup = parse_string_array2 (group); + + res = xmmsc_coll_query_infos (xmms->real, + FROM_XMMS_CLIENT_COLLECTION (coll), + corder, + NIL_P (start) ? 0 : NUM2INT (start), + NIL_P (start) ? 0 : NUM2INT (len), + cfetch, + cgroup); + xmmsv_unref (cfetch); + if (corder) { + xmmsv_unref (corder); + } + if (cgroup) { + xmmsv_unref (cgroup); + } + + METHOD_HANDLER_FOOTER +}+
Remove the collection named name from the media library. The +collection is removed from the namespace ns or all namespaces if +unspecified.
+ + + + +static VALUE +c_coll_remove (int argc, VALUE *argv, VALUE self) +{ + VALUE name, ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "11", &name, &ns); + + if (NIL_P (ns)) + res = xmmsc_coll_remove (xmms->real, StringValuePtr (name), + XMMS_COLLECTION_NS_ALL); + else + res = xmmsc_coll_remove (xmms->real, StringValuePtr (name), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Rename the saved collection from old to new within the +namespace ns or all namespaces.
+ + + + +static VALUE +c_coll_rename (int argc, VALUE *argv, VALUE self) +{ + VALUE old, new, ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "21", &old, &new, &ns); + + if (NIL_P (ns)) + res = xmmsc_coll_rename (xmms->real, + StringValuePtr (old), + StringValuePtr (new), + XMMS_COLLECTION_NS_ALL); + else + res = xmmsc_coll_rename (xmms->real, + StringValuePtr (old), + StringValuePtr (new), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Save the collection coll named name under the namespace +ns to the media library.
+ + + + +static VALUE +c_coll_save (VALUE self, VALUE coll, VALUE name, VALUE ns) +{ + METHOD_HANDLER_HEADER + + /* FIXME: Check that we actually have a Collection object */ + + res = xmmsc_coll_save (xmms->real, + FROM_XMMS_CLIENT_COLLECTION (coll), + StringValuePtr (name), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Retrieves the value of the configuration property at key.
+ + + + +static VALUE +c_config_get_value (VALUE self, VALUE key) +{ + METHOD_ADD_HANDLER_STR (config_get_value, key); +}+
Retrieves a list of all config values.
+ + + + +static VALUE +c_config_list_values (VALUE self) +{ + METHOD_ADD_HANDLER (config_list_values); +}+
Registers a configuration property at key with the given default +value.
+ + + + +static VALUE +c_config_register_value (VALUE self, VALUE key, VALUE defval) +{ + METHOD_ADD_HANDLER_STR_STR (config_register_value, key, defval); +}+
Sets the value of the configuration property at key to +value.
+ + + + +static VALUE +c_config_set_value (VALUE self, VALUE key, VALUE val) +{ + METHOD_ADD_HANDLER_STR_STR (config_set_value, key, val); +}+
Connects xc to the XMMS2 daemon listening at path. If +path isn't given, the default path is used.
+ + + + +static VALUE +c_connect (int argc, VALUE *argv, VALUE self) +{ + VALUE path; + RbXmmsClient *xmms = NULL; + char *p = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + rb_scan_args (argc, argv, "01", &path); + + if (!NIL_P (path)) + p = StringValuePtr (path); + + if (!xmmsc_connect (xmms->real, p)) + rb_raise (eClientError, + "cannot connect to daemon (%s)", + xmmsc_get_last_error (xmms->real)); + + return self; +}+
static VALUE +c_delete (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_unref (xmms->real); + xmms->deleted = true; + + return Qnil; +}+
Disconnects the IPC socket. This should only be used by event loop +implementations.
+ + + + +static VALUE +c_io_disconnect (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_io_disconnect (xmms->real); + + return Qnil; +}+
Returns the file descriptor of the Xmms::Client +IPC socket.
+ + + + +static VALUE +c_io_fd (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + return INT2NUM (xmmsc_io_fd_get (xmms->real)); +}+
Retrieves one incoming (from server) clientlib command if there are any in +the buffer.
+ + + + +static VALUE +c_io_in_handle (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_io_in_handle (xmms->real); + + return Qnil; +}+
Sets the block that's called when the output socket state changes.
+ + + + +static VALUE +c_io_on_need_out (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + if (!rb_block_given_p ()) + return Qnil; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmms->io_need_out_cb = rb_block_proc (); + + xmmsc_io_need_out_callback_set (xmms->real, + on_io_need_out, (void *) self); + + return Qnil; +}+
Sends one outgoing (to server) clientlib command. You should check io_want_out before calling this +method.
+ + + + +static VALUE +c_io_out_handle (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_io_out_handle (xmms->real); + + return Qnil; +}+
Returns true
if an outgoing (to server) clientlib command is
+pending, false
otherwise.
static VALUE +c_io_want_out (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + return xmmsc_io_want_out (xmms->real) ? Qtrue : Qfalse; +}+
Returns the last error that occured in xc or nil
, if
+no error occured yet.
static VALUE +c_last_error_get (VALUE self) +{ + RbXmmsClient *xmms = NULL; + const char *s; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + s = xmmsc_get_last_error (xmms->real); + + return s ? rb_str_new2 (s) : Qnil; +}+
Retrieves a hash containing statistics about the daemon.
+ + + + +static VALUE +c_main_stats (VALUE self) +{ + METHOD_ADD_HANDLER (main_stats); +}+
Adds url to the medialib.
+ + + + +static VALUE +c_medialib_add_entry (VALUE self, VALUE url) +{ + METHOD_ADD_HANDLER_STR (medialib_add_entry, url); +}+
Moves the entry specified by id to a new URL without changing +mediainfo.
+ + + + +static VALUE +c_medialib_entry_move (VALUE self, VALUE id, VALUE url) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_medialib_move_entry (xmms->real, check_int32 (id), + StringValuePtr (url)); + + METHOD_HANDLER_FOOTER +}+
Remove a custom field in the medialib associated with the entry +id. source is an optional argument that describes where +to write the mediainfo. If source is omitted, +“client/<yourclient>” is used, where <yourclient> is the name +you specified in ::new.
+ + + + +static VALUE +c_medialib_entry_property_remove (int argc, VALUE *argv, VALUE self) +{ + VALUE tmp, key, src = Qnil; + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + const char *ckey; + int32_t id; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + rb_scan_args (argc, argv, "21", &tmp, &key, &src); + + id = check_int32 (tmp); + Check_Type (key, T_SYMBOL); + + ckey = rb_id2name (SYM2ID (key)); + + if (NIL_P (src)) + res = xmmsc_medialib_entry_property_remove (xmms->real, id, + ckey); + else + res = xmmsc_medialib_entry_property_remove_with_source ( + xmms->real, id, + StringValuePtr (src), + ckey); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Write info to the medialib at id. source is an optional +argument that describes where to write the mediainfo. If source is +omitted, the mediainfo is written to “client/<yourclient>” where +<yourclient> is the name you specified in ::new.
+ + + + +static VALUE +c_medialib_entry_property_set (int argc, VALUE *argv, VALUE self) +{ + VALUE tmp, key, value, src = Qnil; + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + const char *ckey; + bool is_str = false; + int32_t id, ivalue; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + rb_scan_args (argc, argv, "31", &tmp, &key, &value, &src); + + id = check_int32 (tmp); + Check_Type (key, T_SYMBOL); + + if (!NIL_P (rb_check_string_type (value))) + is_str = true; + else + ivalue = check_int32 (value); + + ckey = rb_id2name (SYM2ID (key)); + + if (NIL_P (src) && is_str) + res = xmmsc_medialib_entry_property_set_str (xmms->real, id, + ckey, + StringValuePtr (value)); + else if (NIL_P (src)) + res = xmmsc_medialib_entry_property_set_int (xmms->real, id, + ckey, ivalue); + else if (is_str) + res = xmmsc_medialib_entry_property_set_str_with_source ( + xmms->real, id, + StringValuePtr (src), + ckey, + StringValuePtr (value)); + else + res = xmmsc_medialib_entry_property_set_int_with_source ( + xmms->real, id, + StringValuePtr (src), + ckey, ivalue); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Removes the entry specified by id from the medialib.
+ + + + +static VALUE +c_medialib_entry_remove (VALUE self, VALUE id) +{ + METHOD_ADD_HANDLER_INT (medialib_remove_entry, id) +}+
Retrieves the id corresponding to url.
+ + + + +static VALUE +c_medialib_get_id (VALUE self, VALUE url) +{ + METHOD_ADD_HANDLER_STR (medialib_get_id, url); +}+
Retrieves medialib info for id.
+ + + + +static VALUE +c_medialib_get_info (VALUE self, VALUE id) +{ + METHOD_ADD_HANDLER_INT (medialib_get_info, id); +}+
Recursively imports all media files under path to the medialib.
+ + + + +static VALUE +c_medialib_path_import (VALUE self, VALUE path) +{ + METHOD_ADD_HANDLER_STR (medialib_import_path, path); +}+
Recursively imports all media files under the url encoded path to +the medialib.
+ + + + +static VALUE +c_medialib_path_import_encoded (VALUE self, VALUE path) +{ + METHOD_ADD_HANDLER_STR (medialib_import_path_encoded, path); +}+
Rehashes the medialib entry at id or the whole medialib if +id == 0.
+ + + + +static VALUE +c_medialib_rehash (VALUE self, VALUE id) +{ + METHOD_ADD_HANDLER_INT (medialib_rehash, id); +}+
Sets the block that's executed when xc is disconnected from +the XMMS2 daemon.
+ + + + +static VALUE +c_on_disconnect (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + if (!rb_block_given_p ()) + return Qnil; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmms->disconnect_cb = rb_block_proc (); + + xmmsc_disconnect_callback_set (xmms->real, + on_disconnect, (void *) self); + + return self; +}+
Retrieves the media id of the currently played track.
+ + + + +static VALUE +c_playback_current_id (VALUE self) +{ + METHOD_ADD_HANDLER (playback_current_id); +}+
Pauses playback.
+ + + + +static VALUE +c_playback_pause (VALUE self) +{ + METHOD_ADD_HANDLER (playback_pause); +}+
Retrieves the playtime.
+ + + + +static VALUE +c_playback_playtime (VALUE self) +{ + METHOD_ADD_HANDLER (playback_playtime); +}+
Seek to the song position given in ms.
+ + + + +static VALUE +c_playback_seek_ms (VALUE self, VALUE ms) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_ms (xmms->real, + check_int32 (ms), + XMMS_PLAYBACK_SEEK_SET); + + METHOD_HANDLER_FOOTER +}+
Seek in the song by the offset given in ms.
+ + + + +static VALUE +c_playback_seek_ms_rel (VALUE self, VALUE ms) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_ms (xmms->real, + check_int32 (ms), + XMMS_PLAYBACK_SEEK_CUR); + + METHOD_HANDLER_FOOTER +}+
Seek to the song position given in samples.
+ + + + +static VALUE +c_playback_seek_samples (VALUE self, VALUE samples) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_samples (xmms->real, + check_int32 (samples), + XMMS_PLAYBACK_SEEK_SET); + + METHOD_HANDLER_FOOTER +}+
Seek in the song position by the offset given in samples.
+ + + + +static VALUE +c_playback_seek_samples_rel (VALUE self, VALUE samples) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_samples (xmms->real, + check_int32 (samples), + XMMS_PLAYBACK_SEEK_CUR); + + METHOD_HANDLER_FOOTER +}+
Starts playback.
+ + + + +static VALUE +c_playback_start (VALUE self) +{ + METHOD_ADD_HANDLER (playback_start); +}+
Retrieves the playback status.
+ + + + +static VALUE +c_playback_status (VALUE self) +{ + METHOD_ADD_HANDLER (playback_status); +}+
Stops playback.
+ + + + +static VALUE +c_playback_stop (VALUE self) +{ + METHOD_ADD_HANDLER (playback_stop); +}+
Advances to the next playlist entry.
+ + + + +static VALUE +c_playback_tickle (VALUE self) +{ + METHOD_ADD_HANDLER (playback_tickle); +}+
Gets the current playback volume.
+ + + + +static VALUE +c_playback_volume_get (VALUE self) +{ + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + res = xmmsc_playback_volume_get (xmms->real); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Sets playback volume for channel to volume.
+ + + + +static VALUE +c_playback_volume_set (VALUE self, VALUE channel, VALUE volume) +{ + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + Check_Type (channel, T_SYMBOL); + Check_Type (volume, T_FIXNUM); + + res = xmmsc_playback_volume_set (xmms->real, + rb_id2name (SYM2ID (channel)), + NUM2INT (volume)); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Shortcut for Xmms::Playlist.new. +Creates a new Xmms::Playlist object tied to the +current Xmms::Client instance. name is +is the name of the playlist and the active playlist will be used if it is +not specified. Raises PlaylistError if the playlist name is invalid.
+ + + + +static VALUE +c_playlist (int argc, VALUE *argv, VALUE self) +{ + VALUE args[2] = {self, Qnil}; + + rb_scan_args (argc, argv, "01", &args[1]); + + return rb_class_new_instance (2, args, cPlaylist); +}+
Retrieves the name of the active playlist.
+ + + + +static VALUE +c_playlist_current_active (VALUE self) +{ + METHOD_ADD_HANDLER (playlist_current_active); +}+
Retrieves a list of all saved playlists from the medialib. Note that +clients should treat internally used playlists (marked with a leading +underscore) carefully.
+ + + + +static VALUE +c_playlist_list (VALUE self) +{ + METHOD_ADD_HANDLER (playlist_list); +}+
Sets the next song to be played to pos (an absolute position).
+ + + + +static VALUE +c_playlist_set_next (VALUE self, VALUE pos) +{ + METHOD_ADD_HANDLER_INT (playlist_set_next, pos); +}+
Sets the next song to be played based on the current position where +pos is a value relative to the current position.
+ + + + +static VALUE +c_playlist_set_next_rel (VALUE self, VALUE pos) +{ + METHOD_ADD_HANDLER_INT (playlist_set_next_rel, pos); +}+
Retrieves an array containing a hash of information for each plugin.
+ + + + +static VALUE +c_plugin_list (int argc, VALUE *argv, VALUE self) +{ + VALUE type = Qnil; + + rb_scan_args (argc, argv, "01", &type); + + if (NIL_P (type)) + type = INT2FIX (XMMS_PLUGIN_TYPE_ALL); + + METHOD_ADD_HANDLER_INT (main_list_plugins, type); +}+
Shuts down the XMMS2 daemon.
+ + + + +static VALUE +c_quit (VALUE self) +{ + METHOD_ADD_HANDLER (quit); +}+
Requests the number of unindexed entries in the medialib.
+ + + + +static VALUE +c_signal_mediainfo_reader_unindexed (VALUE self) +{ + METHOD_ADD_HANDLER (signal_mediainfo_reader_unindexed); +}+
Retrieves the playtime as a signal.
+ + + + +static VALUE +c_signal_playback_playtime (VALUE self) +{ + METHOD_ADD_HANDLER (signal_playback_playtime); +}+
returns a list of files from the server
+ + + + +static VALUE +c_xform_media_browse (VALUE self, VALUE url) +{ + METHOD_ADD_HANDLER_STR (xform_media_browse, url); +}+
# File async.rb, line 22 +def initialize(name) + @real = Xmms::Client.new(name) +end+
# File async.rb, line 26 +def method_missing(id, *args, &block) + args.push(&block) if(id == 'on_disconnect') + ret = @real.send(id, *args) + if(block_given? && (ret.is_a?(Xmms::Result) || + ret.is_a?(Xmms::BroadcastResult) || ret.is_a?(Xmms::SignalResult))) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Client)) + self + elsif(ret.is_a?(Xmms::Collection)) + Xmms::Collection::Async.new(ret) + elsif(ret.is_a?(Xmms::Playlist)) + Xmms::Playlist::Async.new(ret) + else + ret + end +end+
# File sync.rb, line 22 +def initialize(name) + @real = Xmms::Client.new(name) +end+
# File sync.rb, line 26 +def method_missing(id, *args) + args.push(&block) if(id == 'on_disconnect') + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result) || ret.is_a?(Xmms::BroadcastResult) || + ret.is_a?(Xmms::SignalResult)) + ret.wait.value + elsif(ret.is_a?(Xmms::Client)) + self + elsif(ret.is_a?(Xmms::Collection)) + Xmms::Collection::Sync.new(ret) + elsif(ret.is_a?(Xmms::Playlist)) + Xmms::Playlist::Sync.new(ret) + else + ret + end +end+
Returns a new Xmms::Collection object of type +type.
+ + + + +static VALUE +c_coll_init (VALUE self, VALUE type) +{ + COLL_METHOD_HANDLER_HEADER + + coll->real = xmmsv_new_coll (check_int32 (type)); + + return self; +}+
Returns a collection matching a String pattern. See the wiki for +details on how to construct a pattern string.
+ + + + +static VALUE +c_coll_parse (VALUE klass, VALUE pattern) +{ + VALUE obj = rb_obj_alloc (klass); + RbCollection *coll = NULL; + + Data_Get_Struct (obj, RbCollection, coll); + + if (!xmmsv_coll_parse (StringValuePtr (pattern), &coll->real)) { + rb_raise (ePatternError, "invalid pattern"); + } + + return obj; +}+
Returns a collection referencing the “All Media” set.
+ + + + +static VALUE +c_coll_universe (VALUE klass) +{ + VALUE obj = rb_obj_alloc (klass); + RbCollection *coll = NULL; + + Data_Get_Struct (obj, RbCollection, coll); + + coll->real = xmmsv_new_coll (XMMS_COLLECTION_TYPE_UNIVERSE); + + return obj; +}+
Returns the attributes of the collection.
+ + + + +static VALUE +c_coll_attributes (VALUE self) +{ + RbCollection *coll = NULL; + + Data_Get_Struct (self, RbCollection, coll); + + if (NIL_P (coll->attributes)) + coll->attributes = rb_class_new_instance (1, &self, cAttributes); + + return coll->attributes; +}+
Returns a new collection that is the logical complement of c.
+ + + + +# File xmmsclient.rb, line 49 +def complement + c = Xmms::Collection.new(Xmms::Collection::TYPE_COMPLEMENT) + c.operands << self + c +end+
Gets the list of media ids that make up the collection.
+ + + + +static VALUE +c_coll_idlist_get (VALUE self) +{ + VALUE ary = rb_ary_new (); + xmmsv_t *ret = NULL; + xmmsv_list_iter_t *it = NULL; + int32_t entry; + + COLL_METHOD_ADD_HANDLER_RET (idlist_get) + + xmmsv_get_list_iter (ret, &it); + for (xmmsv_list_iter_first (it); + xmmsv_list_iter_valid (it); + xmmsv_list_iter_next (it)) { + + xmmsv_list_iter_entry_int (it, &entry); + rb_ary_push (ary, INT2NUM (entry)); + } + xmmsv_list_iter_explicit_destroy (it); + + return ary; +}+
Sets the list of media ids that make up the collection.
+ + + + +static VALUE +c_coll_idlist_set (VALUE self, VALUE ids) +{ + int i; + int *ary = NULL; + VALUE *rb_ary; + int rb_ary_len; + + Check_Type (ids, T_ARRAY); + COLL_METHOD_HANDLER_HEADER + + rb_ary = RARRAY_PTR (ids); + rb_ary_len = RARRAY_LEN (ids); + + ary = malloc (sizeof (int) * (rb_ary_len + 1)); + + for (i = 0; i < rb_ary_len; i++) + ary[i] = NUM2INT (rb_ary[i]); + + ary[i] = 0; + + xmmsv_coll_set_idlist (coll->real, ary); + + return self; +}+
Returns a new collection that is the logical AND of c and +other.
+ + + + +# File xmmsclient.rb, line 37 +def intersect(other) + c = Xmms::Collection.new(Xmms::Collection::TYPE_INTERSECTION) + c.operands << self + c.operands << other + c +end+
Gets a list of the operands that make up the collection.
+ + + + +static VALUE +c_coll_operands (VALUE self) +{ + RbCollection *coll = NULL; + + Data_Get_Struct (self, RbCollection, coll); + + if (NIL_P (coll->operands)) + coll->operands = rb_class_new_instance (1, &self, cOperands); + + return coll->operands; +}+
Returns the type of the collection as an Integer.
+ + + + +static VALUE +c_coll_type_get (VALUE self) +{ + xmmsc_coll_type_t ret; + + COLL_METHOD_ADD_HANDLER_RET (get_type) + + return INT2NUM (ret); +}+
Returns a new collection that is the logical OR of c and +other.
+ + + + +# File xmmsclient.rb, line 25 +def union(other) + c = Xmms::Collection.new(Xmms::Collection::TYPE_UNION) + c.operands << self + c.operands << other + c +end+
# File async.rb, line 47 +def initialize(coll) + @real = coll +end+
# File async.rb, line 51 +def method_missing(id, *args, &block) + ret = @real.send(id, *args) + if(block_given? && ret.is_a?(Xmms::Result)) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
static VALUE +c_attrs_init (VALUE self, VALUE collection) +{ + rb_iv_set (self, "collection", collection); + + return self; +}+
HAVE_RB_PROTECT_INSPECT
+ + + + +static VALUE +c_attrs_aref (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + int s; + const char *value; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + s = xmmsv_coll_attribute_get_string (coll->real, StringValuePtr (key), &value); + if (!s) + return Qnil; + + return rb_str_new2 (value); +}+
static VALUE +c_attrs_aset (VALUE self, VALUE key, VALUE value) +{ + RbCollection *coll = NULL; + VALUE tmp; + + StringValue (key); + StringValue (value); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + xmmsv_coll_attribute_set_string (coll->real, StringValuePtr (key), + StringValuePtr (value)); + + return Qnil; +}+
static VALUE +c_attrs_delete (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + xmmsv_coll_attribute_remove (coll->real, StringValuePtr (key)); + + return Qnil; +}+
static VALUE +c_attrs_each (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_PAIR)); + + return self; +}+
static VALUE +c_attrs_each_key (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_KEY)); + + return self; +}+
static VALUE +c_attrs_each_value (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_VALUE)); + + return self; +}+
static VALUE +c_attrs_has_key (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + int s; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + s = xmmsv_coll_attribute_get_string (coll->real, StringValuePtr (key), NULL); + + return s ? Qtrue : Qfalse; +}+
static VALUE +c_attrs_inspect (VALUE self) +{ + return rb_protect_inspect (attrs_inspect, self, 0); +}+
static VALUE +c_operands_init (VALUE self, VALUE collection) +{ + rb_iv_set (self, "collection", collection); + + return self; +}+
static VALUE +c_operands_delete (VALUE self, VALUE arg) +{ + RbCollection *coll = NULL, *coll2 = NULL; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + Data_Get_Struct (arg, RbCollection, coll2); + + xmmsv_coll_remove_operand (coll->real, coll2->real); + + return Qnil; +}+
static VALUE +c_operands_each (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *operands_list; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + operands_list = xmmsv_coll_operands_get (coll->real); + + xmmsv_list_foreach (operands_list, operands_each, NULL); + + return self; +}+
static VALUE +c_operands_push (VALUE self, VALUE arg) +{ + RbCollection *coll = NULL, *coll2 = NULL; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + Data_Get_Struct (arg, RbCollection, coll2); + + xmmsv_coll_add_operand (coll->real, coll2->real); + + return self; +}+
# File sync.rb, line 48 +def initialize(coll) + @real = coll +end+
# File sync.rb, line 52 +def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
static VALUE +c_dict_aref (VALUE self, VALUE key) +{ + RbDict *dict = NULL; + xmmsv_dict_iter_t *it; + xmmsv_t *value; + const char *ckey; + int s; + + Check_Type (key, T_SYMBOL); + + Data_Get_Struct (self, RbDict, dict); + + ckey = rb_id2name (SYM2ID (key)); + + xmmsv_get_dict_iter (dict->real, &it); + + s = xmmsv_dict_iter_find (it, ckey); + if (!s) + return Qnil; + + xmmsv_dict_iter_pair (it, NULL, &value); + + return extract_value (self, value); +}+
static VALUE +c_dict_each (VALUE self) +{ + RbDict *dict = NULL; + + Data_Get_Struct (self, RbDict, dict); + + xmmsv_dict_foreach (dict->real, dict_each_pair, &self); + + return self; +}+
static VALUE +c_dict_each_key (VALUE self) +{ + RbDict *dict = NULL; + + Data_Get_Struct (self, RbDict, dict); + + xmmsv_dict_foreach (dict->real, dict_each_key, NULL); + + return self; +}+
static VALUE +c_dict_each_value (VALUE self) +{ + RbDict *dict = NULL; + + Data_Get_Struct (self, RbDict, dict); + + xmmsv_dict_foreach (dict->real, dict_each_value, &self); + + return self; +}+
static VALUE +c_dict_empty (VALUE self) +{ + RbDict *dict = NULL; + int size; + + Data_Get_Struct (self, RbDict, dict); + + size = xmmsv_dict_get_size (dict->real); + + return size == 0 ? Qtrue : Qfalse; +}+
static VALUE +c_dict_has_key (VALUE self, VALUE key) +{ + RbDict *dict = NULL; + xmmsv_dict_iter_t *it; + const char *ckey; + + Check_Type (key, T_SYMBOL); + + Data_Get_Struct (self, RbDict, dict); + + ckey = rb_id2name (SYM2ID (key)); + + xmmsv_get_dict_iter (dict->real, &it); + + return xmmsv_dict_iter_find (it, ckey) ? Qtrue : Qfalse; +}+
static VALUE +c_dict_inspect (VALUE self) +{ + return rb_protect_inspect (dict_inspect, self, 0); +}+
static VALUE +c_dict_size (VALUE self) +{ + RbDict *dict = NULL; + int size; + + Data_Get_Struct (self, RbDict, dict); + + size = xmmsv_dict_get_size (dict->real); + + return INT2NUM (size); +}+
Initializes a new Xmms::Playlist using the +playlist named name and the Xmms::Client +instance xc. Xmms::Client#playlist is a useful +shortcut. name is is the name of the playlist and the active +playlist will be used if it is not specified. Raises PlaylistError if the playlist name +is invalid.
+ + + + +static VALUE +c_init (int argc, VALUE *argv, VALUE self) +{ + RbPlaylist *pl = NULL; + VALUE name, xmms = Qnil; + + Data_Get_Struct (self, RbPlaylist, pl); + + rb_scan_args (argc, argv, "11", &xmms, &name); + + /* FIXME: Check type! */ + pl->xmms = xmms; + + if (NIL_P (name)) + pl->name_value = rb_str_new2 (XMMS_ACTIVE_PLAYLIST); + else + pl->name_value = rb_str_dup (name); + + OBJ_FREEZE (pl->name_value); + + pl->name = StringValuePtr (pl->name_value); + + return self; +}+
Adds the collection coll to the playlist.
+ + + + +static VALUE +c_add_collection (int argc, VALUE *argv, VALUE self) +{ + PLAYLIST_METHOD_HANDLER_HEADER + + VALUE rbcoll, order = Qnil; + xmmsv_t *corder = NULL; + xmmsc_coll_t *coll; + + rb_scan_args (argc, argv, "11", &rbcoll, &order); + + coll = FROM_XMMS_CLIENT_COLLECTION (rbcoll); + + if (!NIL_P (order)) + corder = parse_string_array2 (order); + + res = xmmsc_playlist_add_collection (xmms->real, pl->name, + coll, corder); + + if (corder) + xmmsv_unref (corder); + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
Adds an entry to the playlist. arg can be either a URL or an id.
+ + + + +static VALUE +c_add_entry (VALUE self, VALUE arg) +{ + int32_t id; + + PLAYLIST_METHOD_HANDLER_HEADER + + if (!NIL_P (rb_check_string_type (arg))) + res = xmmsc_playlist_add_url (xmms->real, pl->name, + StringValuePtr (arg)); + else { + id = check_int32 (arg); + res = xmmsc_playlist_add_id (xmms->real, pl->name, id); + } + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
Clears the playlist.
+ + + + +static VALUE +c_clear (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (clear) +}+
Retrieves the current position of the playlist. May raise an Xmms::Result::ValueError exception if the +current position is undefined.
+ + + + +static VALUE +c_current_pos (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (current_pos) +}+
Retrieves an array containing ids for each position of the playlist.
+ + + + +static VALUE +c_list_entries (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (list_entries) +}+
Inserts an entry to the current playlist at position pos in the +playlist. arg can be either a URL or an id.
+ + + + +static VALUE +c_insert_entry (VALUE self, VALUE pos, VALUE arg) +{ + int32_t id; + int32_t ipos; + + PLAYLIST_METHOD_HANDLER_HEADER + + ipos = check_int32 (pos); + + if (!NIL_P (rb_check_string_type (arg))) + res = xmmsc_playlist_insert_url (xmms->real, pl->name, + ipos, StringValuePtr (arg)); + else { + id = check_int32 (arg); + res = xmmsc_playlist_insert_id (xmms->real, pl->name, + ipos, id); + } + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
Loads the playlist as the current active playlist.
+ + + + +static VALUE +c_load (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (load); +}+
Moves the entry at current_pos to new_pos in the +playlist.
+ + + + +static VALUE +c_move_entry (VALUE self, VALUE cur_pos, VALUE new_pos) +{ + PLAYLIST_METHOD_ADD_HANDLER_INT_INT (move_entry, cur_pos, new_pos) +}+
Returns the name of the playlist in the medialib as a String.
+ + + + +static VALUE +c_name (VALUE self) +{ + RbPlaylist *pl = NULL; + + Data_Get_Struct (self, RbPlaylist, pl); + + return pl->name_value; +}+
Recursively imports all media files under path to the playlist.
+ + + + +static VALUE +c_radd (VALUE self, VALUE path) +{ + PLAYLIST_METHOD_ADD_HANDLER_STR (radd, path); +}+
Removes the playlist from the medialib.
+ + + + +static VALUE +c_remove (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (remove); +}+
Removes the entry at pos from the playlist.
+ + + + +static VALUE +c_remove_entry (VALUE self, VALUE pos) +{ + PLAYLIST_METHOD_ADD_HANDLER_INT (remove_entry, pos) +}+
Recursively imports all media files under path at position +pos in the playlist.
+ + + + +static VALUE +c_rinsert (VALUE self, VALUE pos, VALUE path) +{ + PLAYLIST_METHOD_ADD_HANDLER_INT_STR (rinsert, pos, path); +}+
Shuffles the playlist.
+ + + + +static VALUE +c_shuffle (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (shuffle) +}+
Sorts the playlist on properties, which is an array of medialib +properties such as [“title”, “artist”].
+ + + + +static VALUE +c_sort (VALUE self, VALUE props) +{ + xmmsv_t *cprops; + PLAYLIST_METHOD_HANDLER_HEADER + + cprops = parse_string_array2 (props); + res = xmmsc_playlist_sort (xmms->real, pl->name, cprops); + xmmsv_unref (cprops); + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
def method_missing(id, *args, &block) + ret = @real.send(id, *args) + if(block_given? && ret.is_a?(Xmms::Result)) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end ++ +
end
+ +# File async.rb, line 66 +def initialize(plist) + @real = plist +end+
# File async.rb, line 70 +def method_missing(id, *args, &block) + ret = @real.send(id, *args) + if(block_given? && ret.is_a?(Xmms::Result)) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end ++ +
end
+ +# File sync.rb, line 67 +def initialize(plist) + @real = plist +end+
# File sync.rb, line 71 +def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
Transforms a RawDict (key-source-value) to a +regular key-value dict. The optional src_prefs argument restricts which +sources are considered. The value may be a string or an array of strings, +which may contain wildcards. Example: rawdict.to_propdict( +['server','plugin/*'] )
+ + + + +static VALUE +c_raw_dict_to_propdict (int argc, VALUE *argv, VALUE self) +{ + VALUE value, sources = Qnil; + RbDict *dict = NULL, *dict2 = NULL; + xmmsv_t *inner_dict; + const char **csources = NULL; + + Data_Get_Struct (self, RbDict, dict); + + rb_scan_args (argc, argv, "01", &sources); + + if (!NIL_P (sources)) + csources = parse_string_array (sources); + inner_dict = xmmsv_propdict_to_dict (dict->real, csources); + if (csources) + free (csources); + + value = Data_Make_Struct (cDict, RbDict, + c_dict_mark, c_dict_free, + dict2); + + // don't add a second reference here + dict2->real = inner_dict; + dict2->parent = dict->parent; + + rb_obj_call_init (value, 0, NULL); + + return value; +}+
static VALUE +c_get_error (VALUE self) +{ + RbResult *res; + xmmsv_t *val; + const char *error; + int ret; + + Data_Get_Struct (self, RbResult, res); + + val = xmmsc_result_get_value (res->real); + + ret = xmmsv_get_error (val, &error); + + return rb_str_new2 (ret ? error : ""); +}+
static VALUE +c_is_error (VALUE self) +{ + RbResult *res; + + Data_Get_Struct (self, RbResult, res); + + return xmmsc_result_iserror (res->real) ? Qtrue : Qfalse; +}+
Sets the block that's executed when res is handled. Used by +asyncronous results only.
+ + + + +static VALUE +c_notifier_set (VALUE self) +{ + VALUE callback; + RbResult *res = NULL; + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbResult, res); + + if (!rb_block_given_p ()) + return Qnil; + + callback = rb_block_proc (); + + Data_Get_Struct (res->xmms, RbXmmsClient, xmms); + rb_ary_push (xmms->result_callbacks, callback); + + xmmsc_result_notifier_set (res->real, on_signal, (void *) callback); + + return Qnil; +}+
static VALUE +c_value_get (VALUE self) +{ + RbResult *res = NULL; + xmmsv_t *val; + + Data_Get_Struct (self, RbResult, res); + + val = xmmsc_result_get_value (res->real); + + return extract_value (self, val); +}+
Waits for res to be handled.
+ + + + +static VALUE +c_wait (VALUE self) +{ + RbResult *res = NULL; + + Data_Get_Struct (self, RbResult, res); + + xmmsc_result_wait (res->real); + + return self; +}+
static VALUE +c_disconnect (VALUE self) +{ + RbResult *res = NULL; + + Data_Get_Struct (self, RbResult, res); + + xmmsc_result_disconnect (res->real); + + return self; +}+
# File sync.rb, line 48 +def initialize(coll) + @real = coll +end+
# File sync.rb, line 52 +def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
# File sync.rb, line 67 +def initialize(plist) + @real = plist +end+
# File sync.rb, line 71 +def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
+
+
+
|
+
+
+
|
+
VERSION | += | +rb_str_new2 (XMMS_VERSION) | +
+ | + |
Decodes a url-encoded string url and returns it in UNKNOWN +ENCODING. Use with caution.
++ Source: + show + +
+static VALUE +m_decode_url (VALUE self, VALUE str) +{ + const unsigned char *burl; + unsigned int blen; + xmmsv_t *strv, *decoded; + VALUE url = Qnil; + + strv = xmmsv_new_string (StringValuePtr (str)); + + decoded = xmmsv_decode_url (strv); + + if (!decoded) + goto out; + + if (!xmmsv_get_bin (decoded, &burl, &blen)) + goto out; + + url = rb_str_new ((char *) burl, blen); + +out: + if (decoded) + xmmsv_unref (decoded); + + xmmsv_unref (strv); + + return url; +}+
Returns the xmms2 configuration directory for the current user.
++ Source: + show + +
+static VALUE +m_userconfdir_get (VALUE self) +{ + const char *p; + char path[XMMS_PATH_MAX]; + + p = xmmsc_userconfdir_get (path, XMMS_PATH_MAX); + + return p ? rb_str_new2 (p) : Qnil; +}+
Creates an Xmms::Client object.
++ Source: + show + +
+static VALUE +c_init (VALUE self, VALUE name) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + if (!(xmms->real = xmmsc_init (StringValuePtr (name)))) { + rb_raise (rb_eNoMemError, "failed to allocate memory"); + return Qnil; + } + + xmms->deleted = false; + xmms->result_callbacks = rb_ary_new (); + xmms->disconnect_cb = Qnil; + xmms->io_need_out_cb = Qnil; + + return self; +}+
Stores binary data on the server.
++ Source: + show + +
+static VALUE +c_bindata_add (VALUE self, VALUE data) +{ + METHOD_ADD_HANDLER_BIN (bindata_add, data); +}+
List all bindata hashes stored on the server.
++ Source: + show + +
+static VALUE +c_bindata_list (VALUE self) +{ + METHOD_ADD_HANDLER (bindata_list); +}+
Remove a datafile from the server.
++ Source: + show + +
+static VALUE +c_bindata_remove (VALUE self, VALUE hash) +{ + METHOD_ADD_HANDLER_STR (bindata_remove, hash); +}+
Retrieves the bindata entry specified by hash (hex string) from the server.
++ Source: + show + +
+static VALUE +c_bindata_retrieve (VALUE self, VALUE hash) +{ + METHOD_ADD_HANDLER_STR (bindata_retrieve, hash); +}+
The collection_changed broadcast, if requested, is called anytime a +collection is altered.
++ Source: + show + +
+static VALUE +c_broadcast_coll_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_collection_changed) +}+
Retrieves configuration properties as a broadcast.
++ Source: + show + +
+static VALUE +c_broadcast_config_value_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_config_value_changed); +}+
Requests the status of the mediainfo reader.
++ Source: + show + +
+static VALUE +c_broadcast_mediainfo_reader_status (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_mediainfo_reader_status); +}+
Retrieves the id of an added medialib entry as a broadcast.
++ Source: + show + +
+static VALUE +c_broadcast_medialib_entry_added (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_medialib_entry_added); +}+
Retrieves the id of a changed medialib entry as a broadcast.
++ Source: + show + +
+static VALUE +c_broadcast_medialib_entry_changed (VALUE self) +{ + RB_XMMS_DEPRECATED (broadcast_medialib_entry_changed, broadcast_medialib_entry_updated); + METHOD_ADD_HANDLER (broadcast_medialib_entry_updated); +}+
Retrieves the id of an removed medialib entry as a broadcast.
++ Source: + show + +
+static VALUE +c_broadcast_medialib_entry_removed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_medialib_entry_removed); +}+
Retrieves the id of a changed medialib entry as a broadcast.
++ Source: + show + +
+static VALUE +c_broadcast_medialib_entry_updated (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_medialib_entry_updated); +}+
Retrieves the media id of the currently played track as a broadcast.
++ Source: + show + +
+static VALUE +c_broadcast_playback_current_id (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playback_current_id); +}+
Retrieves the playback status as a broadcast.
++ Source: + show + +
+static VALUE +c_broadcast_playback_status (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playback_status); +}+
Registers a broadcast handler that's evoked when the playback volume +changes.
++ Source: + show + +
+static VALUE +c_broadcast_playback_volume_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playback_volume_changed); +}+
Retrieves a hash describing the change to the playlist as a broadcast.
++ Source: + show + +
+static VALUE +c_broadcast_playlist_changed (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playlist_changed); +}+
Retrieves the current playlist position as a broadcast. See +playlist_current_pos.
++ Source: + show + +
+static VALUE +c_broadcast_playlist_current_pos (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playlist_current_pos); +}+
Will be called when a playlist has been loaded.
++ Source: + show + +
+static VALUE +c_broadcast_playlist_loaded (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_playlist_loaded); +}+
Will be called when the server is terminating.
++ Source: + show + +
+static VALUE +c_broadcast_quit (VALUE self) +{ + METHOD_ADD_HANDLER (broadcast_quit); +}+
Find all collections in the given namespace ns which contain +id.
++ Source: + show + +
+static VALUE +c_coll_find (VALUE self, VALUE id, VALUE ns) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_coll_find (xmms->real, check_int32 (id), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Returns a result containing an Xmms::Collection object referencing the +collection named name. The namespace ns is searched or +all namespaces if unspecified.
++ Source: + show + +
+static VALUE +c_coll_get (int argc, VALUE *argv, VALUE self) +{ + VALUE name, ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "11", &name, &ns); + + if (NIL_P (ns)) + res = xmmsc_coll_get (xmms->real, StringValuePtr (name), + XMMS_COLLECTION_NS_ALL); + else + res = xmmsc_coll_get (xmms->real, StringValuePtr (name), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Returns a collection of the idlist type from the playlist file at +path. path must be an unencoded string.
++ Source: + show + +
+static VALUE +c_coll_idlist_from_playlist_file (VALUE self, VALUE path) +{ + METHOD_ADD_HANDLER_STR (coll_idlist_from_playlist_file, path) +}+
Retrieves an array of the names of all the collections stored in the +medialib under the namespace ns. If ns is not specified, +it defaults to ALL.
++ Source: + show + +
+static VALUE +c_coll_list (int argc, VALUE *argv, VALUE self) +{ + VALUE ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "01", &ns); + + if (NIL_P (ns)) + ns = rb_str_new2 (XMMS_COLLECTION_NS_ALL); + + res = xmmsc_coll_list (xmms->real, StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
+ Source: + show + +
+static VALUE +c_coll_query (int argc, VALUE *argv, VALUE self) +{ + VALUE coll, spec; + xmmsv_t *cspec; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "2", &coll, &spec); + + cspec = xmmsv_new_dict (); + + VALUE args = rb_ary_new3(4, xmms, coll, spec, (VALUE) cspec); + + res = (xmmsc_result_t *) rb_ensure (c_coll_query_fragile, args, + c_coll_query_cleanup, (VALUE) cspec); + + METHOD_HANDLER_FOOTER +}+
Retrieves a list of all the ids of media matched by the collection. +order specifies a list of properties to order by or no order if +omitted. start and len determine the offset at which to +start retrieving ids and the maximum number of ids to retrieve, +respectively.
++ Source: + show + +
+static VALUE +c_coll_query_ids (int argc, VALUE *argv, VALUE self) +{ + VALUE coll, order = Qnil, start, len = Qnil; + xmmsv_t *corder = NULL; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "13", &coll, &order, &start, &len); + + if (!NIL_P (order)) + corder = parse_string_array2 (order); + + res = xmmsc_coll_query_ids (xmms->real, + FROM_XMMS_CLIENT_COLLECTION (coll), + corder, + NIL_P (start) ? 0 : NUM2INT (start), + NIL_P (start) ? 0 : NUM2INT (len)); + + if (corder) + xmmsv_unref (corder); + + METHOD_HANDLER_FOOTER +}+
Retrieves media info of media matched by the collection. fetch +should contain an array of properties to retrieve from the collection. +order specifies a list of properties to order by or no order if +omitted. start and len determine the offset at which to +start retrieving info and the maximum number of ids to retrieve, +respectively. group defines a list of properties to group by or no +grouping if omitted.
++ Source: + show + +
+static VALUE +c_coll_query_info (int argc, VALUE *argv, VALUE self) +{ + VALUE coll, order = Qnil, start, len, fetch, group = Qnil; + xmmsv_t *cfetch = NULL, *corder = NULL, *cgroup = NULL; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "24", &coll, &fetch, &order, &start, &len, + &group); + + cfetch = parse_string_array2 (fetch); + + if (!NIL_P (order)) + corder = parse_string_array2 (order); + + if (!NIL_P (group)) + cgroup = parse_string_array2 (group); + + res = xmmsc_coll_query_infos (xmms->real, + FROM_XMMS_CLIENT_COLLECTION (coll), + corder, + NIL_P (start) ? 0 : NUM2INT (start), + NIL_P (start) ? 0 : NUM2INT (len), + cfetch, + cgroup); + xmmsv_unref (cfetch); + if (corder) { + xmmsv_unref (corder); + } + if (cgroup) { + xmmsv_unref (cgroup); + } + + METHOD_HANDLER_FOOTER +}+
Remove the collection named name from the media library. The +collection is removed from the namespace ns or all namespaces if +unspecified.
++ Source: + show + +
+static VALUE +c_coll_remove (int argc, VALUE *argv, VALUE self) +{ + VALUE name, ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "11", &name, &ns); + + if (NIL_P (ns)) + res = xmmsc_coll_remove (xmms->real, StringValuePtr (name), + XMMS_COLLECTION_NS_ALL); + else + res = xmmsc_coll_remove (xmms->real, StringValuePtr (name), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Rename the saved collection from old to new within the +namespace ns or all namespaces.
++ Source: + show + +
+static VALUE +c_coll_rename (int argc, VALUE *argv, VALUE self) +{ + VALUE old, new, ns = Qnil; + METHOD_HANDLER_HEADER + + rb_scan_args (argc, argv, "21", &old, &new, &ns); + + if (NIL_P (ns)) + res = xmmsc_coll_rename (xmms->real, + StringValuePtr (old), + StringValuePtr (new), + XMMS_COLLECTION_NS_ALL); + else + res = xmmsc_coll_rename (xmms->real, + StringValuePtr (old), + StringValuePtr (new), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Save the collection coll named name under the namespace +ns to the media library.
++ Source: + show + +
+static VALUE +c_coll_save (VALUE self, VALUE coll, VALUE name, VALUE ns) +{ + METHOD_HANDLER_HEADER + + /* FIXME: Check that we actually have a Collection object */ + + res = xmmsc_coll_save (xmms->real, + FROM_XMMS_CLIENT_COLLECTION (coll), + StringValuePtr (name), + StringValuePtr (ns)); + + METHOD_HANDLER_FOOTER +}+
Retrieves the value of the configuration property at key.
++ Source: + show + +
+static VALUE +c_config_get_value (VALUE self, VALUE key) +{ + METHOD_ADD_HANDLER_STR (config_get_value, key); +}+
Retrieves a list of all config values.
++ Source: + show + +
+static VALUE +c_config_list_values (VALUE self) +{ + METHOD_ADD_HANDLER (config_list_values); +}+
Registers a configuration property at key with the given default +value.
++ Source: + show + +
+static VALUE +c_config_register_value (VALUE self, VALUE key, VALUE defval) +{ + METHOD_ADD_HANDLER_STR_STR (config_register_value, key, defval); +}+
Sets the value of the configuration property at key to +value.
++ Source: + show + +
+static VALUE +c_config_set_value (VALUE self, VALUE key, VALUE val) +{ + METHOD_ADD_HANDLER_STR_STR (config_set_value, key, val); +}+
Connects xc to the XMMS2 daemon listening at path. If +path isn't given, the default path is used.
++ Source: + show + +
+static VALUE +c_connect (int argc, VALUE *argv, VALUE self) +{ + VALUE path; + RbXmmsClient *xmms = NULL; + char *p = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + rb_scan_args (argc, argv, "01", &path); + + if (!NIL_P (path)) + p = StringValuePtr (path); + + if (!xmmsc_connect (xmms->real, p)) + rb_raise (eClientError, + "cannot connect to daemon (%s)", + xmmsc_get_last_error (xmms->real)); + + return self; +}+
+ Source: + show + +
+static VALUE +c_delete (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_unref (xmms->real); + xmms->deleted = true; + + return Qnil; +}+
Disconnects the IPC socket. This should only be used by event loop +implementations.
++ Source: + show + +
+static VALUE +c_io_disconnect (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_io_disconnect (xmms->real); + + return Qnil; +}+
Returns the file descriptor of the Xmms::Client +IPC socket.
++ Source: + show + +
+static VALUE +c_io_fd (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + return INT2NUM (xmmsc_io_fd_get (xmms->real)); +}+
Retrieves one incoming (from server) clientlib command if there are any in +the buffer.
++ Source: + show + +
+static VALUE +c_io_in_handle (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_io_in_handle (xmms->real); + + return Qnil; +}+
Sets the block that's called when the output socket state changes.
++ Source: + show + +
+static VALUE +c_io_on_need_out (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + if (!rb_block_given_p ()) + return Qnil; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmms->io_need_out_cb = rb_block_proc (); + + xmmsc_io_need_out_callback_set (xmms->real, + on_io_need_out, (void *) self); + + return Qnil; +}+
Sends one outgoing (to server) clientlib command. You should check io_want_out before calling this +method.
++ Source: + show + +
+static VALUE +c_io_out_handle (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmmsc_io_out_handle (xmms->real); + + return Qnil; +}+
Returns true
if an outgoing (to server) clientlib command is
+pending, false
otherwise.
+ Source: + show + +
+static VALUE +c_io_want_out (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + return xmmsc_io_want_out (xmms->real) ? Qtrue : Qfalse; +}+
Returns the last error that occured in xc or nil
, if
+no error occured yet.
+ Source: + show + +
+static VALUE +c_last_error_get (VALUE self) +{ + RbXmmsClient *xmms = NULL; + const char *s; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + s = xmmsc_get_last_error (xmms->real); + + return s ? rb_str_new2 (s) : Qnil; +}+
Retrieves a hash containing statistics about the daemon.
++ Source: + show + +
+static VALUE +c_main_stats (VALUE self) +{ + METHOD_ADD_HANDLER (main_stats); +}+
Adds url to the medialib.
++ Source: + show + +
+static VALUE +c_medialib_add_entry (VALUE self, VALUE url) +{ + METHOD_ADD_HANDLER_STR (medialib_add_entry, url); +}+
Moves the entry specified by id to a new URL without changing +mediainfo.
++ Source: + show + +
+static VALUE +c_medialib_entry_move (VALUE self, VALUE id, VALUE url) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_medialib_move_entry (xmms->real, check_int32 (id), + StringValuePtr (url)); + + METHOD_HANDLER_FOOTER +}+
Remove a custom field in the medialib associated with the entry +id. source is an optional argument that describes where +to write the mediainfo. If source is omitted, +“client/<yourclient>” is used, where <yourclient> is the name +you specified in ::new.
++ Source: + show + +
+static VALUE +c_medialib_entry_property_remove (int argc, VALUE *argv, VALUE self) +{ + VALUE tmp, key, src = Qnil; + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + const char *ckey; + int32_t id; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + rb_scan_args (argc, argv, "21", &tmp, &key, &src); + + id = check_int32 (tmp); + Check_Type (key, T_SYMBOL); + + ckey = rb_id2name (SYM2ID (key)); + + if (NIL_P (src)) + res = xmmsc_medialib_entry_property_remove (xmms->real, id, + ckey); + else + res = xmmsc_medialib_entry_property_remove_with_source ( + xmms->real, id, + StringValuePtr (src), + ckey); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Write info to the medialib at id. source is an optional +argument that describes where to write the mediainfo. If source is +omitted, the mediainfo is written to “client/<yourclient>” where +<yourclient> is the name you specified in ::new.
++ Source: + show + +
+static VALUE +c_medialib_entry_property_set (int argc, VALUE *argv, VALUE self) +{ + VALUE tmp, key, value, src = Qnil; + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + const char *ckey; + bool is_str = false; + int32_t id, ivalue; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + rb_scan_args (argc, argv, "31", &tmp, &key, &value, &src); + + id = check_int32 (tmp); + Check_Type (key, T_SYMBOL); + + if (!NIL_P (rb_check_string_type (value))) + is_str = true; + else + ivalue = check_int32 (value); + + ckey = rb_id2name (SYM2ID (key)); + + if (NIL_P (src) && is_str) + res = xmmsc_medialib_entry_property_set_str (xmms->real, id, + ckey, + StringValuePtr (value)); + else if (NIL_P (src)) + res = xmmsc_medialib_entry_property_set_int (xmms->real, id, + ckey, ivalue); + else if (is_str) + res = xmmsc_medialib_entry_property_set_str_with_source ( + xmms->real, id, + StringValuePtr (src), + ckey, + StringValuePtr (value)); + else + res = xmmsc_medialib_entry_property_set_int_with_source ( + xmms->real, id, + StringValuePtr (src), + ckey, ivalue); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Removes the entry specified by id from the medialib.
++ Source: + show + +
+static VALUE +c_medialib_entry_remove (VALUE self, VALUE id) +{ + METHOD_ADD_HANDLER_INT (medialib_remove_entry, id) +}+
Retrieves the id corresponding to url.
++ Source: + show + +
+static VALUE +c_medialib_get_id (VALUE self, VALUE url) +{ + METHOD_ADD_HANDLER_STR (medialib_get_id, url); +}+
Retrieves medialib info for id.
++ Source: + show + +
+static VALUE +c_medialib_get_info (VALUE self, VALUE id) +{ + METHOD_ADD_HANDLER_INT (medialib_get_info, id); +}+
Recursively imports all media files under path to the medialib.
++ Source: + show + +
+static VALUE +c_medialib_path_import (VALUE self, VALUE path) +{ + METHOD_ADD_HANDLER_STR (medialib_import_path, path); +}+
Recursively imports all media files under the url encoded path to +the medialib.
++ Source: + show + +
+static VALUE +c_medialib_path_import_encoded (VALUE self, VALUE path) +{ + METHOD_ADD_HANDLER_STR (medialib_import_path_encoded, path); +}+
Rehashes the medialib entry at id or the whole medialib if +id == 0.
++ Source: + show + +
+static VALUE +c_medialib_rehash (VALUE self, VALUE id) +{ + METHOD_ADD_HANDLER_INT (medialib_rehash, id); +}+
Sets the block that's executed when xc is disconnected from +the XMMS2 daemon.
++ Source: + show + +
+static VALUE +c_on_disconnect (VALUE self) +{ + RbXmmsClient *xmms = NULL; + + if (!rb_block_given_p ()) + return Qnil; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + xmms->disconnect_cb = rb_block_proc (); + + xmmsc_disconnect_callback_set (xmms->real, + on_disconnect, (void *) self); + + return self; +}+
Retrieves the media id of the currently played track.
++ Source: + show + +
+static VALUE +c_playback_current_id (VALUE self) +{ + METHOD_ADD_HANDLER (playback_current_id); +}+
Pauses playback.
++ Source: + show + +
+static VALUE +c_playback_pause (VALUE self) +{ + METHOD_ADD_HANDLER (playback_pause); +}+
Retrieves the playtime.
++ Source: + show + +
+static VALUE +c_playback_playtime (VALUE self) +{ + METHOD_ADD_HANDLER (playback_playtime); +}+
Seek to the song position given in ms.
++ Source: + show + +
+static VALUE +c_playback_seek_ms (VALUE self, VALUE ms) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_ms (xmms->real, + check_int32 (ms), + XMMS_PLAYBACK_SEEK_SET); + + METHOD_HANDLER_FOOTER +}+
Seek in the song by the offset given in ms.
++ Source: + show + +
+static VALUE +c_playback_seek_ms_rel (VALUE self, VALUE ms) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_ms (xmms->real, + check_int32 (ms), + XMMS_PLAYBACK_SEEK_CUR); + + METHOD_HANDLER_FOOTER +}+
Seek to the song position given in samples.
++ Source: + show + +
+static VALUE +c_playback_seek_samples (VALUE self, VALUE samples) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_samples (xmms->real, + check_int32 (samples), + XMMS_PLAYBACK_SEEK_SET); + + METHOD_HANDLER_FOOTER +}+
Seek in the song position by the offset given in samples.
++ Source: + show + +
+static VALUE +c_playback_seek_samples_rel (VALUE self, VALUE samples) +{ + METHOD_HANDLER_HEADER + + res = xmmsc_playback_seek_samples (xmms->real, + check_int32 (samples), + XMMS_PLAYBACK_SEEK_CUR); + + METHOD_HANDLER_FOOTER +}+
Starts playback.
++ Source: + show + +
+static VALUE +c_playback_start (VALUE self) +{ + METHOD_ADD_HANDLER (playback_start); +}+
Retrieves the playback status.
++ Source: + show + +
+static VALUE +c_playback_status (VALUE self) +{ + METHOD_ADD_HANDLER (playback_status); +}+
Stops playback.
++ Source: + show + +
+static VALUE +c_playback_stop (VALUE self) +{ + METHOD_ADD_HANDLER (playback_stop); +}+
Advances to the next playlist entry.
++ Source: + show + +
+static VALUE +c_playback_tickle (VALUE self) +{ + METHOD_ADD_HANDLER (playback_tickle); +}+
Gets the current playback volume.
++ Source: + show + +
+static VALUE +c_playback_volume_get (VALUE self) +{ + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + res = xmmsc_playback_volume_get (xmms->real); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Sets playback volume for channel to volume.
++ Source: + show + +
+static VALUE +c_playback_volume_set (VALUE self, VALUE channel, VALUE volume) +{ + RbXmmsClient *xmms = NULL; + xmmsc_result_t *res; + + Data_Get_Struct (self, RbXmmsClient, xmms); + + CHECK_DELETED (xmms); + + Check_Type (channel, T_SYMBOL); + Check_Type (volume, T_FIXNUM); + + res = xmmsc_playback_volume_set (xmms->real, + rb_id2name (SYM2ID (channel)), + NUM2INT (volume)); + + return TO_XMMS_CLIENT_RESULT (self, res); +}+
Shortcut for Xmms::Playlist.new. +Creates a new Xmms::Playlist object tied to the +current Xmms::Client instance. name is +is the name of the playlist and the active playlist will be used if it is +not specified. Raises PlaylistError if the playlist name is invalid.
++ Source: + show + +
+static VALUE +c_playlist (int argc, VALUE *argv, VALUE self) +{ + VALUE args[2] = {self, Qnil}; + + rb_scan_args (argc, argv, "01", &args[1]); + + return rb_class_new_instance (2, args, cPlaylist); +}+
Retrieves the name of the active playlist.
++ Source: + show + +
+static VALUE +c_playlist_current_active (VALUE self) +{ + METHOD_ADD_HANDLER (playlist_current_active); +}+
Retrieves a list of all saved playlists from the medialib. Note that +clients should treat internally used playlists (marked with a leading +underscore) carefully.
++ Source: + show + +
+static VALUE +c_playlist_list (VALUE self) +{ + METHOD_ADD_HANDLER (playlist_list); +}+
Sets the next song to be played to pos (an absolute position).
++ Source: + show + +
+static VALUE +c_playlist_set_next (VALUE self, VALUE pos) +{ + METHOD_ADD_HANDLER_INT (playlist_set_next, pos); +}+
Sets the next song to be played based on the current position where +pos is a value relative to the current position.
++ Source: + show + +
+static VALUE +c_playlist_set_next_rel (VALUE self, VALUE pos) +{ + METHOD_ADD_HANDLER_INT (playlist_set_next_rel, pos); +}+
Retrieves an array containing a hash of information for each plugin.
++ Source: + show + +
+static VALUE +c_plugin_list (int argc, VALUE *argv, VALUE self) +{ + VALUE type = Qnil; + + rb_scan_args (argc, argv, "01", &type); + + if (NIL_P (type)) + type = INT2FIX (XMMS_PLUGIN_TYPE_ALL); + + METHOD_ADD_HANDLER_INT (main_list_plugins, type); +}+
Shuts down the XMMS2 daemon.
++ Source: + show + +
+static VALUE +c_quit (VALUE self) +{ + METHOD_ADD_HANDLER (quit); +}+
Requests the number of unindexed entries in the medialib.
++ Source: + show + +
+static VALUE +c_signal_mediainfo_reader_unindexed (VALUE self) +{ + METHOD_ADD_HANDLER (signal_mediainfo_reader_unindexed); +}+
+ [R] + | +real | ++ |
+ Source: + show + +
+# File async.rb, line 22 +def initialize(name) + @real = Xmms::Client.new(name) +end+
+ Source: + show + +
+# File async.rb, line 26 +def method_missing(id, *args, &block) + args.push(&block) if(id == 'on_disconnect') + ret = @real.send(id, *args) + if(block_given? && (ret.is_a?(Xmms::Result) || + ret.is_a?(Xmms::BroadcastResult) || ret.is_a?(Xmms::SignalResult))) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Client)) + self + elsif(ret.is_a?(Xmms::Collection)) + Xmms::Collection::Async.new(ret) + elsif(ret.is_a?(Xmms::Playlist)) + Xmms::Playlist::Async.new(ret) + else + ret + end +end+
+ [R] + | +real | ++ |
+ Source: + show + +
+# File sync.rb, line 22 +def initialize(name) + @real = Xmms::Client.new(name) +end+
+ Source: + show + +
+# File sync.rb, line 26 +def method_missing(id, *args) + args.push(&block) if(id == 'on_disconnect') + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result) || ret.is_a?(Xmms::BroadcastResult) || + ret.is_a?(Xmms::SignalResult)) + ret.wait.value + elsif(ret.is_a?(Xmms::Client)) + self + elsif(ret.is_a?(Xmms::Collection)) + Xmms::Collection::Sync.new(ret) + elsif(ret.is_a?(Xmms::Playlist)) + Xmms::Playlist::Sync.new(ret) + else + ret + end +end+
Returns a new Xmms::Collection object of type +type.
++ Source: + show + +
+static VALUE +c_coll_init (VALUE self, VALUE type) +{ + COLL_METHOD_HANDLER_HEADER + + coll->real = xmmsv_new_coll (check_int32 (type)); + + return self; +}+
Returns a collection matching a String pattern. See the wiki for +details on how to construct a pattern string.
++ Source: + show + +
+static VALUE +c_coll_parse (VALUE klass, VALUE pattern) +{ + VALUE obj = rb_obj_alloc (klass); + RbCollection *coll = NULL; + + Data_Get_Struct (obj, RbCollection, coll); + + if (!xmmsv_coll_parse (StringValuePtr (pattern), &coll->real)) { + rb_raise (ePatternError, "invalid pattern"); + } + + return obj; +}+
Returns a collection referencing the “All Media” set.
++ Source: + show + +
+static VALUE +c_coll_universe (VALUE klass) +{ + VALUE obj = rb_obj_alloc (klass); + RbCollection *coll = NULL; + + Data_Get_Struct (obj, RbCollection, coll); + + coll->real = xmmsv_new_coll (XMMS_COLLECTION_TYPE_UNIVERSE); + + return obj; +}+
Returns the attributes of the collection.
++ Source: + show + +
+static VALUE +c_coll_attributes (VALUE self) +{ + RbCollection *coll = NULL; + + Data_Get_Struct (self, RbCollection, coll); + + if (NIL_P (coll->attributes)) + coll->attributes = rb_class_new_instance (1, &self, cAttributes); + + return coll->attributes; +}+
Returns a new collection that is the logical complement of c.
++ Source: + show + +
+# File xmmsclient.rb, line 49 +def complement + c = Xmms::Collection.new(Xmms::Collection::TYPE_COMPLEMENT) + c.operands << self + c +end+
Gets the list of media ids that make up the collection.
++ Source: + show + +
+static VALUE +c_coll_idlist_get (VALUE self) +{ + VALUE ary = rb_ary_new (); + xmmsv_t *ret = NULL; + xmmsv_list_iter_t *it = NULL; + int32_t entry; + + COLL_METHOD_ADD_HANDLER_RET (idlist_get) + + xmmsv_get_list_iter (ret, &it); + for (xmmsv_list_iter_first (it); + xmmsv_list_iter_valid (it); + xmmsv_list_iter_next (it)) { + + xmmsv_list_iter_entry_int (it, &entry); + rb_ary_push (ary, INT2NUM (entry)); + } + xmmsv_list_iter_explicit_destroy (it); + + return ary; +}+
Sets the list of media ids that make up the collection.
++ Source: + show + +
+static VALUE +c_coll_idlist_set (VALUE self, VALUE ids) +{ + int i; + int *ary = NULL; + VALUE *rb_ary; + int rb_ary_len; + + Check_Type (ids, T_ARRAY); + COLL_METHOD_HANDLER_HEADER + + rb_ary = RARRAY_PTR (ids); + rb_ary_len = RARRAY_LEN (ids); + + ary = malloc (sizeof (int) * (rb_ary_len + 1)); + + for (i = 0; i < rb_ary_len; i++) + ary[i] = NUM2INT (rb_ary[i]); + + ary[i] = 0; + + xmmsv_coll_set_idlist (coll->real, ary); + + return self; +}+
Returns a new collection that is the logical AND of c and +other.
++ Source: + show + +
+# File xmmsclient.rb, line 37 +def intersect(other) + c = Xmms::Collection.new(Xmms::Collection::TYPE_INTERSECTION) + c.operands << self + c.operands << other + c +end+
Gets a list of the operands that make up the collection.
++ Source: + show + +
+static VALUE +c_coll_operands (VALUE self) +{ + RbCollection *coll = NULL; + + Data_Get_Struct (self, RbCollection, coll); + + if (NIL_P (coll->operands)) + coll->operands = rb_class_new_instance (1, &self, cOperands); + + return coll->operands; +}+
Returns the type of the collection as an Integer.
++ Source: + show + +
+static VALUE +c_coll_type_get (VALUE self) +{ + xmmsc_coll_type_t ret; + + COLL_METHOD_ADD_HANDLER_RET (get_type) + + return INT2NUM (ret); +}+
Returns a new collection that is the logical OR of c and +other.
++ Source: + show + +
+# File xmmsclient.rb, line 25 +def union(other) + c = Xmms::Collection.new(Xmms::Collection::TYPE_UNION) + c.operands << self + c.operands << other + c +end+
+ [R] + | +real | ++ |
+ Source: + show + +
+# File async.rb, line 47 +def initialize(coll) + @real = coll +end+
+ Source: + show + +
+# File async.rb, line 51 +def method_missing(id, *args, &block) + ret = @real.send(id, *args) + if(block_given? && ret.is_a?(Xmms::Result)) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
+ Source: + show + +
+static VALUE +c_attrs_init (VALUE self, VALUE collection) +{ + rb_iv_set (self, "collection", collection); + + return self; +}+
HAVE_RB_PROTECT_INSPECT
++ Source: + show + +
+static VALUE +c_attrs_aref (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + int s; + const char *value; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + s = xmmsv_coll_attribute_get_string (coll->real, StringValuePtr (key), &value); + if (!s) + return Qnil; + + return rb_str_new2 (value); +}+
+ Source: + show + +
+static VALUE +c_attrs_aset (VALUE self, VALUE key, VALUE value) +{ + RbCollection *coll = NULL; + VALUE tmp; + + StringValue (key); + StringValue (value); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + xmmsv_coll_attribute_set_string (coll->real, StringValuePtr (key), + StringValuePtr (value)); + + return Qnil; +}+
+ Source: + show + +
+static VALUE +c_attrs_delete (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + xmmsv_coll_attribute_remove (coll->real, StringValuePtr (key)); + + return Qnil; +}+
+ Source: + show + +
+static VALUE +c_attrs_each (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_PAIR)); + + return self; +}+
+ Source: + show + +
+static VALUE +c_attrs_each_key (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_KEY)); + + return self; +}+
+ Source: + show + +
+static VALUE +c_attrs_each_value (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *attributes; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + attributes = xmmsv_coll_attributes_get (coll->real); + + xmmsv_dict_foreach (attributes, attr_each, + XINT_TO_POINTER (EACH_VALUE)); + + return self; +}+
+ Source: + show + +
+static VALUE +c_attrs_has_key (VALUE self, VALUE key) +{ + RbCollection *coll = NULL; + VALUE tmp; + int s; + + StringValue (key); + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + s = xmmsv_coll_attribute_get_string (coll->real, StringValuePtr (key), NULL); + + return s ? Qtrue : Qfalse; +}+
+ Source: + show + +
+static VALUE +c_operands_init (VALUE self, VALUE collection) +{ + rb_iv_set (self, "collection", collection); + + return self; +}+
+ Source: + show + +
+static VALUE +c_operands_delete (VALUE self, VALUE arg) +{ + RbCollection *coll = NULL, *coll2 = NULL; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + Data_Get_Struct (arg, RbCollection, coll2); + + xmmsv_coll_remove_operand (coll->real, coll2->real); + + return Qnil; +}+
+ Source: + show + +
+static VALUE +c_operands_each (VALUE self) +{ + RbCollection *coll = NULL; + xmmsv_t *operands_list; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + operands_list = xmmsv_coll_operands_get (coll->real); + + xmmsv_list_foreach (operands_list, operands_each, NULL); + + return self; +}+
+ Source: + show + +
+static VALUE +c_operands_push (VALUE self, VALUE arg) +{ + RbCollection *coll = NULL, *coll2 = NULL; + VALUE tmp; + + tmp = rb_iv_get (self, "collection"); + Data_Get_Struct (tmp, RbCollection, coll); + + Data_Get_Struct (arg, RbCollection, coll2); + + xmmsv_coll_add_operand (coll->real, coll2->real); + + return self; +}+
+ [R] + | +real | ++ |
+ Source: + show + +
+# File sync.rb, line 48 +def initialize(coll) + @real = coll +end+
+ Source: + show + +
+# File sync.rb, line 52 +def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
NS_ALL | += | +rb_str_new2 (XMMS_COLLECTION_NS_ALL) | +
+ | + | |
NS_COLLECTIONS | += | +rb_str_new2 (XMMS_COLLECTION_NS_COLLECTIONS) | +
+ | + | |
NS_PLAYLISTS | += | +rb_str_new2 (XMMS_COLLECTION_NS_PLAYLISTS) | +
+ | + |
+ Source: + show + +
+static VALUE +c_dict_aref (VALUE self, VALUE key) +{ + RbDict *dict = NULL; + xmmsv_dict_iter_t *it; + xmmsv_t *value; + const char *ckey; + int s; + + Check_Type (key, T_SYMBOL); + + Data_Get_Struct (self, RbDict, dict); + + ckey = rb_id2name (SYM2ID (key)); + + xmmsv_get_dict_iter (dict->real, &it); + + s = xmmsv_dict_iter_find (it, ckey); + if (!s) + return Qnil; + + xmmsv_dict_iter_pair (it, NULL, &value); + + return extract_value (self, value); +}+
+ Source: + show + +
+static VALUE +c_dict_each (VALUE self) +{ + RbDict *dict = NULL; + + Data_Get_Struct (self, RbDict, dict); + + xmmsv_dict_foreach (dict->real, dict_each_pair, &self); + + return self; +}+
+ Source: + show + +
+static VALUE +c_dict_each_key (VALUE self) +{ + RbDict *dict = NULL; + + Data_Get_Struct (self, RbDict, dict); + + xmmsv_dict_foreach (dict->real, dict_each_key, NULL); + + return self; +}+
+ Source: + show + +
+static VALUE +c_dict_each_value (VALUE self) +{ + RbDict *dict = NULL; + + Data_Get_Struct (self, RbDict, dict); + + xmmsv_dict_foreach (dict->real, dict_each_value, &self); + + return self; +}+
+ Source: + show + +
+static VALUE +c_dict_empty (VALUE self) +{ + RbDict *dict = NULL; + int size; + + Data_Get_Struct (self, RbDict, dict); + + size = xmmsv_dict_get_size (dict->real); + + return size == 0 ? Qtrue : Qfalse; +}+
+ Source: + show + +
+static VALUE +c_dict_has_key (VALUE self, VALUE key) +{ + RbDict *dict = NULL; + xmmsv_dict_iter_t *it; + const char *ckey; + + Check_Type (key, T_SYMBOL); + + Data_Get_Struct (self, RbDict, dict); + + ckey = rb_id2name (SYM2ID (key)); + + xmmsv_get_dict_iter (dict->real, &it); + + return xmmsv_dict_iter_find (it, ckey) ? Qtrue : Qfalse; +}+
+ Source: + show + +
+static VALUE +c_dict_inspect (VALUE self) +{ + return rb_protect_inspect (dict_inspect, self, 0); +}+
+ Source: + show + +
+static VALUE +c_dict_size (VALUE self) +{ + RbDict *dict = NULL; + int size; + + Data_Get_Struct (self, RbDict, dict); + + size = xmmsv_dict_get_size (dict->real); + + return INT2NUM (size); +}+
Initializes a new Xmms::Playlist using the +playlist named name and the Xmms::Client +instance xc. Xmms::Client#playlist is a useful +shortcut. name is is the name of the playlist and the active +playlist will be used if it is not specified. Raises PlaylistError if the playlist name +is invalid.
++ Source: + show + +
+static VALUE +c_init (int argc, VALUE *argv, VALUE self) +{ + RbPlaylist *pl = NULL; + VALUE name, xmms = Qnil; + + Data_Get_Struct (self, RbPlaylist, pl); + + rb_scan_args (argc, argv, "11", &xmms, &name); + + /* FIXME: Check type! */ + pl->xmms = xmms; + + if (NIL_P (name)) + pl->name_value = rb_str_new2 (XMMS_ACTIVE_PLAYLIST); + else + pl->name_value = rb_str_dup (name); + + OBJ_FREEZE (pl->name_value); + + pl->name = StringValuePtr (pl->name_value); + + return self; +}+
Adds the collection coll to the playlist.
++ Source: + show + +
+static VALUE +c_add_collection (int argc, VALUE *argv, VALUE self) +{ + PLAYLIST_METHOD_HANDLER_HEADER + + VALUE rbcoll, order = Qnil; + xmmsv_t *corder = NULL; + xmmsc_coll_t *coll; + + rb_scan_args (argc, argv, "11", &rbcoll, &order); + + coll = FROM_XMMS_CLIENT_COLLECTION (rbcoll); + + if (!NIL_P (order)) + corder = parse_string_array2 (order); + + res = xmmsc_playlist_add_collection (xmms->real, pl->name, + coll, corder); + + if (corder) + xmmsv_unref (corder); + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
Adds an entry to the playlist. arg can be either a URL or an id.
++ Source: + show + +
+static VALUE +c_add_entry (VALUE self, VALUE arg) +{ + int32_t id; + + PLAYLIST_METHOD_HANDLER_HEADER + + if (!NIL_P (rb_check_string_type (arg))) + res = xmmsc_playlist_add_url (xmms->real, pl->name, + StringValuePtr (arg)); + else { + id = check_int32 (arg); + res = xmmsc_playlist_add_id (xmms->real, pl->name, id); + } + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
Clears the playlist.
++ Source: + show + +
+static VALUE +c_clear (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (clear) +}+
Retrieves the current position of the playlist. May raise an Xmms::Result::ValueError exception if the +current position is undefined.
++ Source: + show + +
+static VALUE +c_current_pos (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (current_pos) +}+
Retrieves an array containing ids for each position of the playlist.
++ Source: + show + +
+static VALUE +c_list_entries (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (list_entries) +}+
Inserts an entry to the current playlist at position pos in the +playlist. arg can be either a URL or an id.
++ Source: + show + +
+static VALUE +c_insert_entry (VALUE self, VALUE pos, VALUE arg) +{ + int32_t id; + int32_t ipos; + + PLAYLIST_METHOD_HANDLER_HEADER + + ipos = check_int32 (pos); + + if (!NIL_P (rb_check_string_type (arg))) + res = xmmsc_playlist_insert_url (xmms->real, pl->name, + ipos, StringValuePtr (arg)); + else { + id = check_int32 (arg); + res = xmmsc_playlist_insert_id (xmms->real, pl->name, + ipos, id); + } + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
Loads the playlist as the current active playlist.
++ Source: + show + +
+static VALUE +c_load (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (load); +}+
Moves the entry at current_pos to new_pos in the +playlist.
++ Source: + show + +
+static VALUE +c_move_entry (VALUE self, VALUE cur_pos, VALUE new_pos) +{ + PLAYLIST_METHOD_ADD_HANDLER_INT_INT (move_entry, cur_pos, new_pos) +}+
Returns the name of the playlist in the medialib as a String.
++ Source: + show + +
+static VALUE +c_name (VALUE self) +{ + RbPlaylist *pl = NULL; + + Data_Get_Struct (self, RbPlaylist, pl); + + return pl->name_value; +}+
Recursively imports all media files under path to the playlist.
++ Source: + show + +
+static VALUE +c_radd (VALUE self, VALUE path) +{ + PLAYLIST_METHOD_ADD_HANDLER_STR (radd, path); +}+
Removes the playlist from the medialib.
++ Source: + show + +
+static VALUE +c_remove (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (remove); +}+
Removes the entry at pos from the playlist.
++ Source: + show + +
+static VALUE +c_remove_entry (VALUE self, VALUE pos) +{ + PLAYLIST_METHOD_ADD_HANDLER_INT (remove_entry, pos) +}+
Recursively imports all media files under path at position +pos in the playlist.
++ Source: + show + +
+static VALUE +c_rinsert (VALUE self, VALUE pos, VALUE path) +{ + PLAYLIST_METHOD_ADD_HANDLER_INT_STR (rinsert, pos, path); +}+
Shuffles the playlist.
++ Source: + show + +
+static VALUE +c_shuffle (VALUE self) +{ + PLAYLIST_METHOD_ADD_HANDLER (shuffle) +}+
Sorts the playlist on properties, which is an array of medialib +properties such as [“title”, “artist”].
++ Source: + show + +
+static VALUE +c_sort (VALUE self, VALUE props) +{ + xmmsv_t *cprops; + PLAYLIST_METHOD_HANDLER_HEADER + + cprops = parse_string_array2 (props); + res = xmmsc_playlist_sort (xmms->real, pl->name, cprops); + xmmsv_unref (cprops); + + PLAYLIST_METHOD_HANDLER_FOOTER +}+
+ [R] + | +real | ++ |
+ Source: + show + +
+# File async.rb, line 66 +def initialize(plist) + @real = plist +end+
+ Source: + show + +
+# File async.rb, line 70 +def method_missing(id, *args, &block) + ret = @real.send(id, *args) + if(block_given? && ret.is_a?(Xmms::Result)) + ret.notifier(&block) + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
+ [R] + | +real | ++ |
+ Source: + show + +
+# File sync.rb, line 67 +def initialize(plist) + @real = plist +end+
+ Source: + show + +
+# File sync.rb, line 71 +def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
Transforms a RawDict (key-source-value) to a +regular key-value dict. The optional src_prefs argument restricts which +sources are considered. The value may be a string or an array of strings, +which may contain wildcards. Example: rawdict.to_propdict( +['server','plugin/*'] )
++ Source: + show + +
+static VALUE +c_raw_dict_to_propdict (int argc, VALUE *argv, VALUE self) +{ + VALUE value, sources = Qnil; + RbDict *dict = NULL, *dict2 = NULL; + xmmsv_t *inner_dict; + const char **csources = NULL; + + Data_Get_Struct (self, RbDict, dict); + + rb_scan_args (argc, argv, "01", &sources); + + if (!NIL_P (sources)) + csources = parse_string_array (sources); + inner_dict = xmmsv_propdict_to_dict (dict->real, csources); + if (csources) + free (csources); + + value = Data_Make_Struct (cDict, RbDict, + c_dict_mark, c_dict_free, + dict2); + + // don't add a second reference here + dict2->real = inner_dict; + dict2->parent = dict->parent; + + rb_obj_call_init (value, 0, NULL); + + return value; +}+
+ Source: + show + +
+static VALUE +c_get_error (VALUE self) +{ + RbResult *res; + xmmsv_t *val; + const char *error; + int ret; + + Data_Get_Struct (self, RbResult, res); + + val = xmmsc_result_get_value (res->real); + + ret = xmmsv_get_error (val, &error); + + return rb_str_new2 (ret ? error : ""); +}+
+ Source: + show + +
+static VALUE +c_is_error (VALUE self) +{ + RbResult *res; + + Data_Get_Struct (self, RbResult, res); + + return xmmsc_result_iserror (res->real) ? Qtrue : Qfalse; +}+
Sets the block that's executed when res is handled. Used by +asyncronous results only.
++ Source: + show + +
+static VALUE +c_notifier_set (VALUE self) +{ + VALUE callback; + RbResult *res = NULL; + RbXmmsClient *xmms = NULL; + + Data_Get_Struct (self, RbResult, res); + + if (!rb_block_given_p ()) + return Qnil; + + callback = rb_block_proc (); + + Data_Get_Struct (res->xmms, RbXmmsClient, xmms); + rb_ary_push (xmms->result_callbacks, callback); + + xmmsc_result_notifier_set (res->real, on_signal, (void *) callback); + + return Qnil; +}+
+ Source: + show + +
+static VALUE +c_value_get (VALUE self) +{ + RbResult *res = NULL; + xmmsv_t *val; + + Data_Get_Struct (self, RbResult, res); + + val = xmmsc_result_get_value (res->real); + + return extract_value (self, val); +}+
+ [R] + | +real | ++ |
+ Source: + show + +
+# File sync.rb, line 48 +def initialize(coll) + @real = coll +end+
+ Source: + show + +
+# File sync.rb, line 52 +def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
+ [R] + | +real | ++ |
+ Source: + show + +
+# File sync.rb, line 67 +def initialize(plist) + @real = plist +end+
+ Source: + show + +
+# File sync.rb, line 71 +def method_missing(id, *args) + ret = @real.send(id, *args) + if(ret.is_a?(Xmms::Result)) + ret.wait.value + elsif(ret.is_a?(Xmms::Collection)) + self + else + ret + end +end+
+ + |
+ + + Modules: Xmms + + + + +
+ + + + + + + + + +