Пример #1
0
bool
mpd_run_swap(struct mpd_connection *connection, unsigned pos1, unsigned pos2)
{
	return mpd_run_check(connection) &&
		mpd_send_swap(connection, pos1, pos2) &&
		mpd_response_finish(connection);
}
Пример #2
0
bool
mpd_run_swap_id(struct mpd_connection *connection, unsigned id1, unsigned id2)
{
	return mpd_run_check(connection) &&
		mpd_send_swap_id(connection, id1, id2) &&
		mpd_response_finish(connection);
}
Пример #3
0
bool
mpd_run_move_id(struct mpd_connection *connection, unsigned from, unsigned to)
{
	return mpd_run_check(connection) &&
		mpd_send_move_id(connection, from, to) &&
		mpd_response_finish(connection);
}
Пример #4
0
bool
mpd_run_clear(struct mpd_connection *connection)
{
	return mpd_run_check(connection) &&
		mpd_send_clear(connection) &&
		mpd_response_finish(connection);
}
Пример #5
0
bool
mpd_run_delete_id(struct mpd_connection *connection, unsigned id)
{
	return mpd_run_check(connection) &&
		mpd_send_delete_id(connection, id) &&
		mpd_response_finish(connection);
}
Пример #6
0
bool
mpd_run_toggle_pause(struct mpd_connection *connection)
{
	return mpd_run_check(connection) &&
		mpd_send_toggle_pause(connection) &&
		mpd_response_finish(connection);
}
Пример #7
0
bool
mpd_run_mixrampdelay(struct mpd_connection *connection, float seconds)
{
	return mpd_run_check(connection) &&
		mpd_send_mixrampdelay(connection, seconds) &&
		mpd_response_finish(connection);
}
Пример #8
0
bool
mpd_run_add(struct mpd_connection *connection, const char *uri)
{
	return mpd_run_check(connection) &&
		mpd_send_add(connection, uri) &&
		mpd_response_finish(connection);
}
Пример #9
0
bool
mpd_run_play_id(struct mpd_connection *connection, unsigned song_id)
{
	return mpd_run_check(connection) &&
		mpd_send_play_id(connection, song_id) &&
		mpd_response_finish(connection);
}
Пример #10
0
bool
mpd_run_subscribe(struct mpd_connection *connection, const char *channel)
{
	return mpd_run_check(connection) &&
		mpd_send_subscribe(connection, channel) &&
		mpd_response_finish(connection);
}
bool
mpd_run_password(struct mpd_connection *connection, const char *password)
{
	return mpd_run_check(connection) &&
		mpd_send_password(connection, password) &&
		mpd_response_finish(connection);
}
Пример #12
0
bool
mpd_run_delete(struct mpd_connection *connection, unsigned pos)
{
	return mpd_run_check(connection) &&
		mpd_send_delete(connection, pos) &&
		mpd_response_finish(connection);
}
Пример #13
0
bool
mpd_run_mixrampdb(struct mpd_connection *connection, float db)
{
	return mpd_run_check(connection) &&
		mpd_send_mixrampdb(connection, db) &&
		mpd_response_finish(connection);
}
Пример #14
0
bool
mpd_run_crossfade(struct mpd_connection *connection, unsigned seconds)
{
	return mpd_run_check(connection) &&
		mpd_send_crossfade(connection, seconds) &&
		mpd_response_finish(connection);
}
Пример #15
0
bool
mpd_run_consume(struct mpd_connection *connection, bool mode)
{
	return mpd_run_check(connection) &&
		mpd_send_consume(connection, mode) &&
		mpd_response_finish(connection);
}
Пример #16
0
bool
mpd_run_move_range(struct mpd_connection *connection,
		   unsigned start, unsigned end, unsigned to)
{
	return mpd_run_check(connection) &&
		mpd_send_move_range(connection, start, end, to) &&
		mpd_response_finish(connection);
}
Пример #17
0
bool
mpd_run_send_message(struct mpd_connection *connection,
		     const char *channel, const char *text)
{
	return mpd_run_check(connection) &&
		mpd_send_send_message(connection, channel, text) &&
		mpd_response_finish(connection);
}
Пример #18
0
bool
mpd_run_seek_pos(struct mpd_connection *connection,
		unsigned song_pos, unsigned t)
{
	return mpd_run_check(connection) &&
		mpd_send_seek_pos(connection, song_pos, t) &&
		mpd_response_finish(connection);
}
Пример #19
0
bool
mpd_run_prio_id(struct mpd_connection *connection, int priority,
		unsigned id)
{
	return mpd_run_check(connection) &&
		mpd_send_prio_id(connection, priority, id) &&
		mpd_response_finish(connection);
}
Пример #20
0
bool
mpd_run_prio_range(struct mpd_connection *connection, int priority,
		   unsigned start, unsigned end)
{
	return mpd_run_check(connection) &&
		mpd_send_prio_range(connection, priority, start, end) &&
		mpd_response_finish(connection);
}
Пример #21
0
unsigned
mpd_run_rescan(struct mpd_connection *connection, const char *path)
{
	unsigned id;

	if (!mpd_run_check(connection) || !mpd_send_rescan(connection, path))
		return 0;

	id = mpd_recv_update_id(connection);
	return id != 0 && mpd_response_finish(connection)
		? id : 0;
}
Пример #22
0
int
mpd_run_add_id(struct mpd_connection *connection, const char *file)
{
	int id;

	if (!mpd_run_check(connection) ||
	    !mpd_send_add_id(connection, file))
		return -1;

	id = mpd_recv_song_id(connection);

	if (!mpd_response_finish(connection))
		id = -1;

	return id;
}
Пример #23
0
int
mpd_run_add_id_to(struct mpd_connection *connection, const char *uri,
		  unsigned to)
{
	int id;

	if (!mpd_run_check(connection) ||
	    !mpd_send_add_id_to(connection, uri, to))
		return -1;

	id = mpd_recv_song_id(connection);

	if (!mpd_response_finish(connection))
		id = -1;

	return id;
}
Пример #24
0
struct mpd_song *
mpd_run_get_queue_song_id(struct mpd_connection *connection, unsigned id)
{
	struct mpd_song *song;

	if (!mpd_run_check(connection) ||
	    !mpd_send_get_queue_song_id(connection, id))
		return NULL;

	song = mpd_recv_song(connection);
	if (!mpd_response_finish(connection) && song != NULL) {
		mpd_song_free(song);
		return NULL;
	}

	return song;

}
Пример #25
0
struct mpd_song *
mpd_run_current_song(struct mpd_connection *connection)
{
	struct mpd_song *song;

	if (!mpd_run_check(connection) || !mpd_send_current_song(connection))
		return NULL;

	song = mpd_recv_song(connection);
	if (song == NULL)
		return NULL;

	if (!mpd_response_finish(connection)) {
		mpd_song_free(song);
		return NULL;
	}

	return song;
}
Пример #26
0
bool
mpd_run_previous(struct mpd_connection *connection)
{
	return mpd_run_check(connection) && mpd_send_previous(connection) &&
		mpd_response_finish(connection);
}