diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2020-08-07 08:08:10 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2020-08-08 15:15:19 +0200 |
commit | 7f6457aa9b7110869e89111c42651b1055728679 (patch) | |
tree | ca1138c88748679ad6a564576e922803fdab5ec7 /src/libpiano/request.c | |
parent | bcc0c5fecfb79f412f45b7befc65b380a7e2bb5d (diff) | |
download | pianobar-7f6457aa9b7110869e89111c42651b1055728679.tar.gz pianobar-7f6457aa9b7110869e89111c42651b1055728679.tar.bz2 pianobar-7f6457aa9b7110869e89111c42651b1055728679.zip |
Allow changing station mode
Fixes #700.
Diffstat (limited to 'src/libpiano/request.c')
-rw-r--r-- | src/libpiano/request.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/libpiano/request.c b/src/libpiano/request.c index 35feda9..69e49a1 100644 --- a/src/libpiano/request.c +++ b/src/libpiano/request.c @@ -369,6 +369,36 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req, break; } + case PIANO_REQUEST_GET_STATION_MODES: { + PianoRequestDataGetStationModes_t *reqData = req->data; + assert (reqData != NULL); + PianoStation_t * const station = reqData->station; + assert (station != NULL); + + json_object_object_add (j, "stationId", + json_object_new_string (station->id)); + + method = "interactiveradio.v1.getAvailableModesSimple"; + req->secure = true; + break; + } + + case PIANO_REQUEST_SET_STATION_MODE: { + PianoRequestDataSetStationMode_t *reqData = req->data; + assert (reqData != NULL); + PianoStation_t * const station = reqData->station; + assert (station != NULL); + + json_object_object_add (j, "stationId", + json_object_new_string (station->id)); + json_object_object_add (j, "modeId", + json_object_new_int (reqData->id)); + + method = "interactiveradio.v1.setAndGetAvailableModes"; + req->secure = true; + break; + } + case PIANO_REQUEST_DELETE_FEEDBACK: { PianoSong_t *song = req->data; |