Esempio n. 1
0
/*
 * call-seq:
 * xc.coll_save(coll, name, ns) -> result
 *
 * 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
}
Esempio n. 2
0
/*
 * call-seq:
 *  pl.add_collection(coll [, order]) -> result
 *
 * 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
}