From bfef5030e9d52e055b2ecbc71866f0d8346b0e0a Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 12 Feb 2009 16:42:03 +0100 Subject: Shared stations can be added --- src/pianobar.1 | 5 +++++ src/settings.c | 2 ++ src/ui_act.c | 12 ++++++++++++ src/ui_act.h | 1 + 4 files changed, 20 insertions(+) (limited to 'src') diff --git a/src/pianobar.1 b/src/pianobar.1 index 7ae7371..14786da 100644 --- a/src/pianobar.1 +++ b/src/pianobar.1 @@ -66,6 +66,11 @@ Add genre station provided by pandora. .B act_songinfo = i Print detailed information about currently played song. +.TP +.B act_addshared = j +Add shared station by id. id is a very long integer without "sh" at the +beginning. + .TP .B act_songmove = m Move current song to another station diff --git a/src/settings.c b/src/settings.c index e3e811a..63d5937 100644 --- a/src/settings.c +++ b/src/settings.c @@ -137,6 +137,8 @@ void BarSettingsRead (BarSettings_t *settings) { {'i', BarUiActSongInfo, "print verbose information about current song", "act_songinfo", NULL}, + {'j', BarUiActAddSharedStation, "add shared station", + "act_addshared", NULL}, {'m', BarUiActMoveSong, "move song to different station", "act_songmove", NULL}, {'n', BarUiActSkipSong, "next song", "act_songnext", NULL}, diff --git a/src/ui_act.c b/src/ui_act.c index 2ecc9c2..1f73b0e 100644 --- a/src/ui_act.c +++ b/src/ui_act.c @@ -126,6 +126,18 @@ void BarUiActCreateStation (BAR_KS_ARGS) { } } +/* add shared station by id + */ +void BarUiActAddSharedStation (BAR_KS_ARGS) { + char *stationId = NULL; + + if ((stationId = readline ("Station id: ")) != NULL) { + BarUiMsg ("Adding shared station... "); + BarUiPrintPianoStatus (PianoCreateStation (ph, "sh", stationId)); + free (stationId); + } +} + /* delete current station */ void BarUiActDeleteStation (BAR_KS_ARGS) { diff --git a/src/ui_act.h b/src/ui_act.h index 9b1ba2b..4eaefbe 100644 --- a/src/ui_act.h +++ b/src/ui_act.h @@ -30,6 +30,7 @@ void BarUiActHelp (BAR_KS_ARGS); void BarUiActAddMusic (BAR_KS_ARGS); void BarUiActBanSong (BAR_KS_ARGS); void BarUiActCreateStation (BAR_KS_ARGS); +void BarUiActAddSharedStation (BAR_KS_ARGS); void BarUiActDeleteStation (BAR_KS_ARGS); void BarUiActExplain (BAR_KS_ARGS); void BarUiActStationFromGenre (BAR_KS_ARGS); -- cgit v1.2.3