playlist: CamelCaseIsBad
Renamed all playlist functions to non-CamelCase.
This commit is contained in:
		@@ -399,7 +399,7 @@ handle_play(struct client *client, int argc, char *argv[])
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if (argc == 2 && !check_int(client, &song, argv[1], need_positive))
 | 
						if (argc == 2 && !check_int(client, &song, argv[1], need_positive))
 | 
				
			||||||
		return COMMAND_RETURN_ERROR;
 | 
							return COMMAND_RETURN_ERROR;
 | 
				
			||||||
	result = playPlaylist(&g_playlist, song);
 | 
						result = playlist_play(&g_playlist, song);
 | 
				
			||||||
	return print_playlist_result(client, result);
 | 
						return print_playlist_result(client, result);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -412,7 +412,7 @@ handle_playid(struct client *client, int argc, char *argv[])
 | 
				
			|||||||
	if (argc == 2 && !check_int(client, &id, argv[1], need_positive))
 | 
						if (argc == 2 && !check_int(client, &id, argv[1], need_positive))
 | 
				
			||||||
		return COMMAND_RETURN_ERROR;
 | 
							return COMMAND_RETURN_ERROR;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	result = playPlaylistById(&g_playlist, id);
 | 
						result = playlist_play_id(&g_playlist, id);
 | 
				
			||||||
	return print_playlist_result(client, result);
 | 
						return print_playlist_result(client, result);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -420,7 +420,7 @@ static enum command_return
 | 
				
			|||||||
