summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-07-08 20:51:10 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-07-08 20:51:48 +0200
commita195a94be7aa14d839c77275814a52d2ee6b8b6f (patch)
tree912ab804af1ce4db4717c75ea980476f52849255
parent82b49378dfa407673118a8ce2f1c85122ab349d5 (diff)
downloadpianobar-a195a94be7aa14d839c77275814a52d2ee6b8b6f.tar.gz
pianobar-a195a94be7aa14d839c77275814a52d2ee6b8b6f.tar.bz2
pianobar-a195a94be7aa14d839c77275814a52d2ee6b8b6f.zip
Initial pandora one support (higher mp3 bitrates)
Time display should be fixed. I need feedback!
-rw-r--r--libpiano/src/main.c4
-rw-r--r--libpiano/src/piano.h4
-rw-r--r--libpiano/src/xml.c5
-rw-r--r--src/pianobar.18
-rw-r--r--src/settings.c2
5 files changed, 14 insertions, 9 deletions
diff --git a/libpiano/src/main.c b/libpiano/src/main.c
index bb282fb..380fbed 100644
--- a/libpiano/src/main.c
+++ b/libpiano/src/main.c
@@ -885,6 +885,10 @@ const char *PianoAudioFormatToString (PianoAudioFormat_t format) {
return "mp3";
break;
+ case PIANO_AF_MP3_HI:
+ return "mp3-hifi";
+ break;
+
default:
return NULL;
break;
diff --git a/libpiano/src/piano.h b/libpiano/src/piano.h
index 7ed5394..caee1b7 100644
--- a/libpiano/src/piano.h
+++ b/libpiano/src/piano.h
@@ -50,8 +50,8 @@ typedef enum {PIANO_RATE_BAN, PIANO_RATE_LOVE, PIANO_RATE_NONE}
PianoSongRating_t;
/* UNKNOWN should be 0, because memset sets audio format to 0 */
-typedef enum {PIANO_AF_UNKNOWN = 0, PIANO_AF_AACPLUS, PIANO_AF_MP3}
- PianoAudioFormat_t;
+typedef enum {PIANO_AF_UNKNOWN = 0, PIANO_AF_AACPLUS, PIANO_AF_MP3,
+ PIANO_AF_MP3_HI} PianoAudioFormat_t;
typedef struct PianoSong {
char *artist;
diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c
index 6d3d35a..591e5be 100644
--- a/libpiano/src/xml.c
+++ b/libpiano/src/xml.c
@@ -108,7 +108,7 @@ PianoReturn_t PianoXmlIsFault (const xmlNode *docRoot) {
PianoReturn_t ret;
/* FIXME: we could get into troubles when fault is not the first child
- * (pandora yould add whitespace e.g.) */
+ * (pandora could add whitespace e.g.) */
if (docRoot->children != NULL &&
docRoot->children->type == XML_ELEMENT_NODE &&
xmlStrEqual (docRoot->children->name, (xmlChar *) "fault")) {
@@ -298,6 +298,8 @@ void PianoXmlParsePlaylistCb (const char *key, const xmlNode *value,
song->audioFormat = PIANO_AF_AACPLUS;
} else if (strcmp (valueStr, "mp3") == 0) {
song->audioFormat = PIANO_AF_MP3;
+ } else if (strcmp (valueStr, "mp3-hifi") == 0) {
+ song->audioFormat = PIANO_AF_MP3_HI;
}
}
}
@@ -801,3 +803,4 @@ PianoReturn_t PianoXmlParseNarrative (const char *xml, char **retNarrative) {
return ret;
}
+
diff --git a/src/pianobar.1 b/src/pianobar.1
index fdc3b88..434233d 100644
--- a/src/pianobar.1
+++ b/src/pianobar.1
@@ -109,9 +109,9 @@ Show next songs in playlist.
Select quickmix stations.
.TP
-.B audio_format = {aacplus,mp3}
+.B audio_format = {aacplus,mp3,mp3-hifi}
Select audio format. aacplus is default if both libraries (faad, mad) are
-available.
+available. mp3-hifi is available for Pandora One customers only.
.TP
.B autostart_station = stationid
@@ -170,10 +170,6 @@ is the keybinding for "next song". If you customized your keybindings you have t
.B pianobar.
.I This behaviour may change in the future!
-Please note: Commands like "select station" or "delete station" don't make
-sense at the moment, because the expected input is read from stdin, but not
-from the fifo.
-
Another example:
while true; do;
diff --git a/src/settings.c b/src/settings.c
index dfff76b..077be60 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -224,6 +224,8 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->audioFormat = PIANO_AF_AACPLUS;
} else if (strcmp (val, "mp3") == 0) {
settings->audioFormat = PIANO_AF_MP3;
+ } else if (strcmp (val, "mp3-hifi") == 0) {
+ settings->audioFormat = PIANO_AF_MP3_HI;
}
} else if (strcmp ("autostart_station", key) == 0) {
settings->autostartStation = strdup (val);