ncmpc  0.31
Command.hxx
Go to the documentation of this file.
1 /* ncmpc (Ncurses MPD Client)
2  * (c) 2004-2018 The Music Player Daemon Project
3  * Project homepage: http://musicpd.org
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef COMMAND_H
21 #define COMMAND_H
22 
23 #include "config.h"
24 #include "util/Compiler.h"
25 
26 #include <stddef.h>
27 
28 /* commands */
29 enum class Command : unsigned {
30 #ifdef ENABLE_KEYDEF_SCREEN
31  SCREEN_KEYDEF,
32 #endif
33  QUIT,
34 
35  /* movement */
37  LIST_NEXT,
38  LIST_TOP,
41  LIST_FIRST,
42  LIST_LAST,
51 
52  /* basic screens */
56 
57  /* player commands */
58  PLAY,
59  PAUSE,
60  STOP,
61  CROP,
62  TRACK_NEXT,
66  VOLUME_UP,
68  SELECT,
69  SELECT_ALL,
70  DELETE,
71  SHUFFLE,
72  CLEAR,
73  REPEAT,
74  RANDOM,
75  SINGLE,
76  CONSUME,
77  CROSSFADE,
78  DB_UPDATE,
80  ADD,
83  LOCATE,
84 
85  /* lists */
89 
90  /* ncmpc options */
93 
94  /* change screen */
98 
99  /* find */
100  LIST_FIND,
102  LIST_RFIND,
104  LIST_JUMP,
105 
106  /* extra screens */
107 #ifdef ENABLE_ARTIST_SCREEN
108  SCREEN_ARTIST,
109 #endif
110 #ifdef ENABLE_SEARCH_SCREEN
111  SCREEN_SEARCH,
112  SEARCH_MODE,
113 #endif
114 #ifdef ENABLE_SONG_SCREEN
115  SCREEN_SONG,
116 #endif
117 #ifdef ENABLE_LYRICS_SCREEN
118  SCREEN_LYRICS,
119  INTERRUPT,
120  LYRICS_UPDATE,
121  EDIT,
122 #endif
123 #ifdef ENABLE_OUTPUTS_SCREEN
124  SCREEN_OUTPUTS,
125 #endif
126 #ifdef ENABLE_CHAT_SCREEN
127  SCREEN_CHAT,
128 #endif
129 
130  NONE,
131 };
132 
133 typedef struct {
134  const char *name;
135  const char *description;
137 
138 const command_definition_t *
140 
141 gcc_const
142 size_t
144 
145 gcc_pure
146 const char *get_key_description(Command command);
147 
148 gcc_pure
149 const char *get_key_command_name(Command command);
150 
151 gcc_pure
152 Command
153 get_key_command_from_name(const char *name);
154 
155 #endif
const char * description
Definition: Command.hxx:135
Command
Definition: Command.hxx:29
gcc_pure const char * get_key_description(Command command)
const char * name
Definition: Command.hxx:134
gcc_pure const char * get_key_command_name(Command command)
gcc_pure Command get_key_command_from_name(const char *name)
Definition: Command.hxx:133
gcc_const size_t get_cmds_max_name_width()
const command_definition_t * get_command_definitions()