From 6a62ae4231c2ce10b6623e32198f40f0a2a8e777 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 15 Dec 2009 17:08:19 +0100 Subject: New history feature Default key is 'h', playlists are no longer part of PianoHandle_t now (=> libpiano's api changed) --- libpiano/src/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libpiano/src/main.c') diff --git a/libpiano/src/main.c b/libpiano/src/main.c index 16d30d7..2bf8426 100644 --- a/libpiano/src/main.c +++ b/libpiano/src/main.c @@ -133,10 +133,10 @@ void PianoDestroyStations (PianoStation_t *stations) { * @param piano handle * @return nothing */ -void PianoDestroyPlaylist (PianoHandle_t *ph) { +void PianoDestroyPlaylist (PianoSong_t *playlist) { PianoSong_t *curSong, *lastSong; - curSong = ph->playlist; + curSong = playlist; while (curSong != NULL) { PianoFree (curSong->audioUrl, 0); PianoFree (curSong->artist, 0); @@ -152,7 +152,6 @@ void PianoDestroyPlaylist (PianoHandle_t *ph) { curSong = curSong->next; PianoFree (lastSong, sizeof (*lastSong)); } - ph->playlist = NULL; } /* frees the whole piano handle structure @@ -176,7 +175,6 @@ void PianoDestroy (PianoHandle_t *ph) { curGenreCat = curGenreCat->next; PianoFree (lastGenreCat, sizeof (*lastGenreCat)); } - PianoDestroyPlaylist (ph); memset (ph, 0, sizeof (*ph)); } @@ -255,9 +253,11 @@ PianoReturn_t PianoGetStations (PianoHandle_t *ph) { /* get next songs for station (usually four tracks) * @param piano handle * @param station id + * @param audio format + * @param return value: playlist */ PianoReturn_t PianoGetPlaylist (PianoHandle_t *ph, const char *stationId, - PianoAudioFormat_t format) { + PianoAudioFormat_t format, PianoSong_t **retPlaylist) { char xmlSendBuf[PIANO_SEND_BUFFER_SIZE], *retStr; PianoReturn_t ret; @@ -283,7 +283,7 @@ PianoReturn_t PianoGetPlaylist (PianoHandle_t *ph, const char *stationId, if ((ret = PianoHttpPost (&ph->waith, xmlSendBuf, &retStr)) == PIANO_RET_OK) { - ret = PianoXmlParsePlaylist (ph, retStr); + ret = PianoXmlParsePlaylist (ph, retStr, retPlaylist); PianoFree (retStr, 0); } -- cgit v1.2.3