handle_stop(G_GNUC_UNUSED struct client *client,
 | 
					handle_stop(G_GNUC_UNUSED struct client *client,
 | 
				
			||||||
	    G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
 | 
						    G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	stopPlaylist(&g_playlist);
 | 
						playlist_stop(&g_playlist);
 | 
				
			||||||
	return COMMAND_RETURN_OK;
 | 
						return COMMAND_RETURN_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -479,21 +479,21 @@ handle_status(struct client *client,
 | 
				
			|||||||
		      COMMAND_STATUS_CROSSFADE ": %i\n"
 | 
							      COMMAND_STATUS_CROSSFADE ": %i\n"
 | 
				
			||||||
		      COMMAND_STATUS_STATE ": %s\n",
 | 
							      COMMAND_STATUS_STATE ": %s\n",
 | 
				
			||||||
		      volume_level_get(),
 | 
							      volume_level_get(),
 | 
				
			||||||
		      getPlaylistRepeatStatus(&g_playlist),
 | 
							      playlist_get_repeat(&g_playlist),
 | 
				
			||||||
		      getPlaylistRandomStatus(&g_playlist),
 | 
							      playlist_get_random(&g_playlist),
 | 
				
			||||||
		      getPlaylistSingleStatus(&g_playlist),
 | 
							      playlist_get_single(&g_playlist),
 | 
				
			||||||
		      getPlaylistConsumeStatus(&g_playlist),
 | 
							      playlist_get_consume(&g_playlist),
 | 
				
			||||||
		      getPlaylistVersion(&g_playlist),
 | 
							      playlist_get_version(&g_playlist),
 | 
				
			||||||
		      getPlaylistLength(&g_playlist),
 | 
							      playlist_get_length(&g_playlist),
 | 
				
			||||||
		      (int)(getPlayerCrossFade() + 0.5),
 | 
							      (int)(getPlayerCrossFade() + 0.5),
 | 
				
			||||||
		      state);
 | 
							      state);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	song = getPlaylistCurrentSong(&g_playlist);
 | 
						song = playlist_get_current_song(&g_playlist);
 | 
				
			||||||
	if (song >= 0) {
 | 
						if (song >= 0) {
 | 
				
			||||||
		client_printf(client,
 | 
							client_printf(client,
 | 
				
			||||||
			      COMMAND_STATUS_SONG ": %i\n"
 | 
								      COMMAND_STATUS_SONG ": %i\n"
 | 
				
			||||||
			      COMMAND_STATUS_SONGID ": %u\n",
 | 
								      COMMAND_STATUS_SONGID ": %u\n",
 | 
				
			||||||
			      song, getPlaylistSongId(&g_playlist, song));
 | 
								      song, playlist_get_song_id(&g_playlist, song));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (getPlayerState() != PLAYER_STATE_STOP) {
 | 
						if (getPlayerState() != PLAYER_STATE_STOP) {
 | 
				
			||||||
@@ -521,12 +521,12 @@ handle_status(struct client *client,
 | 
				
			|||||||
			      getPlayerErrorStr());
 | 
								      getPlayerErrorStr());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	song = getPlaylistNextSong(&g_playlist);
 | 
						song = playlist_get_next_song(&g_playlist);
 | 
				
			||||||
	if (song >= 0) {
 | 
						if (song >= 0) {
 | 
				
			||||||
		client_printf(client,
 | 
							client_printf(client,
 | 
				
			||||||
			      COMMAND_STATUS_NEXTSONG ": %i\n"
 | 
								      COMMAND_STATUS_NEXTSONG ": %i\n"
 | 
				
			||||||
			      COMMAND_STATUS_NEXTSONGID ": %u\n",
 | 
								      COMMAND_STATUS_NEXTSONGID ": %u\n",
 | 
				
			||||||
			      song, getPlaylistSongId(&g_playlist, song));
 | 
								      song, playlist_get_song_id(&g_playlist, song));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return COMMAND_RETURN_OK;
 | 
						return COMMAND_RETURN_OK;
 | 
				
			||||||
@@ -1021,7 +1021,7 @@ handle_next(G_GNUC_UNUSED struct client *client,
 | 
				
			|||||||
	int single = g_playlist.queue.single;
 | 
						int single = g_playlist.queue.single;
 | 
				
			||||||
	g_playlist.queue.single = false;
 | 
						g_playlist.queue.single = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	nextSongInPlaylist(&g_playlist);
 | 
						playlist_next(&g_playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	g_playlist.queue.single = single;
 | 
						g_playlist.queue.single = single;
 | 
				
			||||||
	return COMMAND_RETURN_OK;
 | 
						return COMMAND_RETURN_OK;
 | 
				
			||||||
@@ -1031,7 +1031,7 @@ static enum command_return
 | 
				
			|||||||
handle_previous(G_GNUC_UNUSED struct client *client,
 | 
					handle_previous(G_GNUC_UNUSED struct client *client,
 | 
				
			||||||
		G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
 | 
							G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	previousSongInPlaylist(&g_playlist);
 | 
						playlist_previous(&g_playlist);
 | 
				
			||||||
	return COMMAND_RETURN_OK;
 | 
						return COMMAND_RETURN_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1090,7 +1090,7 @@ handle_repeat(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
 | 
				
			|||||||
		return COMMAND_RETURN_ERROR;
 | 
							return COMMAND_RETURN_ERROR;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setPlaylistRepeatStatus(&g_playlist, status);
 | 
						playlist_set_repeat(&g_playlist, status);
 | 
				
			||||||
	return COMMAND_RETURN_OK;
 | 
						return COMMAND_RETURN_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1108,7 +1108,7 @@ handle_single(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
 | 
				
			|||||||
		return COMMAND_RETURN_ERROR;
 | 
							return COMMAND_RETURN_ERROR;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setPlaylistSingleStatus(&g_playlist, status);
 | 
						playlist_set_single(&g_playlist, status);
 | 
				
			||||||
	return COMMAND_RETURN_OK;
 | 
						return COMMAND_RETURN_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1126,7 +1126,7 @@ handle_consume(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
 | 
				
			|||||||
		return COMMAND_RETURN_ERROR;
 | 
							return COMMAND_RETURN_ERROR;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setPlaylistConsumeStatus(&g_playlist, status);
 | 
						playlist_set_consume(&g_playlist, status);
 | 
				
			||||||
	return COMMAND_RETURN_OK;
 | 
						return COMMAND_RETURN_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1144,7 +1144,7 @@ handle_random(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
 | 
				
			|||||||
		return COMMAND_RETURN_ERROR;
 | 
							return COMMAND_RETURN_ERROR;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setPlaylistRandomStatus(&g_playlist, status);
 | 
						playlist_set_random(&g_playlist, status);
 | 
				
			||||||
	return COMMAND_RETURN_OK;
 | 
						return COMMAND_RETURN_OK;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1285,7 +1285,7 @@ handle_seek(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
 | 
				
			|||||||
	if (!check_int(client, &seek_time, argv[2], check_integer, argv[2]))
 | 
						if (!check_int(client, &seek_time, argv[2], check_integer, argv[2]))
 | 
				
			||||||
		return COMMAND_RETURN_ERROR;
 | 
							return COMMAND_RETURN_ERROR;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	result = seekSongInPlaylist(&g_playlist, song, seek_time);
 | 
						result = playlist_seek_song(&g_playlist, song, seek_time);
 | 
				
			||||||
	return print_playlist_result(client, result);
 | 
						return print_playlist_result(client, result);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1300,7 +1300,7 @@ handle_seekid(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
 | 
				
			|||||||
	if (!check_int(client, &seek_time, argv[2], check_integer, argv[2]))
 | 
						if (!check_int(client, &seek_time, argv[2], check_integer, argv[2]))
 | 
				
			||||||
		return COMMAND_RETURN_ERROR;
 | 
							return COMMAND_RETURN_ERROR;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	result = seekSongInPlaylistById(&g_playlist, id, seek_time);
 | 
						result = playlist_seek_song_id(&g_playlist, id, seek_time);
 | 
				
			||||||
	return print_playlist_result(client, result);
 | 
						return print_playlist_result(client, result);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,7 +32,7 @@ enum pipe_event {
 | 
				
			|||||||
	/** an idle event was emitted */
 | 
						/** an idle event was emitted */
 | 
				
			||||||
	PIPE_EVENT_IDLE,
 | 
						PIPE_EVENT_IDLE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/** must call syncPlayerAndPlaylist() */
 | 
						/** must call playlist_sync() */
 | 
				
			||||||
	PIPE_EVENT_PLAYLIST,
 | 
						PIPE_EVENT_PLAYLIST,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/** the current song's tag has changed */
 | 
						/** the current song's tag has changed */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,7 +34,8 @@
 | 
				
			|||||||
#undef G_LOG_DOMAIN
 | 
					#undef G_LOG_DOMAIN
 | 
				
			||||||
#define G_LOG_DOMAIN "playlist"
 | 
					#define G_LOG_DOMAIN "playlist"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void playlistVersionChange(struct playlist *playlist)
 | 
					void
 | 
				
			||||||
 | 
					playlist_increment_version_all(struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	queue_modify_all(&playlist->queue);
 | 
						queue_modify_all(&playlist->queue);
 | 
				
			||||||
	idle_add(IDLE_PLAYLIST);
 | 
						idle_add(IDLE_PLAYLIST);
 | 
				
			||||||
@@ -98,7 +99,8 @@ playlist_queue_song_order(struct playlist *playlist, unsigned order)
 | 
				
			|||||||
 * Check if the player thread has already started playing the "queued"
 | 
					 * Check if the player thread has already started playing the "queued"
 | 
				
			||||||
 * song.
 | 
					 * song.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static void syncPlaylistWithQueue(struct playlist *playlist)
 | 
					static void
 | 
				
			||||||
 | 
					playlist_sync_with_queue(struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (pc.next_song == NULL && playlist->queued != -1) {
 | 
						if (pc.next_song == NULL && playlist->queued != -1) {
 | 
				
			||||||
		/* queued song has started: copy queued to current,
 | 
							/* queued song has started: copy queued to current,
 | 
				
			||||||
@@ -178,7 +180,7 @@ playlist_update_queued_song(struct playlist *playlist, const struct song *prev)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
playPlaylistOrderNumber(struct playlist *playlist, int orderNum)
 | 
					playlist_play_order(struct playlist *playlist, int orderNum)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct song *song;
 | 
						struct song *song;
 | 
				
			||||||
	char *uri;
 | 
						char *uri;
 | 
				
			||||||
@@ -197,13 +199,14 @@ playPlaylistOrderNumber(struct playlist *playlist, int orderNum)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
playPlaylistIfPlayerStopped(struct playlist *playlist);
 | 
					playlist_resume_playback(struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * This is the "PLAYLIST" event handler.  It is invoked by the player
 | 
					 * This is the "PLAYLIST" event handler.  It is invoked by the player
 | 
				
			||||||
 * thread whenever it requests a new queued song, or when it exits.
 | 
					 * thread whenever it requests a new queued song, or when it exits.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
void syncPlayerAndPlaylist(struct playlist *playlist)
 | 
					void
 | 
				
			||||||
 | 
					playlist_sync(struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (!playlist->playing)
 | 
						if (!playlist->playing)
 | 
				
			||||||
		/* this event has reached us out of sync: we aren't
 | 
							/* this event has reached us out of sync: we aren't
 | 
				
			||||||
@@ -215,11 +218,11 @@ void syncPlayerAndPlaylist(struct playlist *playlist)
 | 
				
			|||||||
		   should be restarted with the next song.  That can
 | 
							   should be restarted with the next song.  That can
 | 
				
			||||||
		   happen if the playlist isn't filling the queue fast
 | 
							   happen if the playlist isn't filling the queue fast
 | 
				
			||||||
		   enough */
 | 
							   enough */
 | 
				
			||||||
		playPlaylistIfPlayerStopped(playlist);
 | 
							playlist_resume_playback(playlist);
 | 
				
			||||||
	else {
 | 
						else {
 | 
				
			||||||
		/* check if the player thread has already started
 | 
							/* check if the player thread has already started
 | 
				
			||||||
		   playing the queued song */
 | 
							   playing the queued song */
 | 
				
			||||||
		syncPlaylistWithQueue(playlist);
 | 
							playlist_sync_with_queue(playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* make sure the queued song is always set (if
 | 
							/* make sure the queued song is always set (if
 | 
				
			||||||
		   possible) */
 | 
							   possible) */
 | 
				
			||||||
@@ -233,7 +236,7 @@ void syncPlayerAndPlaylist(struct playlist *playlist)
 | 
				
			|||||||
 * decide whether to re-start playback
 | 
					 * decide whether to re-start playback
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
playPlaylistIfPlayerStopped(struct playlist *playlist)
 | 
					playlist_resume_playback(struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	enum player_error error;
 | 
						enum player_error error;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -251,37 +254,38 @@ playPlaylistIfPlayerStopped(struct playlist *playlist)
 | 
				
			|||||||
	    playlist->error_count >= queue_length(&playlist->queue))
 | 
						    playlist->error_count >= queue_length(&playlist->queue))
 | 
				
			||||||
		/* too many errors, or critical error: stop
 | 
							/* too many errors, or critical error: stop
 | 
				
			||||||
		   playback */
 | 
							   playback */
 | 
				
			||||||
		stopPlaylist(playlist);
 | 
							playlist_stop(playlist);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		/* continue playback at the next song */
 | 
							/* continue playback at the next song */
 | 
				
			||||||
		nextSongInPlaylist(playlist);
 | 
							playlist_next(playlist);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool
 | 
					bool
 | 
				
			||||||
getPlaylistRepeatStatus(const struct playlist *playlist)
 | 
					playlist_get_repeat(const struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return playlist->queue.repeat;
 | 
						return playlist->queue.repeat;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool
 | 
					bool
 | 
				
			||||||
getPlaylistRandomStatus(const struct playlist *playlist)
 | 
					playlist_get_random(const struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return playlist->queue.random;
 | 
						return playlist->queue.random;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool
 | 
					bool
 | 
				
			||||||
getPlaylistSingleStatus(const struct playlist *playlist)
 | 
					playlist_get_single(const struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return playlist->queue.single;
 | 
						return playlist->queue.single;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool
 | 
					bool
 | 
				
			||||||
getPlaylistConsumeStatus(const struct playlist *playlist)
 | 
					playlist_get_consume(const struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return playlist->queue.consume;
 | 
						return playlist->queue.consume;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setPlaylistRepeatStatus(struct playlist *playlist, bool status)
 | 
					void
 | 
				
			||||||
 | 
					playlist_set_repeat(struct playlist *playlist, bool status)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (status == playlist->queue.repeat)
 | 
						if (status == playlist->queue.repeat)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
@@ -296,7 +300,8 @@ void setPlaylistRepeatStatus(struct playlist *playlist, bool status)
 | 
				
			|||||||
	idle_add(IDLE_OPTIONS);
 | 
						idle_add(IDLE_OPTIONS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void orderPlaylist(struct playlist *playlist)
 | 
					static void
 | 
				
			||||||
 | 
					playlist_order(struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (playlist->current >= 0)
 | 
						if (playlist->current >= 0)
 | 
				
			||||||
		/* update playlist.current, order==position now */
 | 
							/* update playlist.current, order==position now */
 | 
				
			||||||
@@ -306,7 +311,8 @@ static void orderPlaylist(struct playlist *playlist)
 | 
				
			|||||||
	queue_restore_order(&playlist->queue);
 | 
						queue_restore_order(&playlist->queue);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setPlaylistSingleStatus(struct playlist *playlist, bool status)
 | 
					void
 | 
				
			||||||
 | 
					playlist_set_single(struct playlist *playlist, bool status)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (status == playlist->queue.single)
 | 
						if (status == playlist->queue.single)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
@@ -321,7 +327,8 @@ void setPlaylistSingleStatus(struct playlist *playlist, bool status)
 | 
				
			|||||||
	idle_add(IDLE_OPTIONS);
 | 
						idle_add(IDLE_OPTIONS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setPlaylistConsumeStatus(struct playlist *playlist, bool status)
 | 
					void
 | 
				
			||||||
 | 
					playlist_set_consume(struct playlist *playlist, bool status)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (status == playlist->queue.consume)
 | 
						if (status == playlist->queue.consume)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
@@ -330,7 +337,8 @@ void setPlaylistConsumeStatus(struct playlist *playlist, bool status)
 | 
				
			|||||||
	idle_add(IDLE_OPTIONS);
 | 
						idle_add(IDLE_OPTIONS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setPlaylistRandomStatus(struct playlist *playlist, bool status)
 | 
					void
 | 
				
			||||||
 | 
					playlist_set_random(struct playlist *playlist, bool status)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const struct song *queued;
 | 
						const struct song *queued;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -365,14 +373,15 @@ void setPlaylistRandomStatus(struct playlist *playlist, bool status)
 | 
				
			|||||||
		} else
 | 
							} else
 | 
				
			||||||
			playlist->current = -1;
 | 
								playlist->current = -1;
 | 
				
			||||||
	} else
 | 
						} else
 | 
				
			||||||
		orderPlaylist(playlist);
 | 
							playlist_order(playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	playlist_update_queued_song(playlist, queued);
 | 
						playlist_update_queued_song(playlist, queued);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	idle_add(IDLE_OPTIONS);
 | 
						idle_add(IDLE_OPTIONS);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int getPlaylistCurrentSong(const struct playlist *playlist)
 | 
					int
 | 
				
			||||||
 | 
					playlist_get_current_song(const struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (playlist->current >= 0)
 | 
						if (playlist->current >= 0)
 | 
				
			||||||
		return queue_order_to_position(&playlist->queue,
 | 
							return queue_order_to_position(&playlist->queue,
 | 
				
			||||||
@@ -381,7 +390,8 @@ int getPlaylistCurrentSong(const struct playlist *playlist)
 | 
				
			|||||||
	return -1;
 | 
						return -1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int getPlaylistNextSong(const struct playlist *playlist)
 | 
					int
 | 
				
			||||||
 | 
					playlist_get_next_song(const struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (playlist->current >= 0)
 | 
						if (playlist->current >= 0)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
@@ -404,19 +414,19 @@ int getPlaylistNextSong(const struct playlist *playlist)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned long
 | 
					unsigned long
 | 
				
			||||||
getPlaylistVersion(const struct playlist *playlist)
 | 
					playlist_get_version(const struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return playlist->queue.version;
 | 
						return playlist->queue.version;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
getPlaylistLength(const struct playlist *playlist)
 | 
					playlist_get_length(const struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return queue_length(&playlist->queue);
 | 
						return queue_length(&playlist->queue);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned
 | 
					unsigned
 | 
				
			||||||
getPlaylistSongId(const struct playlist *playlist, unsigned song)
 | 
					playlist_get_song_id(const struct playlist *playlist, unsigned song)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return queue_position_to_id(&playlist->queue, song);
 | 
						return queue_position_to_id(&playlist->queue, song);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -117,7 +117,8 @@ playlist_get_queue(const struct playlist *playlist)
 | 
				
			|||||||
	return &playlist->queue;
 | 
						return &playlist->queue;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void playlist_clear(struct playlist *playlist);
 | 
					void
 | 
				
			||||||
 | 
					playlist_clear(struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef WIN32
 | 
					#ifndef WIN32
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -143,19 +144,23 @@ playlist_delete(struct playlist *playlist, unsigned song);
 | 
				
			|||||||
enum playlist_result
 | 
					enum playlist_result
 | 
				
			||||||
playlist_delete_id(struct playlist *playlist, unsigned song);
 | 
					playlist_delete_id(struct playlist *playlist, unsigned song);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void stopPlaylist(struct playlist *playlist);
 | 
					void
 | 
				
			||||||
 | 
					playlist_stop(struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum playlist_result
 | 
					enum playlist_result
 | 
				
			||||||
playPlaylist(struct playlist *playlist, int song);
 | 
					playlist_play(struct playlist *playlist, int song);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum playlist_result
 | 
					enum playlist_result
 | 
				
			||||||
playPlaylistById(struct playlist *playlist, int song);
 | 
					playlist_play_id(struct playlist *playlist, int song);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void nextSongInPlaylist(struct playlist *playlist);
 | 
					void
 | 
				
			||||||
 | 
					playlist_next(struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void syncPlayerAndPlaylist(struct playlist *playlist);
 | 
					void
 | 
				
			||||||
 | 
					playlist_sync(struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void previousSongInPlaylist(struct playlist *playlist);
 | 
					void
 | 
				
			||||||
 | 
					playlist_previous(struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
playlist_shuffle(struct playlist *playlist, unsigned start, unsigned end);
 | 
					playlist_shuffle(struct playlist *playlist, unsigned start, unsigned end);
 | 
				
			||||||
@@ -176,46 +181,52 @@ enum playlist_result
 | 
				
			|||||||
playlist_swap_songs_id(struct playlist *playlist, unsigned id1, unsigned id2);
 | 
					playlist_swap_songs_id(struct playlist *playlist, unsigned id1, unsigned id2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool
 | 
					bool
 | 
				
			||||||
getPlaylistRepeatStatus(const struct playlist *playlist);
 | 
					playlist_get_repeat(const struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setPlaylistRepeatStatus(struct playlist *playlist, bool status);
 | 
					void
 | 
				
			||||||
 | 
					playlist_set_repeat(struct playlist *playlist, bool status);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool
 | 
					bool
 | 
				
			||||||
getPlaylistRandomStatus(const struct playlist *playlist);
 | 
					playlist_get_random(const struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setPlaylistRandomStatus(struct playlist *playlist, bool status);
 | 
					void
 | 
				
			||||||
 | 
					playlist_set_random(struct playlist *playlist, bool status);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool
 | 
					bool
 | 
				
			||||||
getPlaylistSingleStatus(const struct playlist *playlist);
 | 
					playlist_get_single(const struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setPlaylistSingleStatus(struct playlist *playlist, bool status);
 | 
					void
 | 
				
			||||||
 | 
					playlist_set_single(struct playlist *playlist, bool status);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool
 | 
					bool
 | 
				
			||||||
getPlaylistConsumeStatus(const struct playlist *playlist);
 | 
					playlist_get_consume(const struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setPlaylistConsumeStatus(struct playlist *playlist, bool status);
 | 
					void
 | 
				
			||||||
 | 
					playlist_set_consume(struct playlist *playlist, bool status);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int getPlaylistCurrentSong(const struct playlist *playlist);
 | 
					int
 | 
				
			||||||
 | 
					playlist_get_current_song(const struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int getPlaylistNextSong(const struct playlist *playlist);
 | 
					int
 | 
				
			||||||
 | 
					playlist_get_next_song(const struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned
 | 
					unsigned
 | 
				
			||||||
getPlaylistSongId(const struct playlist *playlist, unsigned song);
 | 
					playlist_get_song_id(const struct playlist *playlist, unsigned song);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int getPlaylistLength(const struct playlist *playlist);
 | 
					int
 | 
				
			||||||
 | 
					playlist_get_length(const struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned long
 | 
					unsigned long
 | 
				
			||||||
getPlaylistVersion(const struct playlist *playlist);
 | 
					playlist_get_version(const struct playlist *playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum playlist_result
 | 
					enum playlist_result
 | 
				
			||||||
seekSongInPlaylist(struct playlist *playlist, unsigned song, float seek_time);
 | 
					playlist_seek_song(struct playlist *playlist, unsigned song, float seek_time);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum playlist_result
 | 
					enum playlist_result
 | 
				
			||||||
seekSongInPlaylistById(struct playlist *playlist,
 | 
					playlist_seek_song_id(struct playlist *playlist,
 | 
				
			||||||
		       unsigned id, float seek_time);
 | 
							       unsigned id, float seek_time);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void playlistVersionChange(struct playlist *playlist);
 | 
					void
 | 
				
			||||||
 | 
					playlist_increment_version_all(struct playlist *playlist);
 | 
				
			||||||
int is_valid_playlist_name(const char *utf8path);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,7 +38,7 @@ enum {
 | 
				
			|||||||
	PLAYLIST_PREV_UNLESS_ELAPSED = 10,
 | 
						PLAYLIST_PREV_UNLESS_ELAPSED = 10,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void stopPlaylist(struct playlist *playlist)
 | 
					void playlist_stop(struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (!playlist->playing)
 | 
						if (!playlist->playing)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
@@ -68,7 +68,7 @@ void stopPlaylist(struct playlist *playlist)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum playlist_result playPlaylist(struct playlist *playlist, int song)
 | 
					enum playlist_result playlist_play(struct playlist *playlist, int song)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	unsigned i = song;
 | 
						unsigned i = song;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -115,28 +115,28 @@ enum playlist_result playPlaylist(struct playlist *playlist, int song)
 | 
				
			|||||||
	playlist->stop_on_error = false;
 | 
						playlist->stop_on_error = false;
 | 
				
			||||||
	playlist->error_count = 0;
 | 
						playlist->error_count = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	playPlaylistOrderNumber(playlist, i);
 | 
						playlist_play_order(playlist, i);
 | 
				
			||||||
	return PLAYLIST_RESULT_SUCCESS;
 | 
						return PLAYLIST_RESULT_SUCCESS;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum playlist_result
 | 
					enum playlist_result
 | 
				
			||||||
playPlaylistById(struct playlist *playlist, int id)
 | 
					playlist_play_id(struct playlist *playlist, int id)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int song;
 | 
						int song;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (id == -1) {
 | 
						if (id == -1) {
 | 
				
			||||||
		return playPlaylist(playlist, id);
 | 
							return playlist_play(playlist, id);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	song = queue_id_to_position(&playlist->queue, id);
 | 
						song = queue_id_to_position(&playlist->queue, id);
 | 
				
			||||||
	if (song < 0)
 | 
						if (song < 0)
 | 
				
			||||||
		return PLAYLIST_RESULT_NO_SUCH_SONG;
 | 
							return PLAYLIST_RESULT_NO_SUCH_SONG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return playPlaylist(playlist, song);
 | 
						return playlist_play(playlist, song);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
nextSongInPlaylist(struct playlist *playlist)
 | 
					playlist_next(struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int next_order;
 | 
						int next_order;
 | 
				
			||||||
	int current;
 | 
						int current;
 | 
				
			||||||
@@ -157,7 +157,7 @@ nextSongInPlaylist(struct playlist *playlist)
 | 
				
			|||||||
		/* cancel single */
 | 
							/* cancel single */
 | 
				
			||||||
		playlist->queue.single = false;
 | 
							playlist->queue.single = false;
 | 
				
			||||||
		/* no song after this one: stop playback */
 | 
							/* no song after this one: stop playback */
 | 
				
			||||||
		stopPlaylist(playlist);
 | 
							playlist_stop(playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* reset "current song" */
 | 
							/* reset "current song" */
 | 
				
			||||||
		playlist->current = -1;
 | 
							playlist->current = -1;
 | 
				
			||||||
@@ -174,11 +174,11 @@ nextSongInPlaylist(struct playlist *playlist)
 | 
				
			|||||||
			queue_shuffle_order(&playlist->queue);
 | 
								queue_shuffle_order(&playlist->queue);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			/* note that playlist->current and playlist->queued are
 | 
								/* note that playlist->current and playlist->queued are
 | 
				
			||||||
			   now invalid, but playPlaylistOrderNumber() will
 | 
								   now invalid, but playlist_play_order() will
 | 
				
			||||||
			   discard them anyway */
 | 
								   discard them anyway */
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		playPlaylistOrderNumber(playlist, next_order);
 | 
							playlist_play_order(playlist, next_order);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Consume mode removes each played songs. */
 | 
						/* Consume mode removes each played songs. */
 | 
				
			||||||
@@ -186,7 +186,7 @@ nextSongInPlaylist(struct playlist *playlist)
 | 
				
			|||||||
		playlist_delete(playlist, queue_order_to_position(&playlist->queue, current));
 | 
							playlist_delete(playlist, queue_order_to_position(&playlist->queue, current));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void previousSongInPlaylist(struct playlist *playlist)
 | 
					void playlist_previous(struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (!playlist->playing)
 | 
						if (!playlist->playing)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
@@ -196,20 +196,20 @@ void previousSongInPlaylist(struct playlist *playlist)
 | 
				
			|||||||
		/* re-start playing the current song (just like the
 | 
							/* re-start playing the current song (just like the
 | 
				
			||||||
		   "prev" button on CD players) */
 | 
							   "prev" button on CD players) */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		playPlaylistOrderNumber(playlist, playlist->current);
 | 
							playlist_play_order(playlist, playlist->current);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		if (playlist->current > 0) {
 | 
							if (playlist->current > 0) {
 | 
				
			||||||
			/* play the preceding song */
 | 
								/* play the preceding song */
 | 
				
			||||||
			playPlaylistOrderNumber(playlist,
 | 
								playlist_play_order(playlist,
 | 
				
			||||||
						playlist->current - 1);
 | 
											playlist->current - 1);
 | 
				
			||||||
		} else if (playlist->queue.repeat) {
 | 
							} else if (playlist->queue.repeat) {
 | 
				
			||||||
			/* play the last song in "repeat" mode */
 | 
								/* play the last song in "repeat" mode */
 | 
				
			||||||
			playPlaylistOrderNumber(playlist,
 | 
								playlist_play_order(playlist,
 | 
				
			||||||
						queue_length(&playlist->queue) - 1);
 | 
											queue_length(&playlist->queue) - 1);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			/* re-start playing the current song if it's
 | 
								/* re-start playing the current song if it's
 | 
				
			||||||
			   the first one */
 | 
								   the first one */
 | 
				
			||||||
			playPlaylistOrderNumber(playlist, playlist->current);
 | 
								playlist_play_order(playlist, playlist->current);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -217,7 +217,7 @@ void previousSongInPlaylist(struct playlist *playlist)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum playlist_result
 | 
					enum playlist_result
 | 
				
			||||||
seekSongInPlaylist(struct playlist *playlist, unsigned song, float seek_time)
 | 
					playlist_seek_song(struct playlist *playlist, unsigned song, float seek_time)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const struct song *queued;
 | 
						const struct song *queued;
 | 
				
			||||||
	unsigned i;
 | 
						unsigned i;
 | 
				
			||||||
@@ -241,7 +241,7 @@ seekSongInPlaylist(struct playlist *playlist, unsigned song, float seek_time)
 | 
				
			|||||||
		/* seeking is not within the current song - first
 | 
							/* seeking is not within the current song - first
 | 
				
			||||||
		   start playing the new song */
 | 
							   start playing the new song */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		playPlaylistOrderNumber(playlist, i);
 | 
							playlist_play_order(playlist, i);
 | 
				
			||||||
		queued = NULL;
 | 
							queued = NULL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -259,11 +259,11 @@ seekSongInPlaylist(struct playlist *playlist, unsigned song, float seek_time)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum playlist_result
 | 
					enum playlist_result
 | 
				
			||||||
seekSongInPlaylistById(struct playlist *playlist, unsigned id, float seek_time)
 | 
					playlist_seek_song_id(struct playlist *playlist, unsigned id, float seek_time)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int song = queue_id_to_position(&playlist->queue, id);
 | 
						int song = queue_id_to_position(&playlist->queue, id);
 | 
				
			||||||
	if (song < 0)
 | 
						if (song < 0)
 | 
				
			||||||
		return PLAYLIST_RESULT_NO_SUCH_SONG;
 | 
							return PLAYLIST_RESULT_NO_SUCH_SONG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return seekSongInPlaylist(playlist, song, seek_time);
 | 
						return playlist_seek_song(playlist, song, seek_time);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -44,7 +44,7 @@ static void playlist_increment_version(struct playlist *playlist)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void playlist_clear(struct playlist *playlist)
 | 
					void playlist_clear(struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	stopPlaylist(playlist);
 | 
						playlist_stop(playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* make sure there are no references to allocated songs
 | 
						/* make sure there are no references to allocated songs
 | 
				
			||||||
	   anymore */
 | 
						   anymore */
 | 
				
			||||||
@@ -238,11 +238,11 @@ playlist_delete(struct playlist *playlist, unsigned song)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		if (playlist->current >= 0 && !paused)
 | 
							if (playlist->current >= 0 && !paused)
 | 
				
			||||||
			/* play the song after the deleted one */
 | 
								/* play the song after the deleted one */
 | 
				
			||||||
			playPlaylistOrderNumber(playlist, playlist->current);
 | 
								playlist_play_order(playlist, playlist->current);
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			/* no songs left to play, stop playback
 | 
								/* no songs left to play, stop playback
 | 
				
			||||||
			   completely */
 | 
								   completely */
 | 
				
			||||||
			stopPlaylist(playlist);
 | 
								playlist_stop(playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		queued = NULL;
 | 
							queued = NULL;
 | 
				
			||||||
	} else if (playlist->current == (int)songOrder)
 | 
						} else if (playlist->current == (int)songOrder)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,7 +37,7 @@ playlist_tag_event(void)
 | 
				
			|||||||
static void
 | 
					static void
 | 
				
			||||||
playlist_event(void)
 | 
					playlist_event(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	syncPlayerAndPlaylist(&g_playlist);
 | 
						playlist_sync(&g_playlist);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -47,6 +47,6 @@ playlist_update_queued_song(struct playlist *playlist,
 | 
				
			|||||||
			    const struct song *prev);
 | 
								    const struct song *prev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
playPlaylistOrderNumber(struct playlist *playlist, int orderNum);
 | 
					playlist_play_order(struct playlist *playlist, int orderNum);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -69,7 +69,7 @@ playlist_print_id(struct client *client, const struct playlist *playlist,
 | 
				
			|||||||
bool
 | 
					bool
 | 
				
			||||||
playlist_print_current(struct client *client, const struct playlist *playlist)
 | 
					playlist_print_current(struct client *client, const struct playlist *playlist)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int current_position = getPlaylistCurrentSong(playlist);
 | 
						int current_position = playlist_get_current_song(playlist);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (current_position < 0)
 | 
						if (current_position < 0)
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -144,23 +144,23 @@ playlist_state_restore(const char *line, FILE *fp, struct playlist *playlist)
 | 
				
			|||||||
			if (strcmp
 | 
								if (strcmp
 | 
				
			||||||
			    (&(buffer[strlen(PLAYLIST_STATE_FILE_REPEAT)]),
 | 
								    (&(buffer[strlen(PLAYLIST_STATE_FILE_REPEAT)]),
 | 
				
			||||||
			     "1") == 0) {
 | 
								     "1") == 0) {
 | 
				
			||||||
				setPlaylistRepeatStatus(playlist, true);
 | 
									playlist_set_repeat(playlist, true);
 | 
				
			||||||
			} else
 | 
								} else
 | 
				
			||||||
				setPlaylistRepeatStatus(playlist, false);
 | 
									playlist_set_repeat(playlist, false);
 | 
				
			||||||
		} else if (g_str_has_prefix(buffer, PLAYLIST_STATE_FILE_SINGLE)) {
 | 
							} else if (g_str_has_prefix(buffer, PLAYLIST_STATE_FILE_SINGLE)) {
 | 
				
			||||||
			if (strcmp
 | 
								if (strcmp
 | 
				
			||||||
			    (&(buffer[strlen(PLAYLIST_STATE_FILE_SINGLE)]),
 | 
								    (&(buffer[strlen(PLAYLIST_STATE_FILE_SINGLE)]),
 | 
				
			||||||
			     "1") == 0) {
 | 
								     "1") == 0) {
 | 
				
			||||||
				setPlaylistSingleStatus(playlist, true);
 | 
									playlist_set_single(playlist, true);
 | 
				
			||||||
			} else
 | 
								} else
 | 
				
			||||||
				setPlaylistSingleStatus(playlist, false);
 | 
									playlist_set_single(playlist, false);
 | 
				
			||||||
		} else if (g_str_has_prefix(buffer, PLAYLIST_STATE_FILE_CONSUME)) {
 | 
							} else if (g_str_has_prefix(buffer, PLAYLIST_STATE_FILE_CONSUME)) {
 | 
				
			||||||
			if (strcmp
 | 
								if (strcmp
 | 
				
			||||||
			    (&(buffer[strlen(PLAYLIST_STATE_FILE_CONSUME)]),
 | 
								    (&(buffer[strlen(PLAYLIST_STATE_FILE_CONSUME)]),
 | 
				
			||||||
			     "1") == 0) {
 | 
								     "1") == 0) {
 | 
				
			||||||
				setPlaylistConsumeStatus(playlist, true);
 | 
									playlist_set_consume(playlist, true);
 | 
				
			||||||
			} else
 | 
								} else
 | 
				
			||||||
				setPlaylistConsumeStatus(playlist, false);
 | 
									playlist_set_consume(playlist, false);
 | 
				
			||||||
		} else if (g_str_has_prefix(buffer, PLAYLIST_STATE_FILE_CROSSFADE)) {
 | 
							} else if (g_str_has_prefix(buffer, PLAYLIST_STATE_FILE_CROSSFADE)) {
 | 
				
			||||||
			setPlayerCrossFade(atoi
 | 
								setPlayerCrossFade(atoi
 | 
				
			||||||
					   (&
 | 
										   (&
 | 
				
			||||||
@@ -181,7 +181,7 @@ playlist_state_restore(const char *line, FILE *fp, struct playlist *playlist)
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	setPlaylistRandomStatus(playlist, random_mode);
 | 
						playlist_set_random(playlist, random_mode);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!queue_is_empty(&playlist->queue)) {
 | 
						if (!queue_is_empty(&playlist->queue)) {
 | 
				
			||||||
		if (!queue_valid_position(&playlist->queue, current))
 | 
							if (!queue_valid_position(&playlist->queue, current))
 | 
				
			||||||
@@ -190,9 +190,9 @@ playlist_state_restore(const char *line, FILE *fp, struct playlist *playlist)
 | 
				
			|||||||
		if (state == PLAYER_STATE_STOP /* && config_option */)
 | 
							if (state == PLAYER_STATE_STOP /* && config_option */)
 | 
				
			||||||
			playlist->current = current;
 | 
								playlist->current = current;
 | 
				
			||||||
		else if (seek_time == 0)
 | 
							else if (seek_time == 0)
 | 
				
			||||||
			playPlaylist(playlist, current);
 | 
								playlist_play(playlist, current);
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			seekSongInPlaylist(playlist, current, seek_time);
 | 
								playlist_seek_song(playlist, current, seek_time);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (state == PLAYER_STATE_PAUSE)
 | 
							if (state == PLAYER_STATE_PAUSE)
 | 
				
			||||||
			playerPause();
 | 
								playerPause();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -868,7 +868,7 @@ static void update_finished_event(void)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if (modified) {
 | 
						if (modified) {
 | 
				
			||||||
		/* send "idle" events */
 | 
							/* send "idle" events */
 | 
				
			||||||
		playlistVersionChange(&g_playlist);
 | 
							playlist_increment_version_all(&g_playlist);
 | 
				
			||||||
		idle_add(IDLE_DATABASE);
 | 
							idle_add(IDLE_DATABASE);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user