1 #ifndef COMMAND_H
2 #define COMMAND_H
4 #define MAX_COMMAND_KEYS 3
6 typedef enum
7 {
8 CMD_NONE = 0,
9 CMD_PLAY,
10 CMD_SELECT,
11 CMD_PAUSE,
12 CMD_STOP,
13 CMD_TRACK_NEXT,
14 CMD_TRACK_PREVIOUS,
15 CMD_SHUFFLE,
16 CMD_RANDOM,
17 CMD_CLEAR,
18 CMD_DELETE,
19 CMD_REPEAT,
20 CMD_VOLUME_UP,
21 CMD_VOLUME_DOWN,
22 CMD_SAVE_PLAYLIST,
23 CMD_TOGGLE_FIND_WRAP,
24 CMD_TOGGLE_AUTOCENTER,
25 CMD_LIST_PREVIOUS,
26 CMD_LIST_NEXT,
27 CMD_LIST_FIRST,
28 CMD_LIST_LAST,
29 CMD_LIST_NEXT_PAGE,
30 CMD_LIST_PREVIOUS_PAGE,
31 CMD_LIST_FIND,
32 CMD_LIST_FIND_NEXT,
33 CMD_LIST_RFIND,
34 CMD_LIST_RFIND_NEXT,
35 CMD_SCREEN_UPDATE,
36 CMD_SCREEN_PREVIOUS,
37 CMD_SCREEN_NEXT,
38 CMD_SCREEN_PLAY,
39 CMD_SCREEN_FILE,
40 CMD_SCREEN_SEARCH,
41 CMD_SCREEN_HELP,
42 CMD_QUIT
43 } command_t;
45 typedef struct
46 {
47 int keys[MAX_COMMAND_KEYS];
48 command_t command;
49 char *name;
50 char *description;
51 } command_definition_t;
54 void command_dump_keys(void);
55 int check_key_bindings(void);
56 int write_key_bindings(FILE *f);
58 char *get_key_description(command_t command);
59 char *get_key_command_name(command_t command);
60 char *get_key_names(command_t command, int all);
61 command_t get_key_command(int key);
62 command_t get_key_command_from_name(char *name);
63 int assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]);
65 command_t get_keyboard_command(void);
67 #endif