void
pc_play(struct song *song)
{
	assert(song != NULL);

	if (pc.state != PLAYER_STATE_STOP)
		player_command(PLAYER_COMMAND_STOP);

	assert(pc.next_song == NULL);

	pc_enqueue_song(song);

	assert(pc.next_song == NULL);

	idle_add(IDLE_PLAYER);
}
Ejemplo n.º 2
0
/**
 * Queue a song, addressed by its order number.
 */
static void
playlist_queue_song_order(struct playlist *playlist, unsigned order)
{
	struct song *song;
	char *uri;

	assert(queue_valid_order(&playlist->queue, order));

	playlist->queued = order;

	song = queue_get_order(&playlist->queue, order);
	uri = song_get_uri(song);
	g_debug("queue song %i:\"%s\"", playlist->queued, uri);
	g_free(uri);

	pc_enqueue_song(song);
}
Ejemplo n.º 3
0
/**
 * Queue a song, addressed by its order number.
 */
static void
playlist_queue_song_order(struct playlist *playlist, struct player_control *pc,
			  unsigned order)
{
	char *uri;

	assert(queue_valid_order(&playlist->queue, order));

	playlist->queued = order;

	struct song *song =
		song_dup_detached(queue_get_order(&playlist->queue, order));

	uri = song_get_uri(song);
	g_debug("queue song %i:\"%s\"", playlist->queued, uri);
	g_free(uri);

	pc_enqueue_song(pc, song);
}