class Xmms::Client

Constants

ALL_PLUGINS
ENTRY_STATUS_NEW
ENTRY_STATUS_NOT_AVAILABLE
ENTRY_STATUS_OK
ENTRY_STATUS_REHASH
ENTRY_STATUS_RESOLVING
IDLE
OUTPUT
PAUSE
PLAY
RUNNING
STOP
XFORM

Public Class Methods

Xmms::Client.new(name) → xc click to toggle source

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;
}

Public Instance Methods

bindata_add(str) → result click to toggle source

Stores binary data on the server.

static VALUE
c_bindata_add (VALUE self, VALUE data)
{
        METHOD_ADD_HANDLER_BIN (bindata_add, data);
}
bindata_list → result click to toggle source

List all bindata hashes stored on the server.

static VALUE
c_bindata_list (VALUE self)
{
        METHOD_ADD_HANDLER (bindata_list);
}
bindata_remove(hash) → result click to toggle source

Remove a datafile from the server.

static VALUE
c_bindata_remove (VALUE self, VALUE hash)
{
        METHOD_ADD_HANDLER_STR (bindata_remove, hash);
}
bindata_retrieve(hash) → result click to toggle source

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);
}
broadcast_coll_changed → result click to toggle source

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)
}
broadcast_config_value_changed → result click to toggle source

Retrieves configuration properties as a broadcast.

static VALUE
c_broadcast_config_value_changed (VALUE self)
{
        METHOD_ADD_HANDLER (broadcast_config_value_changed);
}
broadcast_mediainfo_reader_status → result click to toggle source

Requests the status of the mediainfo reader.

static VALUE
c_broadcast_mediainfo_reader_status (VALUE self)
{
        METHOD_ADD_HANDLER (broadcast_mediainfo_reader_status);
}
broadcast_medialib_entry_added → result click to toggle source

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);
}
broadcast_medialib_entry_changed → result click to toggle source

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);
}
broadcast_medialib_entry_removed → result click to toggle source

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);
}
broadcast_medialib_entry_changed → result click to toggle source

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);
}
broadcast_playback_current_id → result click to toggle source

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);
}
broadcast_playback_status → result click to toggle source

Retrieves the playback status as a broadcast.

static VALUE
c_broadcast_playback_status (VALUE self)
{
        METHOD_ADD_HANDLER (broadcast_playback_status);
}
broadcast_volume_changed → result click to toggle source

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);
}
broadcast_playlist_changed → result click to toggle source

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);
}
broadcast_playlist_current_pos → result click to toggle source

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);
}
broadcast_playlist_loaded → result click to toggle source

Will be called when a playlist has been loaded.

static VALUE
c_broadcast_playlist_loaded (VALUE self)
{
        METHOD_ADD_HANDLER (broadcast_playlist_loaded);
}
broadcast_quit → result click to toggle source

Will be called when the server is terminating.

static VALUE
c_broadcast_quit (VALUE self)
{
        METHOD_ADD_HANDLER (broadcast_quit);
}
coll_find(id, ns) → result click to toggle source

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
}
coll_get(name, [ns]) click to toggle source

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
}
coll_idlist_from_playlist_file(path) → result click to toggle source

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)
}
coll_list([ns]) → result click to toggle source

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 Xmms::Collection::NS_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
}
coll_query(coll, spec) → result click to toggle source
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
}
coll_query_ids(coll, [order], [start], [len]) → result click to toggle source

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
}
coll_query_info(coll, fetch, [order], [start], [len], [group]) → result click to toggle source

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
}
coll_remove(name, [ns]) → result click to toggle source

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
}
coll_rename(old, new, [ns]) → result click to toggle source

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
}
coll_save(coll, name, ns) → result click to toggle source

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
}
config_get_value(key) → result click to toggle source

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);
}
config_list_values → result click to toggle source

Retrieves a list of all config values.

static VALUE
c_config_list_values (VALUE self)
{
        METHOD_ADD_HANDLER (config_list_values);
}
config_register_value(key, default_value) → result click to toggle source

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);
}
config_set_value(key, value) → result click to toggle source

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);
}
connect([path]) → self click to toggle source

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;
}
delete!() click to toggle source
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;
}
io_disconnect → nil click to toggle source

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;
}
io_fd → integer click to toggle source

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));
}
io_in_handle → nil click to toggle source

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;
}
io_on_need_out { |flag| } click to toggle source

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;
}
io_out_handle → nil click to toggle source

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;
}
io_want_out → true or false click to toggle source

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;
}
last_error → string or nil click to toggle source

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;
}
main_stats → result click to toggle source

