summaryrefslogtreecommitdiff
path: root/src/ui_act.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-10-22 16:34:48 +0200
committerLars-Dominik Braun <lars@6xq.net>2011-10-22 16:34:48 +0200
commitba60fbc4274e85fb63d373207f525aa57bc75eb3 (patch)
treea8ccff14797158942c72f4fbbbf8e37cd8377fbd /src/ui_act.c
parent55d6eb4c91a994bc83560a27296329a6ce0d2329 (diff)
downloadpianobar-ba60fbc4274e85fb63d373207f525aa57bc75eb3.tar.gz
pianobar-ba60fbc4274e85fb63d373207f525aa57bc75eb3.tar.bz2
pianobar-ba60fbc4274e85fb63d373207f525aa57bc75eb3.zip
Support seed stations
Fixes #165
Diffstat (limited to 'src/ui_act.c')
-rw-r--r--src/ui_act.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/ui_act.c b/src/ui_act.c
index c1e7cb7..029be91 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -317,7 +317,8 @@ BarUiActCallback(BarUiActMoveSong) {
reqData.step = 0;
- reqData.to = BarUiSelectStation (app, "Move song to station: ", NULL);
+ reqData.to = BarUiSelectStation (app, app->ph.stations,
+ "Move song to station: ", NULL);
if (reqData.to != NULL) {
/* find original station (just is case we're playing a quickmix
* station) */
@@ -379,8 +380,8 @@ BarUiActCallback(BarUiActRenameStation) {
/* play another station
*/
BarUiActCallback(BarUiActSelectStation) {
- PianoStation_t *newStation = BarUiSelectStation (app, "Select station: ",
- NULL);
+ PianoStation_t *newStation = BarUiSelectStation (app, app->ph.stations,
+ "Select station: ", NULL);
if (newStation != NULL) {
app->curStation = newStation;
BarUiPrintStation (&app->settings, app->curStation);
@@ -474,7 +475,7 @@ BarUiActCallback(BarUiActSelectQuickMix) {
if (selStation->isQuickMix) {
PianoStation_t *toggleStation;
- while ((toggleStation = BarUiSelectStation (app,
+ while ((toggleStation = BarUiSelectStation (app, app->ph.stations,
"Toggle quickmix for station: ",
BarUiActQuickmixCallback)) != NULL) {
toggleStation->useQuickMix = !toggleStation->useQuickMix;
@@ -587,8 +588,9 @@ BarUiActCallback(BarUiActManageStation) {
BarUiActDefaultPianoCall (PIANO_REQUEST_GET_STATION_INFO, &reqData);
BarUiActDefaultEventcmd ("stationfetchinfo");
- BarUiMsg (&app->settings, MSG_QUESTION, "Delete [a]rtist/[s]ong seeds or [f]eedback? ");
- if (BarReadline (selectBuf, sizeof (selectBuf), "asf", &app->input,
+ BarUiMsg (&app->settings, MSG_QUESTION, "Delete [a]rtist/[s]ong/s[t]ation "
+ "seeds or [f]eedback? ");
+ if (BarReadline (selectBuf, sizeof (selectBuf), "astf", &app->input,
BAR_RL_FULLRETURN, -1)) {
if (selectBuf[0] == 'a') {
PianoArtist_t *artist = BarUiSelectArtist (app,
@@ -616,6 +618,19 @@ BarUiActCallback(BarUiActManageStation) {
BarUiActDefaultPianoCall (PIANO_REQUEST_DELETE_SEED, &reqData);
BarUiActDefaultEventcmd ("stationdeletesongseed");
}
+ } else if (selectBuf[0] == 't') {
+ PianoStation_t *station = BarUiSelectStation (app,
+ reqData.info.stationSeeds, "Delete seed station: ", NULL);
+ if (station != NULL) {
+ PianoRequestDataDeleteSeed_t reqData;
+
+ memset (&reqData, 0, sizeof (reqData));
+ reqData.station = station;
+
+ BarUiMsg (&app->settings, MSG_INFO, "Deleting station seed... ");
+ BarUiActDefaultPianoCall (PIANO_REQUEST_DELETE_SEED, &reqData);
+ BarUiActDefaultEventcmd ("stationdeletestationseed");
+ }
} else if (selectBuf[0] == 'f') {
PianoSong_t *song = BarUiSelectSong (&app->settings,
reqData.info.feedback, &app->input);