summaryrefslogtreecommitdiff
path: root/src/libpiano/request.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libpiano/request.c')
-rw-r--r--src/libpiano/request.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/libpiano/request.c b/src/libpiano/request.c
index 3a1d7fb..fcc13d4 100644
--- a/src/libpiano/request.c
+++ b/src/libpiano/request.c
@@ -36,6 +36,30 @@ THE SOFTWARE.
#include "piano.h"
#include "crypt.h"
+/* convert audio format id to string
+ * @param format id
+ * @return constant string
+ */
+static const char *PianoAudioFormatToString (PianoAudioFormat_t format) {
+ switch (format) {
+ case PIANO_AF_AACPLUS:
+ return "HTTP_64_AACPLUS";
+ break;
+
+ case PIANO_AF_MP3:
+ return "HTTP_128_MP3";
+ break;
+
+ case PIANO_AF_MP3_HI:
+ return "HTTP_192_MP3";
+ break;
+
+ default:
+ return NULL;
+ break;
+ }
+}
+
/* prepare piano request (initializes request type, urlpath and postData)
* @param piano handle
* @param request structure
@@ -133,6 +157,8 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req,
json_object_object_add (j, "stationToken",
json_object_new_string (reqData->station->id));
+ json_object_object_add (j, "additionalAudioUrl",
+ json_object_new_string (PianoAudioFormatToString (reqData->format)));
method = "station.getPlaylist";
break;