diff --git a/src/command.c b/src/command.c
index f94481ccc8026bfc73313bd16919da2deedc32dd..733bf6a314567d26a04b78a4c84e26848b1f5640 100644 (file)
--- a/src/command.c
+++ b/src/command.c
#include "config.h"
#include "ncmpc.h"
#include "command.h"
+#include "mpdclient.h"
+#include "screen.h"
#undef DEBUG_KEYS
#define DK(x)
#endif
-extern void sigstop(void);
-extern void screen_resize(void);
-
#define BS KEY_BACKSPACE
#define DEL KEY_DC
#define UP KEY_UP
#define F4 KEY_F(4)
#define F5 KEY_F(5)
#define F6 KEY_F(6)
+#define F7 KEY_F(7)
static command_definition_t cmds[] =
N_("Decrease volume") },
{ { ' ', 0, 0 }, 0, CMD_SELECT, "select",
N_("Select/deselect song in playlist") },
+ { { 't', 0, 0 }, 0, CMD_SELECT_ALL, "select_all",
+ N_("Select all listed items") },
{ { DEL, 'd', 0 }, 0, CMD_DELETE, "delete",
N_("Delete song from playlist") },
{ { 'Z', 0, 0 }, 0, CMD_SHUFFLE, "shuffle",
{ { 'a', 0, 0 }, 0, CMD_ADD, "add",
N_("Add url/file to playlist") },
+ { { '!', 0, 0 }, 0, CMD_GO_ROOT_DIRECTORY, "go-root-directory",
+ N_("Go to root directory") },
+ { { '"', 0, 0 }, 0, CMD_GO_PARENT_DIRECTORY, "go-parent-directory",
+ N_("Go to parent directory") },
/* lists */
{ { 11, 0, 0 }, 0, CMD_LIST_MOVE_UP, "move-up",
{ {'6', F6, 0 }, 0, CMD_SCREEN_CLOCK, "screen-clock",
N_("Clock screen") },
#endif
+#ifdef ENABLE_LYRICS_SCREEN
+ { {'7', F7, 0 }, 0, CMD_SCREEN_LYRICS, "screen-lyrics",
+ N_("Lyrics screen") },
+ { {ESC, 0, 0 }, 0, CMD_INTERRUPT, "lyrics-interrupt",
+ N_("Interrupt action") },
+ { {'u', 0, 0 }, 0, CMD_LYRICS_UPDATE, "lyrics-update",
+ N_("Update Lyrics") },
+#endif
+
{ { -1, -1, -1 }, 0, CMD_NONE, NULL, NULL }
};
return cmds;
}
-char *
+const char *
key2str(int key)
{
static char buf[32];
}
}
-int
+static int
set_key_flags(command_definition_t *cp, command_t command, int flags)
{
int i;
return 1;
}
-char *
+const char *
get_key_names(command_t command, int all)
{
int i;
return NULL;
}
-char *
+const char *
get_key_description(command_t command)
{
int i;
return NULL;
}
-char *
+const char *
get_key_command_name(command_t command)
{
int i;
}
-command_t
+command_t
find_key_command(int key, command_definition_t *cmds)
{
- int i;
+ int i;
+
+ i=0;
+ while (key && cmds && cmds[i].name) {
+ if (cmds[i].keys[0] == key ||
+ cmds[i].keys[1] == key ||
+ cmds[i].keys[2] == key)
+ return cmds[i].command;
+ i++;
+ }
- i=0;
- while( key && cmds && cmds[i].name )
- {
- if( cmds[i].keys[0] == key ||
- cmds[i].keys[1] == key ||
- cmds[i].keys[2] == key )
- return cmds[i].command;
- i++;
- }
- return CMD_NONE;
+ return CMD_NONE;
}
command_t