示例#1
0
/*
 * call-seq:
 *  xc.medialib_entry_property_remove(id, key, *source) -> result
 *
 * 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
 * _Xmms::Client.new(name)_.
 */
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);
}
示例#2
0
文件: medialib.c 项目: chrippa/xmms2
/**
 * Remove a custom field in the medialib associated with an entry.
 * Uses default source which is client/&lt;clientname&gt;
 */
xmmsc_result_t *
xmmsc_medialib_entry_property_remove (xmmsc_connection_t *c, int id,
                                      const char *key)
{
	char tmp[256];

	x_check_conn (c, NULL);

	snprintf (tmp, 256, "client/%s", c->clientname);
	return xmmsc_medialib_entry_property_remove_with_source (c, id,
	                                                         tmp, key);
}