summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2012-06-14 21:19:42 +0200
committerLars-Dominik Braun <lars@6xq.net>2012-06-14 21:19:42 +0200
commita3fc2105e4dfe06f3f31360813787103a01ab069 (patch)
tree3d66a15cfc2f73312b68d45832e9e2faaa618cd9
parent02bedadab6505c10dda52c716e797d1065a57a7b (diff)
downloadpianobar-a3fc2105e4dfe06f3f31360813787103a01ab069.tar.gz
pianobar-a3fc2105e4dfe06f3f31360813787103a01ab069.tar.bz2
pianobar-a3fc2105e4dfe06f3f31360813787103a01ab069.zip
piano: Remove unused struct
-rw-r--r--src/libpiano/piano.h5
-rw-r--r--src/libpiano/request.c10
-rw-r--r--src/ui.c5
-rw-r--r--src/ui_act.c16
4 files changed, 11 insertions, 25 deletions
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
@@ -216,11 +216,6 @@ typedef struct {
} PianoRequestDataSearch_t;
typedef struct {
- char *type;
- char *id;
-} PianoRequestDataCreateStation_t;
-
-typedef struct {
PianoStation_t *station;
char *musicId;
} PianoRequestDataAddSeed_t;
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");
}
}