diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-12-15 17:08:19 +0100 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-12-15 17:08:19 +0100 |
commit | 6a62ae4231c2ce10b6623e32198f40f0a2a8e777 (patch) | |
tree | 524e9322520bdbee06cdc20f1b8d636147d7aa9f /libpiano/src/main.c | |
parent | 927a878f171580c1fdeb4d01caf0a2c9c32f8b42 (diff) | |
download | pianobar-windows-6a62ae4231c2ce10b6623e32198f40f0a2a8e777.tar.gz pianobar-windows-6a62ae4231c2ce10b6623e32198f40f0a2a8e777.tar.bz2 pianobar-windows-6a62ae4231c2ce10b6623e32198f40f0a2a8e777.zip |
New history feature
Default key is 'h', playlists are no longer part of PianoHandle_t now
(=> libpiano's api changed)
Diffstat (limited to 'libpiano/src/main.c')
-rw-r--r-- | libpiano/src/main.c | 12 |
1 files changed, 6 insertions, 6 deletions
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); } |