From b6995ca0113611613d311250eabfc354658d46a7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 3 Nov 2009 21:08:48 +0100 Subject: player_control: removed the global variable "pc" Allocate a player_control object where needed, and pass it around. Each "client" object is associated with a "player_control" instance. This prepares multi-player support. --- src/playlist_queue.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/playlist_queue.c') diff --git a/src/playlist_queue.c b/src/playlist_queue.c index 43621da9f..e0730fd08 100644 --- a/src/playlist_queue.c +++ b/src/playlist_queue.c @@ -27,7 +27,8 @@ enum playlist_result playlist_load_into_queue(const char *uri, struct playlist_provider *source, - struct playlist *dest, bool secure) + struct playlist *dest, struct player_control *pc, + bool secure) { enum playlist_result result; struct song *song; @@ -38,7 +39,7 @@ playlist_load_into_queue(const char *uri, struct playlist_provider *source, if (song == NULL) continue; - result = playlist_append_song(dest, song, NULL); + result = playlist_append_song(dest, pc, song, NULL); if (result != PLAYLIST_RESULT_SUCCESS) { if (!song_in_database(song)) song_free(song); @@ -53,7 +54,9 @@ playlist_load_into_queue(const char *uri, struct playlist_provider *source, } enum playlist_result -playlist_open_into_queue(const char *uri, struct playlist *dest, bool secure) +playlist_open_into_queue(const char *uri, + struct playlist *dest, struct player_control *pc, + bool secure) { struct input_stream *is; struct playlist_provider *playlist = playlist_open_any(uri, &is); @@ -61,7 +64,7 @@ playlist_open_into_queue(const char *uri, struct playlist *dest, bool secure) return PLAYLIST_RESULT_NO_SUCH_LIST; enum playlist_result result = - playlist_load_into_queue(uri, playlist, dest, secure); + playlist_load_into_queue(uri, playlist, dest, pc, secure); playlist_plugin_close(playlist); if (is != NULL) -- cgit v1.2.3