summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-07-27 12:15:59 +0200
committerLars-Dominik Braun <lars@6xq.net>2011-07-27 12:15:59 +0200
commit948a79bc8395c9f471ff60bea149bb59a7f117f2 (patch)
tree6904ae150d196e6c3ca1023549ade15a066dc790
parent0728b6a89de607e211bbc075b34f08495ac0d22f (diff)
downloadpianobar-948a79bc8395c9f471ff60bea149bb59a7f117f2.tar.gz
pianobar-948a79bc8395c9f471ff60bea149bb59a7f117f2.tar.bz2
pianobar-948a79bc8395c9f471ff60bea149bb59a7f117f2.zip
Configureable %@ format string
-rw-r--r--contrib/pianobar.17
-rw-r--r--src/settings.c5
-rw-r--r--src/settings.h1
-rw-r--r--src/ui.c2
4 files changed, 13 insertions, 2 deletions
diff --git a/contrib/pianobar.1 b/contrib/pianobar.1
index 55300f8..4cbc17a 100644
--- a/contrib/pianobar.1
+++ b/contrib/pianobar.1
@@ -145,6 +145,10 @@ Decrease volume.
Increase volume.
.TP
+.B at_icon = @
+Replacement for %@ in station format string. It's " @ " by default.
+
+.TP
.B audio_format = {aacplus,mp3,mp3-hifi}
Select audio format. aacplus is default if both libraries (faad, mad) are
available. mp3-hifi is available for Pandora One customers only.
@@ -189,7 +193,8 @@ Album name
Rating icon (only love icon)
.B %@
-@-sign if station is quickmix
+.B at_icon
+if station is quickmix, empty otherwise.
.B %s
Real station name if quickmix
diff --git a/src/settings.c b/src/settings.c
index 2061b39..6b150d1 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -88,6 +88,7 @@ void BarSettingsDestroy (BarSettings_t *settings) {
free (settings->eventCmd);
free (settings->loveIcon);
free (settings->banIcon);
+ free (settings->atIcon);
free (settings->npSongFormat);
free (settings->npStationFormat);
for (size_t i = 0; i < MSG_COUNT; i++) {
@@ -122,6 +123,7 @@ void BarSettingsRead (BarSettings_t *settings) {
settings->sortOrder = BAR_SORT_NAME_AZ;
settings->loveIcon = strdup (" <3");
settings->banIcon = strdup (" </3");
+ settings->atIcon = strdup (" @ ");
settings->npSongFormat = strdup ("\"%t\" by \"%a\" on \"%l\"%r%@%s");
settings->npStationFormat = strdup ("Station \"%n\" (%i)");
@@ -214,6 +216,9 @@ void BarSettingsRead (BarSettings_t *settings) {
} else if (streq ("ban_icon", key)) {
free (settings->banIcon);
settings->banIcon = strdup (val);
+ } else if (streq ("at_icon", key)) {
+ free (settings->atIcon);
+ settings->atIcon = strdup (val);
} else if (streq ("volume", key)) {
settings->volume = atoi (val);
} else if (streq ("format_nowplaying_song", key)) {
diff --git a/src/settings.h b/src/settings.h
index 91ea8fe..af616a2 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -91,6 +91,7 @@ typedef struct {
char *eventCmd;
char *loveIcon;
char *banIcon;
+ char *atIcon;
char *npSongFormat;
char *npStationFormat;
BarMsgFormatStr_t msgFormat[MSG_COUNT];
diff --git a/src/ui.c b/src/ui.c
index 25dee66..68f0cd9 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -713,7 +713,7 @@ inline void BarUiPrintSong (const BarSettings_t *settings,
char outstr[512];
const char *vals[] = {song->title, song->artist, song->album,
(song->rating == PIANO_RATE_LOVE) ? settings->loveIcon : "",
- station != NULL ? " @ " : "",
+ station != NULL ? settings->atIcon : "",
station != NULL ? station->name : "",
song->detailUrl};