diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2010-12-04 15:25:15 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2011-02-26 13:20:14 +0100 |
commit | a79a0c3fb812efac3370c6ed73d37bb8fd1d318e (patch) | |
tree | deaa77ab2cf6ee8c161806f7e21b2037f2c48106 /src/main.c | |
parent | 001bab94bba94766f22a0fab5107bbd51321b369 (diff) | |
download | pianobar-a79a0c3fb812efac3370c6ed73d37bb8fd1d318e.tar.gz pianobar-a79a0c3fb812efac3370c6ed73d37bb8fd1d318e.tar.bz2 pianobar-a79a0c3fb812efac3370c6ed73d37bb8fd1d318e.zip |
Rewrite input processing
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 27 |
1 files changed, 4 insertions, 23 deletions
@@ -50,11 +50,9 @@ THE SOFTWARE. #include "terminal.h" #include "config.h" #include "ui.h" -#include "ui_act.h" +#include "ui_dispatch.h" #include "ui_readline.h" -typedef void (*BarKeyShortcutFunc_t) (BarApp_t *app); - /* copy proxy settings to waitress handle */ static void BarMainLoadProxy (const BarSettings_t *settings, @@ -154,26 +152,9 @@ static void BarMainHandleUserInput (BarApp_t *app) { char buf[2]; if (BarReadline (buf, sizeof (buf), NULL, &app->input, BAR_RL_FULLRETURN | BAR_RL_NOECHO, 1) > 0) { - for (size_t i = 0; i < BAR_KS_COUNT; i++) { - if (app->settings.keys[i] != BAR_KS_DISABLED && - app->settings.keys[i] == buf[0]) { - static const BarKeyShortcutFunc_t idToF[] = {BarUiActHelp, - BarUiActLoveSong, BarUiActBanSong, - BarUiActAddMusic, BarUiActCreateStation, - BarUiActDeleteStation, BarUiActExplain, - BarUiActStationFromGenre, BarUiActHistory, - BarUiActSongInfo, BarUiActAddSharedStation, - BarUiActMoveSong, BarUiActSkipSong, BarUiActPause, - BarUiActQuit, BarUiActRenameStation, - BarUiActSelectStation, BarUiActTempBanSong, - BarUiActPrintUpcoming, BarUiActSelectQuickMix, - BarUiActDebug, BarUiActBookmark, BarUiActVolDown, - BarUiActVolUp}; - idToF[i] (app); - break; - } - } /* end for */ - } /* end if */ + BarUiDispatch (app, buf[0], app->curStation, app->playlist, true, + BAR_DC_GLOBAL); + } } /* append current song to history list and move to the next song |