From a3fc2105e4dfe06f3f31360813787103a01ab069 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 14 Jun 2012 21:19:42 +0200 Subject: piano: Remove unused struct --- src/libpiano/piano.h | 5 ----- src/libpiano/request.c | 10 ++++------ src/ui.c | 5 +---- src/ui_act.c | 16 ++++++---------- 4 files changed, 11 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/libpiano/piano.h b/src/libpiano/piano.h index 4ea164d..167f0f9 100644 --- a/src/libpiano/piano.h +++ b/src/libpiano/piano.h @@ -215,11 +215,6 @@ typedef struct { PianoSearchResult_t searchResult; } PianoRequestDataSearch_t; -typedef struct { - char *type; - char *id; -} PianoRequestDataCreateStation_t; - typedef struct { PianoStation_t *station; char *musicId; diff --git a/src/libpiano/request.c b/src/libpiano/request.c index 871620d..5619e1b 100644 --- a/src/libpiano/request.c +++ b/src/libpiano/request.c @@ -203,15 +203,13 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req, } case PIANO_REQUEST_CREATE_STATION: { - /* create new station from specified musicid (type=mi, get one by - * performing a search) or shared station id (type=sh) */ - PianoRequestDataCreateStation_t *reqData = req->data; + /* create new station from specified musicToken or station number */ + char *token = req->data; - assert (reqData != NULL); - assert (reqData->id != NULL); + assert (token != NULL); json_object_object_add (j, "musicToken", - json_object_new_string (reqData->id)); + json_object_new_string (token)); method = "station.createStation"; break; diff --git a/src/ui.c b/src/ui.c index 3f23a23..b1a6407 100644 --- a/src/ui.c +++ b/src/ui.c @@ -556,7 +556,6 @@ void BarStationFromGenre (BarApp_t *app) { WaitressReturn_t wRet; PianoGenreCategory_t *curCat; PianoGenre_t *curGenre; - PianoRequestDataCreateStation_t reqData; int i; /* receive genre stations list if not yet available */ @@ -613,9 +612,7 @@ void BarStationFromGenre (BarApp_t *app) { /* create station */ BarUiMsg (&app->settings, MSG_INFO, "Adding shared station \"%s\"... ", curGenre->name); - reqData.id = curGenre->musicId; - reqData.type = "mi"; - BarUiPianoCall (app, PIANO_REQUEST_CREATE_STATION, &reqData, &pRet, &wRet); + BarUiPianoCall (app, PIANO_REQUEST_CREATE_STATION, curGenre->musicId, &pRet, &wRet); } /* replaces format characters (%x) in format string with custom strings diff --git a/src/ui_act.c b/src/ui_act.c index 0c9ed1b..ea50ec7 100644 --- a/src/ui_act.c +++ b/src/ui_act.c @@ -147,15 +147,14 @@ BarUiActCallback(BarUiActBanSong) { BarUiActCallback(BarUiActCreateStation) { PianoReturn_t pRet; WaitressReturn_t wRet; - PianoRequestDataCreateStation_t reqData; + char *id = NULL; - reqData.id = BarUiSelectMusicId (app, NULL, + id = BarUiSelectMusicId (app, NULL, "Create station from artist or title: "); - if (reqData.id != NULL) { - reqData.type = "mi"; + if (id != NULL) { BarUiMsg (&app->settings, MSG_INFO, "Creating station... "); - BarUiActDefaultPianoCall (PIANO_REQUEST_CREATE_STATION, &reqData); - free (reqData.id); + BarUiActDefaultPianoCall (PIANO_REQUEST_CREATE_STATION, id); + free (id); BarUiActDefaultEventcmd ("stationcreate"); } } @@ -165,16 +164,13 @@ BarUiActCallback(BarUiActCreateStation) { BarUiActCallback(BarUiActAddSharedStation) { PianoReturn_t pRet; WaitressReturn_t wRet; - PianoRequestDataCreateStation_t reqData; char stationId[50]; BarUiMsg (&app->settings, MSG_QUESTION, "Station id: "); if (BarReadline (stationId, sizeof (stationId), "0123456789", &app->input, BAR_RL_DEFAULT, -1) > 0) { - reqData.id = stationId; - reqData.type = "sh"; BarUiMsg (&app->settings, MSG_INFO, "Adding shared station... "); - BarUiActDefaultPianoCall (PIANO_REQUEST_CREATE_STATION, &reqData); + BarUiActDefaultPianoCall (PIANO_REQUEST_CREATE_STATION, stationId); BarUiActDefaultEventcmd ("stationaddshared"); } } -- cgit v1.2.3