diff options
Diffstat (limited to 'src/ui_act.c')
-rw-r--r-- | src/ui_act.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ui_act.c b/src/ui_act.c index 41b1356..f027594 100644 --- a/src/ui_act.c +++ b/src/ui_act.c @@ -23,6 +23,7 @@ THE SOFTWARE. /* functions responding to user's keystrokes */ #include <string.h> +#include <unistd.h> /* needed by readline */ #include <stdio.h> #include <readline/readline.h> @@ -38,6 +39,23 @@ THE SOFTWARE. BarUiMsg ("No song playing.\n"); \ return; } +/* transform station if necessary to allow changes like rename, rate, ... + * @param piano handle + * @param transform this station + * @return 0 = error, 1 = everything went well + */ +int BarTransformIfShared (PianoHandle_t *ph, PianoStation_t *station) { + /* shared stations must be transformed */ + if (!station->isCreator) { + BarUiMsg ("Transforming station... "); + if (BarUiPrintPianoStatus (PianoTransformShared (ph, station)) != + PIANO_RET_OK) { + return 0; + } + } + return 1; +} + /* print current shortcut configuration */ void BarUiActHelp (BAR_KS_ARGS) { |