Retrieves a hash containing statistics about the daemon.

static VALUE
c_main_stats (VALUE self)
{
        METHOD_ADD_HANDLER (main_stats);
}
medialib_add_entry(url) → result click to toggle source

Adds url to the medialib.

static VALUE
c_medialib_add_entry (VALUE self, VALUE url)
{
        METHOD_ADD_HANDLER_STR (medialib_add_entry, url);
}
medialib_entry_move(id, url) → result click to toggle source

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
}
medialib_entry_property_remove(id, key, *source) → result click to toggle source

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);
}
medialib_entry_property_set(id, key, value, *source) → result click to toggle source

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);
}
medialib_entry_remove(id) → result click to toggle source

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)
}
medialib_get_id(url) → result click to toggle source

Retrieves the id corresponding to url.

static VALUE
c_medialib_get_id (VALUE self, VALUE url)
{
        METHOD_ADD_HANDLER_STR (medialib_get_id, url);
}
medialib_get_info(id) → result click to toggle source

Retrieves medialib info for id.

static VALUE
c_medialib_get_info (VALUE self, VALUE id)
{
        METHOD_ADD_HANDLER_INT (medialib_get_info, id);
}
medialib_path_import(path) → result click to toggle source

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);
}
medialib_path_import(path) → result click to toggle source

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);
}
medialib_rehash(id) → result click to toggle source

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);
}
on_disconnect { } → self click to toggle source

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;
}
playback_current_id → result click to toggle source

Retrieves the media id of the currently played track.

static VALUE
c_playback_current_id (VALUE self)
{
        METHOD_ADD_HANDLER (playback_current_id);
}
playback_pause → result click to toggle source

Pauses playback.

static VALUE
c_playback_pause (VALUE self)
{
        METHOD_ADD_HANDLER (playback_pause);
}
playback_playtime → result click to toggle source

Retrieves the playtime.

static VALUE
c_playback_playtime (VALUE self)
{
        METHOD_ADD_HANDLER (playback_playtime);
}
playback_seek_ms(ms) → result click to toggle source

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
}
playback_seek_ms_rel(ms) → result click to toggle source

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
}
playback_seek_samples(samples) → result click to toggle source

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
}
playback_seek_samples_rel(samples) → result click to toggle source

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
}
playback_start → result click to toggle source

Starts playback.

static VALUE
c_playback_start (VALUE self)
{
        METHOD_ADD_HANDLER (playback_start);
}
playback_status → result click to toggle source

Retrieves the playback status.

static VALUE
c_playback_status (VALUE self)
{
        METHOD_ADD_HANDLER (playback_status);
}
playback_stop → result click to toggle source

Stops playback.

static VALUE
c_playback_stop (VALUE self)
{
        METHOD_ADD_HANDLER (playback_stop);
}
playback_tickle → result click to toggle source

Advances to the next playlist entry.

static VALUE
c_playback_tickle (VALUE self)
{
        METHOD_ADD_HANDLER (playback_tickle);
}
playback_volume_get → result click to toggle source

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);
}
playback_volume_set(channel, volume) → result click to toggle source

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);
}
playlist([name]) → p click to toggle source

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);
}
playlist_current_active → result click to toggle source

Retrieves the name of the active playlist.

static VALUE
c_playlist_current_active (VALUE self)
{
        METHOD_ADD_HANDLER (playlist_current_active);
}
playlist_list → result click to toggle source

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);
}
playlist_set_next(pos) → result click to toggle source

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);
}
playlist_set_next_rel(pos) → result click to toggle source

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);
}
plugin_list → result click to toggle source

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);
}
quit → result click to toggle source

Shuts down the XMMS2 daemon.

static VALUE
c_quit (VALUE self)
{
        METHOD_ADD_HANDLER (quit);
}
signal_mediainfo_reader_unindexed → result click to toggle source

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);
}
signal_playback_playtime → result click to toggle source

Retrieves the playtime as a signal.

static VALUE
c_signal_playback_playtime (VALUE self)
{
        METHOD_ADD_HANDLER (signal_playback_playtime);
}
xform_media_browse(url) → result click to toggle source

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);
}