Esempio n. 1
0
/**
 * Add a URL to the medialib. If you want to add mutiple files
 * you should call #xmmsc_medialib_import_path
 *
 * same as #xmmsc_medialib_add_entry but expects a encoded URL
 * instead
 *
 * @param conn The #xmmsc_connection_t
 * @param url URL to add to the medialib.
 */
xmmsc_result_t *
xmmsc_medialib_add_entry_encoded (xmmsc_connection_t *conn, const char *url)
{
	x_check_conn (conn, NULL);

	if (!_xmmsc_medialib_verify_url (url))
		x_api_error ("with a non encoded url", NULL);

	return do_methodcall (conn, XMMS_IPC_CMD_MLIB_ADD_URL, url);
}
Esempio n. 2
0
/**
 * Import a all files recursivly from the directory passed as argument
 * which must already be url encoded. You probably want to use
 * #xmmsc_medialib_import_path unless you want to add a string that
 * comes as a result from the daemon, such as from
 * #xmmsc_xform_media_browse
 *
 * @param conn #xmmsc_connection_t
 * @param path A directory to recursive search for mediafiles, this must
 * 		  include the protocol, i.e file://
 */
xmmsc_result_t *
xmmsc_medialib_import_path_encoded (xmmsc_connection_t *conn,
                                    const char *path)
{
	x_check_conn (conn, NULL);

	if (!_xmmsc_medialib_verify_url (path))
		x_api_error ("with a non encoded url", NULL);

	return do_methodcall (conn, XMMS_IPC_CMD_PATH_IMPORT, path);
}
Esempio n. 3
0
/**
 * Browse available media in a (already encoded) path.
 *
 * Retrieves a list of paths available (directly) under the specified
 * path.
 *
 */
xmmsc_result_t *
xmmsc_xform_media_browse_encoded (xmmsc_connection_t *c, const char *url)
{
	x_check_conn (c, NULL);
	x_api_error_if (!url, "with a NULL url", NULL);

	if (!_xmmsc_medialib_verify_url (url))
		x_api_error ("with a non encoded url", NULL);

	return xmmsc_send_cmd (c, XMMS_IPC_OBJECT_XFORM, XMMS_IPC_CMD_BROWSE,
	                       XMMSV_LIST_ENTRY_STR (url), XMMSV_LIST_END);
}
Esempio n. 4
0
/**
 * Insert entry at given position in playlist.
 * Same as #xmmsc_playlist_insert_url but takes an encoded
 * url instead.
 *
 * @param c The connection structure.
 * @param playlist The playlist in which to insert the media.
 * @param pos A position in the playlist
 * @param url The URL to insert
 *
 */
xmmsc_result_t *
xmmsc_playlist_insert_encoded (xmmsc_connection_t *c, const char *playlist, int pos, const char *url)
{
	xmms_ipc_msg_t *msg;

	if (!_xmmsc_medialib_verify_url (url))
		x_api_error ("with a non encoded url", NULL);

	/* default to the active playlist */
	if (playlist == NULL) {
		playlist = XMMS_ACTIVE_PLAYLIST;
	}

	msg = xmms_ipc_msg_new (XMMS_IPC_OBJECT_PLAYLIST, XMMS_IPC_CMD_INSERT_URL);
	xmms_ipc_msg_put_string (msg, playlist);
	xmms_ipc_msg_put_int32 (msg, pos);
	xmms_ipc_msg_put_string (msg, url);

	return xmmsc_send_msg (c, msg);
}
Esempio n. 5
0
/**
 * Adds a directory recursivly to the playlist.
 *
 * The url should be absolute to the server-side and url encoded. Note
 * that you will have to include the protocol for the url to. ie:
 * file://mp3/my_mp3s/first.mp3. You probably want to use
 * #xmmsc_playlist_radd unless you want to add a string that comes as
 * a result from the daemon, such as from #xmmsc_xform_media_browse
 *
 * @param c The connection structure.
 * @param playlist The playlist in which to add the media.
 * @param url Encoded path.
 *
 */
xmmsc_result_t *
xmmsc_playlist_radd_encoded (xmmsc_connection_t *c, const char *playlist, const char *url)
{
	xmms_ipc_msg_t *msg;

	x_check_conn (c, NULL);
	x_api_error_if (!url, "with a NULL url", NULL);

	if (!_xmmsc_medialib_verify_url (url))
		x_api_error ("with a non encoded url", NULL);

	/* default to the active playlist */
	if (playlist == NULL) {
		playlist = XMMS_ACTIVE_PLAYLIST;
	}

	msg = xmms_ipc_msg_new (XMMS_IPC_OBJECT_PLAYLIST, XMMS_IPC_CMD_RADD);
	xmms_ipc_msg_put_string (msg, playlist);
	xmms_ipc_msg_put_string (msg, url);

	return xmmsc_send_msg (c, msg);
}