1 //=========================================================
2 //  MusE
3 //  Linux Music Editor
4 //  $Id: ./muse/shortcuts.cpp $
5 //
6 //  Copyright (C) 1999-2011 by Werner Schweer and others
7 //
8 // Author: Mathias Lundgren <lunar_shuttle@users.sourceforge.net>, (C) 2003
9 //
10 // Copyright: Mathias Lundgren (lunar_shuttle@users.sourceforge.net) (C) 2003
11 //
12 //
13 //  This program is free software; you can redistribute it and/or
14 //  modify it under the terms of the GNU General Public License
15 //  as published by the Free Software Foundation; version 2 of
16 //  the License, or (at your option) any later version.
17 //
18 //  This program is distributed in the hope that it will be useful,
19 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 //  GNU General Public License for more details.
22 //
23 //  You should have received a copy of the GNU General Public License
24 //  along with this program; if not, write to the Free Software
25 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
26 //
27 //=========================================================
28 //
29 // C++ Implementation: shortcuts
30 //
31 // Description:
32 // Definition of shortcuts used in the application
33 //
34 
35 #include "shortcuts.h"
36 #include <QTranslator>
37 #include <QKeySequence>
38 
39 namespace MusEGui {
40 
41 ShortCut shortcuts[SHRT_NUM_OF_ELEMENTS];
defShrt(int shrt,int key,const char * descr,int type,const char * xml)42 void defShrt(int shrt, int key, const char* descr, int type, const char* xml)
43 {
44       shortcuts[shrt].key   = key;
45       shortcuts[shrt].descr = descr;
46       shortcuts[shrt].type  = type;
47       shortcuts[shrt].xml   = xml;
48 }
49 
initShortCuts()50 void initShortCuts()
51       {
52       //Global:
53       defShrt(SHRT_PLAY_SONG,     Qt::Key_Enter, QT_TRANSLATE_NOOP("shortcuts", "Transport: Start playback from current location"), GLOBAL_SHRT, "play");
54       defShrt(SHRT_TOGGLE_METRO,  Qt::Key_C,     QT_TRANSLATE_NOOP("shortcuts", "Transport: Toggle metronome"), GLOBAL_SHRT,"toggle_metro");
55       defShrt(SHRT_STOP,          Qt::Key_Insert,QT_TRANSLATE_NOOP("shortcuts", "Transport: Stop Playback"), GLOBAL_SHRT, "stop");
56       defShrt(SHRT_GOTO_START,    Qt::Key_W,     QT_TRANSLATE_NOOP("shortcuts", "Transport: Goto Start"), GLOBAL_SHRT, "goto_start");
57       defShrt(SHRT_GOTO_END,      Qt::SHIFT + Qt::Key_E,     QT_TRANSLATE_NOOP("shortcuts", "Transport: Goto End"), GLOBAL_SHRT, "goto_end");
58 
59       defShrt(SHRT_PLAY_TOGGLE,   Qt::Key_Space, QT_TRANSLATE_NOOP("shortcuts", "Transport: Play, Stop, Rewind"), GLOBAL_SHRT, "play_toggle");
60       defShrt(SHRT_REC_RESTART,   Qt::CTRL + Qt::Key_Space, QT_TRANSLATE_NOOP("shortcuts", "Transport: Restart recording"), GLOBAL_SHRT, "rec_restart");
61       defShrt(SHRT_REC_RESTART_MULTI,   Qt::SHIFT + Qt::Key_Space, QT_TRANSLATE_NOOP("shortcuts", "Transport: Restart recording (multi take)"), GLOBAL_SHRT, "rec_restart_multi");
62       defShrt(SHRT_GOTO_LEFT,     Qt::Key_End,   QT_TRANSLATE_NOOP("shortcuts", "Transport: Goto left marker")  , GLOBAL_SHRT, "goto_left");
63       defShrt(SHRT_GOTO_RIGHT,    Qt::Key_PageDown,  QT_TRANSLATE_NOOP("shortcuts", "Transport: Goto right marker") , GLOBAL_SHRT, "goto_right");
64       defShrt(SHRT_TOGGLE_LOOP,   Qt::Key_Slash, QT_TRANSLATE_NOOP("shortcuts", "Transport: Toggle Loop section"), GLOBAL_SHRT, "toggle_loop");
65       defShrt(SHRT_START_REC,     Qt::Key_Asterisk, QT_TRANSLATE_NOOP("shortcuts", "Transport: Toggle Record"),    GLOBAL_SHRT, "toggle_rec");
66       defShrt(SHRT_REC_ARM_TRACK, Qt::CTRL + Qt::Key_Return, QT_TRANSLATE_NOOP("shortcuts", "Transport: Arm current track"),    GLOBAL_SHRT, "rec_arm_track");
67       defShrt(SHRT_REC_CLEAR,     Qt::Key_Backspace, QT_TRANSLATE_NOOP("shortcuts", "Transport: Clear all rec enabled tracks"),    GLOBAL_SHRT, "rec_clear");
68       defShrt(SHRT_FULLSCREEN,    Qt::CTRL + Qt::Key_F, QT_TRANSLATE_NOOP("shortcuts", "Toggle fullscreen"), GLOBAL_SHRT, "fullscreen");
69       defShrt(SHRT_TABBED_WIN,    Qt::Key_F4, QT_TRANSLATE_NOOP("shortcuts", "Toggle tabbed/floating editor window"), GLOBAL_SHRT, "tabbed_win");
70       defShrt(SHRT_TOGGLE_DOCKS,  Qt::Key_F7, QT_TRANSLATE_NOOP("shortcuts", "Toggle docks display"), GLOBAL_SHRT, "docks_display");
71       defShrt(SHRT_TOGGLE_REWINDONSTOP,       Qt::CTRL + Qt::SHIFT + Qt::Key_R, QT_TRANSLATE_NOOP("shortcuts", "Toggle rewind on stop"), GLOBAL_SHRT, "rewindonstop");
72       defShrt(SHRT_ARRANGER,      Qt::META + Qt::Key_A, QT_TRANSLATE_NOOP("shortcuts", "Show Arranger window"), GLOBAL_SHRT, "arranger");
73 
74       defShrt(SHRT_CONFIG_SHORTCUTS, Qt::CTRL + Qt::SHIFT + Qt::Key_F1, QT_TRANSLATE_NOOP("shortcuts", "Settings: Configure shortcuts"), GLOBAL_SHRT, "configure_key_shortcuts");
75 
76       defShrt(SHRT_COPY,          Qt::CTRL + Qt::Key_C, QT_TRANSLATE_NOOP("shortcuts", "Edit: Copy"), INVIS_SHRT, "copy");
77       defShrt(SHRT_COPY_RANGE,    Qt::CTRL + Qt::SHIFT + Qt::Key_C, QT_TRANSLATE_NOOP("shortcuts", "Edit: Copy in range"), SCORE_SHRT + PROLL_SHRT + DEDIT_SHRT + ARRANG_SHRT, "copy_range");
78       defShrt(SHRT_UNDO,          Qt::CTRL + Qt::Key_Z, QT_TRANSLATE_NOOP("shortcuts", "Edit: Undo"), INVIS_SHRT, "undo");
79       defShrt(SHRT_REDO,          Qt::CTRL + Qt::SHIFT + Qt::Key_Z, QT_TRANSLATE_NOOP("shortcuts", "Edit: Redo"), INVIS_SHRT, "redo");
80       defShrt(SHRT_CUT,           Qt::CTRL + Qt::Key_X, QT_TRANSLATE_NOOP("shortcuts", "Edit: Cut"), INVIS_SHRT, "cut");
81       defShrt(SHRT_PASTE,         Qt::CTRL + Qt::Key_V, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste"), INVIS_SHRT, "paste");
82       defShrt(SHRT_PASTE_TO_CUR_PART, Qt::CTRL + Qt::SHIFT + Qt::Key_V, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste to current part"), PROLL_SHRT + DEDIT_SHRT, "paste_to_current_part");
83       defShrt(SHRT_PASTE_TO_TRACK, Qt::CTRL + Qt::SHIFT + Qt::Key_V, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste to selected track"), ARRANG_SHRT, "paste_to_track");
84       defShrt(SHRT_PASTE_CLONE,   Qt::CTRL + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste clone"), ARRANG_SHRT, "paste_clones");
85       defShrt(SHRT_PASTE_CLONE_TO_TRACK,  Qt::CTRL + Qt::SHIFT + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste clone to selected track"), ARRANG_SHRT, "paste_clones_to_track");
86       defShrt(SHRT_PASTE_DIALOG,  Qt::CTRL + Qt::Key_G, QT_TRANSLATE_NOOP("shortcuts", "Edit: Paste (with dialog)"), SCORE_SHRT + PROLL_SHRT + DEDIT_SHRT + ARRANG_SHRT, "paste_with_dialog");
87       defShrt(SHRT_DELETE,        Qt::Key_Delete, QT_TRANSLATE_NOOP("shortcuts", "Edit: Delete"), INVIS_SHRT, "delete");
88 
89       //-----------------------------------------------------------
90       // Arranger:
91       defShrt(SHRT_NEW,           Qt::CTRL + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "File: New project"), ARRANG_SHRT + DEDIT_SHRT, "new_project");
92       defShrt(SHRT_NEW_FROM_TEMPLATE, Qt::CTRL + Qt::SHIFT + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "File: New project from template"), ARRANG_SHRT + DEDIT_SHRT, "new_project_from_template");
93       defShrt(SHRT_OPEN,          Qt::CTRL + Qt::Key_O, QT_TRANSLATE_NOOP("shortcuts", "File: Open from disk"), ARRANG_SHRT + DEDIT_SHRT, "open_project");
94       defShrt(SHRT_SAVE,          Qt::CTRL + Qt::Key_S, QT_TRANSLATE_NOOP("shortcuts", "File: Save project"), ARRANG_SHRT + DEDIT_SHRT, "save_project");
95       //-----------------------------------------------------------
96 
97       defShrt(SHRT_OPEN_RECENT,           Qt::CTRL + Qt::Key_1, QT_TRANSLATE_NOOP("shortcuts", "File: Open recent file"), ARRANG_SHRT, "open_recent");
98       defShrt(SHRT_SAVE_AS,               0 , QT_TRANSLATE_NOOP("shortcuts", "File: Save as"), ARRANG_SHRT, "save_project_as");
99       defShrt(SHRT_SAVE_AS_NEW_PROJECT,   0 , QT_TRANSLATE_NOOP("shortcuts", "File: Save as new project"), ARRANG_SHRT, "save_new_project_as");
100       defShrt(SHRT_SAVE_REVISION,         Qt::SHIFT + Qt::Key_R, QT_TRANSLATE_NOOP("shortcuts", "File: Save revision"), ARRANG_SHRT, "save_project_new_revision");
101       defShrt(SHRT_SAVE_AS_TEMPLATE,      0 , QT_TRANSLATE_NOOP("shortcuts", "File: Save as template"), ARRANG_SHRT, "save_project_template");
102 
103       defShrt(SHRT_LOAD_TEMPLATE,         0 , QT_TRANSLATE_NOOP("shortcuts", "File: Load template"), ARRANG_SHRT, "load_template");
104 //      defShrt(SHRT_CONFIG_PRINTER,        Qt::CTRL + Qt::Key_P, QT_TRANSLATE_NOOP("shortcuts", "Configure printer"), ARRANG_SHRT, "config_printer");
105       defShrt(SHRT_IMPORT_MIDI,           0 , QT_TRANSLATE_NOOP("shortcuts", "File: Import midi file"), ARRANG_SHRT, "import_midi");
106       defShrt(SHRT_EXPORT_MIDI,           0 , QT_TRANSLATE_NOOP("shortcuts", "File: Export midi file"), ARRANG_SHRT, "export_midi");
107       defShrt(SHRT_IMPORT_PART,           0 , QT_TRANSLATE_NOOP("shortcuts", "File: Import midi part"), ARRANG_SHRT, "import_part");
108       defShrt(SHRT_IMPORT_AUDIO,          0 , QT_TRANSLATE_NOOP("shortcuts", "File: Import audio file"), ARRANG_SHRT, "import_audio");
109       defShrt(SHRT_QUIT,                  0, QT_TRANSLATE_NOOP("shortcuts", "File: Quit MusE"), ARRANG_SHRT, "quit");
110 //      defShrt(SHRT_DESEL_PARTS,           Qt::CTRL + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Deselect all parts"), ARRANG_SHRT, "deselect_parts");
111 
112       defShrt(SHRT_RENAME_PART,           0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Rename part"), ARRANG_SHRT, "rename_part_on_track");
113       defShrt(SHRT_SELECT_PRTSTRACK,      Qt::CTRL+ Qt::ALT + Qt::Key_P, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select parts on track"), ARRANG_SHRT, "select_parts_on_track");
114       defShrt(SHRT_OPEN_PIANO,            Qt::CTRL + Qt::Key_E, QT_TRANSLATE_NOOP("shortcuts", "Open pianoroll"), ARRANG_SHRT, "open_pianoroll");
115       defShrt(SHRT_OPEN_DRUMS,            Qt::CTRL + Qt::Key_D, QT_TRANSLATE_NOOP("shortcuts", "Open drumeditor"), ARRANG_SHRT, "open_drumedit");
116       defShrt(SHRT_OPEN_LIST,             Qt::CTRL + Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "Open listeditor"), ARRANG_SHRT, "open_listedit");
117       defShrt(SHRT_OPEN_WAVE,             Qt::CTRL + Qt::Key_Y, QT_TRANSLATE_NOOP("shortcuts", "Open waveeditor"), ARRANG_SHRT, "open_waveeditor");
118       defShrt(SHRT_OPEN_GRAPHIC_MASTER,   Qt::CTRL + Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Open graphical mastertrack editor"), ARRANG_SHRT, "open_graph_master");
119       defShrt(SHRT_OPEN_LIST_MASTER,      Qt::CTRL + Qt::SHIFT + Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Open list mastertrack editor"), ARRANG_SHRT, "open_list_master");
120       defShrt(SHRT_OPEN_MIDI_TRANSFORM,   Qt::CTRL + Qt::Key_T, QT_TRANSLATE_NOOP("shortcuts", "Open midi transformer"), ARRANG_SHRT, "open_midi_transform");
121       defShrt(SHRT_OPEN_PLUGIN_GUI,       Qt::CTRL + Qt::Key_U, QT_TRANSLATE_NOOP("shortcuts", "Open track Synth GUI"), ARRANG_SHRT, "open_plugin_gui");
122 
123       defShrt(SHRT_OPEN_PIANO_NEW,        Qt::CTRL + Qt::SHIFT + Qt::Key_E, QT_TRANSLATE_NOOP("shortcuts", "Open pianoroll in new window"), ARRANG_SHRT, "open_pianoroll_new");
124       defShrt(SHRT_OPEN_DRUMS_NEW,        Qt::CTRL + Qt::SHIFT + Qt::ALT + Qt::Key_D, QT_TRANSLATE_NOOP("shortcuts", "Open drumeditor in new window"), ARRANG_SHRT, "open_drumedit_new");
125       defShrt(SHRT_OPEN_LIST_NEW,         Qt::CTRL + Qt::SHIFT + Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "Open listeditor in new window"), ARRANG_SHRT, "open_listedit_new");
126       defShrt(SHRT_OPEN_WAVE_NEW,         Qt::CTRL + Qt::SHIFT + Qt::Key_Y, QT_TRANSLATE_NOOP("shortcuts", "Open waveeditor in new window"), ARRANG_SHRT, "open_waveeditor_new");
127 
128 
129       defShrt(SHRT_ADD_MIDI_TRACK,        Qt::SHIFT + Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Add midi track"), ARRANG_SHRT, "add_midi_track");
130       defShrt(SHRT_ADD_DRUM_TRACK,        Qt::SHIFT + Qt::Key_D, QT_TRANSLATE_NOOP("shortcuts", "Add drum track"), ARRANG_SHRT, "add_drum_track");
131       defShrt(SHRT_ADD_WAVE_TRACK,        Qt::SHIFT + Qt::Key_W, QT_TRANSLATE_NOOP("shortcuts", "Add wave track"), ARRANG_SHRT, "add_wave_track");
132       defShrt(SHRT_ADD_AUDIO_OUTPUT,      Qt::SHIFT + Qt::Key_O, QT_TRANSLATE_NOOP("shortcuts", "Add audio output track"), ARRANG_SHRT, "add_audio_output");
133       defShrt(SHRT_ADD_AUDIO_GROUP,       Qt::SHIFT + Qt::Key_G, QT_TRANSLATE_NOOP("shortcuts", "Add audio group track"), ARRANG_SHRT, "add_audio_group");
134       defShrt(SHRT_ADD_AUDIO_INPUT,       Qt::SHIFT + Qt::Key_I, QT_TRANSLATE_NOOP("shortcuts", "Add audio input track"), ARRANG_SHRT, "add_audio_input");
135       defShrt(SHRT_ADD_AUDIO_AUX  ,       Qt::SHIFT + Qt::Key_A, QT_TRANSLATE_NOOP("shortcuts", "Add audio aux track"), ARRANG_SHRT, "add_audio_aux");
136       defShrt(SHRT_ADD_SYNTH_TRACK,       Qt::SHIFT + Qt::Key_S, QT_TRANSLATE_NOOP("shortcuts", "Add synth track dialog"), ARRANG_SHRT, "add_synth_track");
137 
138       defShrt(SHRT_INSERT_MIDI_TRACK,        0, QT_TRANSLATE_NOOP("shortcuts", "Insert midi track"), ARRANG_SHRT, "insert_midi_track");
139       defShrt(SHRT_INSERT_DRUM_TRACK,        0, QT_TRANSLATE_NOOP("shortcuts", "Insert drum track"), ARRANG_SHRT, "insert_drum_track");
140       defShrt(SHRT_INSERT_WAVE_TRACK,        0, QT_TRANSLATE_NOOP("shortcuts", "Insert wave track"), ARRANG_SHRT, "insert_wave_track");
141       defShrt(SHRT_INSERT_AUDIO_OUTPUT,      0, QT_TRANSLATE_NOOP("shortcuts", "Insert audio output track"), ARRANG_SHRT, "insert_audio_output");
142       defShrt(SHRT_INSERT_AUDIO_GROUP,       0, QT_TRANSLATE_NOOP("shortcuts", "Insert audio group track"), ARRANG_SHRT, "insert_audio_group");
143       defShrt(SHRT_INSERT_AUDIO_INPUT,       0, QT_TRANSLATE_NOOP("shortcuts", "Insert audio input track"), ARRANG_SHRT, "insert_audio_input");
144       defShrt(SHRT_INSERT_AUDIO_AUX  ,       0, QT_TRANSLATE_NOOP("shortcuts", "Insert audio aux track"), ARRANG_SHRT, "insert_audio_aux");
145       defShrt(SHRT_INSERT_SYNTH_TRACK,       0, QT_TRANSLATE_NOOP("shortcuts", "Insert synth track dialog"), ARRANG_SHRT, "insert_synth_track");
146 
147       defShrt(SHRT_GLOBAL_CUT,            0, QT_TRANSLATE_NOOP("shortcuts", "Structure: Global cut"), ARRANG_SHRT, "global_cut");
148       defShrt(SHRT_GLOBAL_INSERT,         0, QT_TRANSLATE_NOOP("shortcuts", "Structure: Global insert"), ARRANG_SHRT, "global_insert");
149       defShrt(SHRT_GLOBAL_SPLIT,          0, QT_TRANSLATE_NOOP("shortcuts", "Structure: Global split"), ARRANG_SHRT,  "global_split");
150       defShrt(SHRT_CUT_EVENTS,            0, QT_TRANSLATE_NOOP("shortcuts", "Structure: Cut events"), ARRANG_SHRT,    "cut_events");
151       //defShrt(SHRT_OPEN_MIXER,            Qt::Key_F10, QT_TRANSLATE_NOOP("shortcuts", "View: Open mixer window"), ARRANG_SHRT, "toggle_mixer");
152       defShrt(SHRT_OPEN_MIXER,            Qt::Key_F10, QT_TRANSLATE_NOOP("shortcuts", "View: Open mixer #1 window"), ARRANG_SHRT, "toggle_mixer");
153       defShrt(SHRT_OPEN_MIXER2,           Qt::CTRL + Qt::Key_F10, QT_TRANSLATE_NOOP("shortcuts", "View: Open mixer #2 window"), ARRANG_SHRT, "toggle_mixer2");
154       defShrt(SHRT_OPEN_TRANSPORT,        Qt::Key_F11, QT_TRANSLATE_NOOP("shortcuts", "View: Toggle transport window"), ARRANG_SHRT, "toggle_transport");
155       defShrt(SHRT_OPEN_BIGTIME,          Qt::Key_F12, QT_TRANSLATE_NOOP("shortcuts", "View: Toggle bigtime window"), ARRANG_SHRT,   "toggle_bigtime");
156       defShrt(SHRT_OPEN_MARKER,           Qt::Key_F9, QT_TRANSLATE_NOOP("shortcuts", "View: Open marker window"), ARRANG_SHRT,   "marker_window");
157       defShrt(SHRT_HIDE_MIXER_STRIP,      Qt::Key_F3, QT_TRANSLATE_NOOP("shortcuts", "View: Toggle mixer strip display"), ARRANG_SHRT, "toggle_mixer_strip");
158 
159       defShrt(SHRT_FOLLOW_JUMP,           0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Follow song by page"), ARRANG_SHRT, "follow_jump");
160       defShrt(SHRT_FOLLOW_NO,             0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Follow song off"), ARRANG_SHRT, "follow_no");
161       defShrt(SHRT_FOLLOW_CONTINUOUS,     0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Follow song continuous"), ARRANG_SHRT, "follow_continuous");
162 
163       defShrt(SHRT_GLOBAL_CONFIG,         0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Global configuration"), ARRANG_SHRT, "configure_global");
164       //defShrt(SHRT_CONFIG_SHORTCUTS,      Qt::CTRL + Qt::SHIFT + Qt::Key_F1, QT_TRANSLATE_NOOP("shortcuts", "Settings: Configure shortcuts"), ARRANG_SHRT, "configure_key_shortcuts");
165       defShrt(SHRT_CONFIG_METRONOME,      0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Configure metronome"), ARRANG_SHRT, "configure_metronome");
166       defShrt(SHRT_CONFIG_MIDISYNC,       0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Midi sync configuration"), ARRANG_SHRT, "configure_midi_sync");
167       defShrt(SHRT_MIDI_FILE_CONFIG,      0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Midi file import/export configuration"), ARRANG_SHRT, "configure_midi_file");
168       defShrt(SHRT_APPEARANCE_SETTINGS,   0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Appearance settings"), ARRANG_SHRT, "configure_appearance_settings");
169       defShrt(SHRT_CONFIG_MIDI_PORTS,     0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Midi ports / Soft synths"), ARRANG_SHRT, "configure_midi_ports");
170       defShrt(SHRT_CONFIG_AUDIO_PORTS,    0, QT_TRANSLATE_NOOP("shortcuts", "Settings: Audio subsystem configuration"), ARRANG_SHRT, "configure_audio_ports");
171       //defShrt(SHRT_SAVE_GLOBAL_CONFIG,    0, QT_TRANSLATE_NOOP("shortcuts", "Save global configuration"), ARRANG_SHRT, "configure_save_global");
172 
173       defShrt(SHRT_MIDI_EDIT_INSTRUMENTS, 0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Edit midi instruments"), ARRANG_SHRT, "midi_edit_instruments");
174       defShrt(SHRT_MIDI_INPUT_TRANSFORM,  0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Open midi input transform"), ARRANG_SHRT, "midi_open_input_transform");
175       defShrt(SHRT_MIDI_INPUT_FILTER,     0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Open midi input filter"), ARRANG_SHRT, "midi_open_input_filter");
176       defShrt(SHRT_MIDI_INPUT_TRANSPOSE,  0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Midi input transpose"), ARRANG_SHRT, "midi_open_input_transpose");
177       defShrt(SHRT_MIDI_REMOTE_CONTROL,   0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Midi remote control"), ARRANG_SHRT, "midi_remote_control");
178 #ifdef BUILD_EXPERIMENTAL
179       defShrt(SHRT_RANDOM_RHYTHM_GENERATOR,0,QT_TRANSLATE_NOOP("shortcuts", "Midi: Random rhythm generator"), ARRANG_SHRT, "midi_random_rhythm_generator");
180 #endif
181       defShrt(SHRT_MIDI_RESET,            0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Reset midi"), ARRANG_SHRT, "midi_reset");
182       defShrt(SHRT_MIDI_INIT,             0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Init midi"), ARRANG_SHRT, "midi_init");
183       defShrt(SHRT_MIDI_LOCAL_OFF,        0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Midi local off"), ARRANG_SHRT, "midi_local_off");
184 
185       defShrt(SHRT_AUDIO_BOUNCE_TO_TRACK, 0, QT_TRANSLATE_NOOP("shortcuts", "Audio: Bounce audio to track"), ARRANG_SHRT, "audio_bounce_to_track");
186       defShrt(SHRT_AUDIO_BOUNCE_TO_FILE,  0, QT_TRANSLATE_NOOP("shortcuts", "Audio: Bounce audio to file"), ARRANG_SHRT, "audio_bounce_to_file");
187       defShrt(SHRT_AUDIO_RESTART,         0, QT_TRANSLATE_NOOP("shortcuts", "Audio: Restart audio"), ARRANG_SHRT, "audio_restart");
188 
189 // REMOVE Tim. automation. Removed.
190 // Deprecated. MusEGlobal::automation is now fixed TRUE
191 //  for now until we decide what to do with it.
192 //       defShrt(SHRT_MIXER_AUTOMATION,      0, QT_TRANSLATE_NOOP("shortcuts", "Automation: Mixer automation"), ARRANG_SHRT, "mixer_automation");
193       defShrt(SHRT_MIXER_SNAPSHOT,        0, QT_TRANSLATE_NOOP("shortcuts", "Automation: Take mixer snapshot"), ARRANG_SHRT, "mixer_snapshot");
194       defShrt(SHRT_MIXER_AUTOMATION_CLEAR,0, QT_TRANSLATE_NOOP("shortcuts", "Automation: Clear mixer automation"), ARRANG_SHRT, "mixer_automation_clear");
195 
196 //      defShrt(SHRT_OPEN_CLIPS,            0, QT_TRANSLATE_NOOP("shortcuts", "View audio clips"), ARRANG_SHRT,                  "view_audio_clips");
197       defShrt(SHRT_OPEN_HELP,             Qt::Key_F1, QT_TRANSLATE_NOOP("shortcuts", "Help: Open Manual"), ARRANG_SHRT,        "open_help");
198       defShrt(SHRT_START_WHATSTHIS,       Qt::SHIFT + Qt::Key_F1, QT_TRANSLATE_NOOP("shortcuts", "Help: Toggle whatsthis mode"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "toggle_whatsthis");
199 
200       defShrt(SHRT_EDIT_PART,             Qt::Key_Return, QT_TRANSLATE_NOOP("shortcuts", "Edit: Edit selected part"), ARRANG_SHRT, "edit_selected_part");
201       defShrt(SHRT_SEL_ABOVE,             Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select nearest part on track above"), ARRANG_SHRT, "sel_part_above");
202       defShrt(SHRT_SEL_ABOVE_ADD,         Qt::SHIFT + Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Edit: Add nearest part on track above"), ARRANG_SHRT, "sel_part_above_add");
203       defShrt(SHRT_SEL_BELOW,             Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select nearest part on track below"), ARRANG_SHRT, "sel_part_below");
204       defShrt(SHRT_SEL_BELOW_ADD,         Qt::SHIFT + Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Edit: Add nearest part on track below"), ARRANG_SHRT, "sel_part_below_add");
205 
206       defShrt(SHRT_INSERTMEAS,            Qt::CTRL + Qt::SHIFT + Qt::Key_O, QT_TRANSLATE_NOOP("shortcuts", "Edit: Insert empty measure"), ARRANG_SHRT, "insert_measure");
207       defShrt(SHRT_DUPLICATE_TRACK,       Qt::CTRL + Qt::SHIFT + Qt::Key_D, QT_TRANSLATE_NOOP("shortcuts", "Edit: Duplicate track"), ARRANG_SHRT, "duplicate_track");
208       defShrt(SHRT_MOVEUP_TRACK,          Qt::CTRL + Qt::SHIFT + Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Edit: Move tracks up"), ARRANG_SHRT, "moveup_track");
209       defShrt(SHRT_MOVEDOWN_TRACK,        Qt::CTRL + Qt::SHIFT + Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Edit: Move tracks down"), ARRANG_SHRT, "movedown_track");
210       defShrt(SHRT_MOVETOP_TRACK,         Qt::CTRL + Qt::SHIFT + Qt::Key_Home, QT_TRANSLATE_NOOP("shortcuts", "Edit: Move tracks to top"), ARRANG_SHRT, "movetop_track");
211       defShrt(SHRT_MOVEBOTTOM_TRACK,      Qt::CTRL + Qt::SHIFT + Qt::Key_End, QT_TRANSLATE_NOOP("shortcuts", "Edit: Move tracks to bottom"), ARRANG_SHRT, "movebottom_track");
212 
213       defShrt(SHRT_SEL_TRACK_ABOVE,       Qt::CTRL + Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Select track above"), ARRANG_SHRT, "sel_track_above");
214       defShrt(SHRT_SEL_TRACK_BELOW,       Qt::CTRL + Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Select track below"), ARRANG_SHRT, "sel_track_below");
215       defShrt(SHRT_EDIT_TRACK_NAME,       Qt::Key_F2, QT_TRANSLATE_NOOP("shortcuts", "Edit selected track name"), ARRANG_SHRT, "edit_track_name");
216 
217       defShrt(SHRT_MUTE_CURRENT_TRACKS,   Qt::META + Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Mute all currently selected tracks"), ARRANG_SHRT, "mute_curren_tracks");
218       defShrt(SHRT_SOLO_CURRENT_TRACKS,   Qt::META + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Solo all currently selected tracks"), ARRANG_SHRT, "solo_curren_tracks");
219 
220       //-----------------------------------------------------------
221 
222       defShrt(SHRT_TRANSPOSE,       0, QT_TRANSLATE_NOOP("shortcuts", "Midi: Transpose"), ARRANG_SHRT + PROLL_SHRT + SCORE_SHRT, "midi_transpose");
223 
224       //-----------------------------------------------------------
225 
226       defShrt(SHRT_SELECT_ALL,       Qt::CTRL + Qt::Key_A, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select all"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT + SCORE_SHRT, "sel_all");
227       defShrt(SHRT_SELECT_NONE,      Qt::CTRL + Qt::SHIFT + Qt::Key_A, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select none"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT + SCORE_SHRT, "sel_none");
228       defShrt(SHRT_SELECT_INVERT,    Qt::CTRL + Qt::Key_I, QT_TRANSLATE_NOOP("shortcuts", "Edit: Invert Selection"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + SCORE_SHRT,  "sel_inv");
229       defShrt(SHRT_SELECT_ILOOP,     0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select events/parts inside locators"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + SCORE_SHRT,  "sel_ins_loc");
230       defShrt(SHRT_SELECT_OLOOP,     0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select events/parts outside locators"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + SCORE_SHRT, "sel_out_loc");
231       defShrt(SHRT_SELECT_PREV_PART, Qt::ALT + Qt::Key_Left, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select previous part"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "sel_prv_prt");
232       defShrt(SHRT_SELECT_NEXT_PART, Qt::ALT + Qt::Key_Right, QT_TRANSLATE_NOOP("shortcuts", "Edit: Select next part"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "sel_nxt_prt");
233       defShrt(SHRT_SEL_LEFT,         Qt::Key_Left,  QT_TRANSLATE_NOOP("shortcuts", "Edit: Select nearest part/event to the left or move cursor"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "sel_left");
234       defShrt(SHRT_SEL_LEFT_ADD,     Qt::Key_Left + Qt::SHIFT,  QT_TRANSLATE_NOOP("shortcuts", "Edit: Add nearest part/event to the left to selection"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "sel_left_add");
235       defShrt(SHRT_SEL_RIGHT,        Qt::Key_Right,  QT_TRANSLATE_NOOP("shortcuts", "Edit: Select nearest part/event to the right or move cursor"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT,"sel_right");
236       defShrt(SHRT_SEL_RIGHT_ADD,    Qt::Key_Right + Qt::SHIFT, QT_TRANSLATE_NOOP("shortcuts", "Edit: Add nearest part/event to the right to selection"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT,"sel_right_add");
237       defShrt(SHRT_LOCATORS_TO_SELECTION, Qt::ALT + Qt::Key_P, QT_TRANSLATE_NOOP("shortcuts", "Edit: Set range markers to selection"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "loc_to_sel");
238       defShrt(SHRT_INC_PITCH,        Qt::CTRL + Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Edit: Increase pitch"), PROLL_SHRT + DEDIT_SHRT, "sel_inc_pitch");
239       defShrt(SHRT_DEC_PITCH,        Qt::CTRL + Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Edit: Decrease pitch"), PROLL_SHRT + DEDIT_SHRT, "sel_dec_pitch");
240       defShrt(SHRT_INC_POS,          Qt::CTRL + Qt::Key_Right,  QT_TRANSLATE_NOOP("shortcuts", "Edit: Increase event position"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "sel_inc_pos");
241       defShrt(SHRT_DEC_POS,          Qt::CTRL + Qt::Key_Left,   QT_TRANSLATE_NOOP("shortcuts", "Edit: Decrease event position"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "sel_dec_pos");
242       defShrt(SHRT_ZOOM_IN,          Qt::CTRL + Qt::Key_PageUp,   QT_TRANSLATE_NOOP("shortcuts", "View: Zoom in"),  PROLL_SHRT + DEDIT_SHRT + ARRANG_SHRT + WAVE_SHRT, "zoom_in");
243       defShrt(SHRT_ZOOM_OUT,         Qt::CTRL + Qt::Key_PageDown, QT_TRANSLATE_NOOP("shortcuts", "View: Zoom out"), PROLL_SHRT + DEDIT_SHRT + ARRANG_SHRT + WAVE_SHRT, "zoom_out");
244       defShrt(SHRT_GOTO_CPOS,        Qt::Key_I, QT_TRANSLATE_NOOP("shortcuts", "View: Goto Current Position"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "goto_cpos");
245       defShrt(SHRT_SCROLL_LEFT,      Qt::Key_H, QT_TRANSLATE_NOOP("shortcuts", "View: Scroll left"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "scroll_left");
246       defShrt(SHRT_SCROLL_RIGHT,     Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "View: Scroll left"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "scroll_right");
247 
248       defShrt(SHRT_STEP_RECORD,      Qt::CTRL + Qt::Key_R, QT_TRANSLATE_NOOP("shortcuts", "Transport: Step record"), PROLL_SHRT + DEDIT_SHRT, "step_record");
249       defShrt(SHRT_MIDI_INPUT,       Qt::CTRL + Qt::Key_U, QT_TRANSLATE_NOOP("shortcuts", "Transport: Midi input"), PROLL_SHRT + DEDIT_SHRT, "midi_input");
250       defShrt(SHRT_PLAY_EVENTS,      Qt::CTRL + Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "Transport: Play events"), PROLL_SHRT + DEDIT_SHRT, "play_events");
251       defShrt(SHRT_INC_VELOCITY,     Qt::ALT + Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Edit: Increase velocity"), PROLL_SHRT + DEDIT_SHRT, "increase_velocity");
252       defShrt(SHRT_DEC_VELOCITY,     Qt::ALT + Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Edit: Decrease velocity"), PROLL_SHRT + DEDIT_SHRT, "decrease_velocity");
253 
254       //-----------------------------------------------------------
255       //Drum:
256       //-----------------------------------------------------------
257 
258       defShrt(SHRT_FIXED_LEN,   Qt::ALT + Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "Edit: Set Fixed Length on Midi Events"), PROLL_SHRT + DEDIT_SHRT + SCORE_SHRT, "midi_fixed_len");
259 
260       //-----------------------------------------------------------
261       //Pianoroll:
262       //-----------------------------------------------------------
263 
264       defShrt(SHRT_QUANTIZE,    0, QT_TRANSLATE_NOOP("shortcuts", "Quantize"), PROLL_SHRT + DEDIT_SHRT + SCORE_SHRT, "midi_quant");
265       defShrt(SHRT_MODIFY_GATE_TIME, 0, QT_TRANSLATE_NOOP("shortcuts", "Modify Note Length"), PROLL_SHRT + SCORE_SHRT, "midi_mod_gate_time");
266       defShrt(SHRT_MODIFY_VELOCITY,  0, QT_TRANSLATE_NOOP("shortcuts", "Modify Velocity"), PROLL_SHRT + DEDIT_SHRT + SCORE_SHRT,  "midi_mod_velo");
267       defShrt(SHRT_CRESCENDO,        0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Crescendo"), PROLL_SHRT + DEDIT_SHRT, "midi_crescendo");
268       defShrt(SHRT_THIN_OUT,         0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Thin Out"), PROLL_SHRT + DEDIT_SHRT, "midi_thin_out");
269       defShrt(SHRT_ERASE_EVENT,      0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Erase Event"), PROLL_SHRT + DEDIT_SHRT + SCORE_SHRT, "midi_erase_event");
270       defShrt(SHRT_DELETE_OVERLAPS,  0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Delete Overlaps"), PROLL_SHRT + DEDIT_SHRT + SCORE_SHRT, "midi_delete_overlaps");
271       defShrt(SHRT_NOTE_SHIFT,       0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Note Shift"), PROLL_SHRT + DEDIT_SHRT + SCORE_SHRT, "midi_note_shift");
272       defShrt(SHRT_MOVE_CLOCK,       0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Move Clock"), PROLL_SHRT + DEDIT_SHRT, "midi_move_clock");
273       defShrt(SHRT_COPY_MEASURE,     0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Copy Measure"), PROLL_SHRT + DEDIT_SHRT, "midi_copy_measure");
274       defShrt(SHRT_ERASE_MEASURE,    0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Erase Measure"), PROLL_SHRT + DEDIT_SHRT,"midi_erase_measure");
275       defShrt(SHRT_DELETE_MEASURE,   0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Delete Measure"), PROLL_SHRT + DEDIT_SHRT, "midi_delete_measure");
276       defShrt(SHRT_CREATE_MEASURE,   0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Create Measure"), PROLL_SHRT + DEDIT_SHRT, "midi_create_measure");
277       defShrt(SHRT_EVENT_COLOR,      Qt::Key_E, QT_TRANSLATE_NOOP("shortcuts", "Edit: Change Event Color"), PROLL_SHRT + SCORE_SHRT, "change_event_color");
278       defShrt(SHRT_MOVE_PLAY_TO_NOTE,    Qt::CTRL + Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Move: Move to selected note"), PROLL_SHRT + DEDIT_SHRT, "move_to_note");
279 
280       defShrt(SHRT_USE_LAST_EDITED_EVENT, Qt::SHIFT + Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "Edit: Use Last Edited event"), PROLL_SHRT, "use_last_edited_event");
281 
282       // Shortcuts for tools
283       // global
284       defShrt(SHRT_TOOL_POINTER,     Qt::Key_A, QT_TRANSLATE_NOOP("shortcuts", "Tool: Pointer"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT + SCORE_SHRT, "pointer_tool");
285       defShrt(SHRT_TOOL_PENCIL,      Qt::Key_D, QT_TRANSLATE_NOOP("shortcuts", "Tool: Pencil"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT + SCORE_SHRT, "pencil_tool");
286       defShrt(SHRT_TOOL_RUBBER,      Qt::Key_R, QT_TRANSLATE_NOOP("shortcuts", "Tool: Eraser"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT + SCORE_SHRT, "eraser_tool");
287       defShrt(SHRT_TOOL_PAN,         Qt::Key_P, QT_TRANSLATE_NOOP("shortcuts", "Tool: Pan"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "pan_tool");
288       defShrt(SHRT_TOOL_ZOOM,        Qt::Key_Z, QT_TRANSLATE_NOOP("shortcuts", "Tool: Zoom"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "zoom_tool");
289       // piano roll & drum editor
290       defShrt(SHRT_TOOL_LINEDRAW,    Qt::Key_F, QT_TRANSLATE_NOOP("shortcuts", "Tool: Line Draw"), ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT, "line_draw_tool");
291 
292       // drum editor
293       defShrt(SHRT_TOOL_CURSOR,      Qt::Key_U, QT_TRANSLATE_NOOP("shortcuts", "Tool: Cursor"), DEDIT_SHRT, "cursor_tool");
294       defShrt(SHRT_ADDNOTE_1,    Qt::Key_V, QT_TRANSLATE_NOOP("shortcuts", "Add note velocity 1"), DEDIT_SHRT, "add_note_velocity_1");
295       defShrt(SHRT_ADDNOTE_2,    Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Add note velocity 2"), DEDIT_SHRT, "add_note_velocity_2");
296       defShrt(SHRT_ADDNOTE_3,    Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Add note velocity 3"), DEDIT_SHRT, "add_note_velocity_3");
297       defShrt(SHRT_ADDNOTE_4,    Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Add note velocity 4"), DEDIT_SHRT, "add_note_velocity_4");
298 
299       defShrt(SHRT_CURSOR_STEP_UP,    Qt::Key_0, QT_TRANSLATE_NOOP("shortcuts", "Cursor step size: larger"), DEDIT_SHRT, "cursor_step_up");
300       defShrt(SHRT_CURSOR_STEP_DOWN,    Qt::Key_9, QT_TRANSLATE_NOOP("shortcuts", "Cursor step size: smaller"), DEDIT_SHRT, "cursor_step_down");
301       defShrt(SHRT_INSTRUMENT_STEP_UP,    Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Instrument/Cursor up"), DEDIT_SHRT, "instrument_up");
302       defShrt(SHRT_INSTRUMENT_STEP_DOWN,    Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Instrument/Cursor down"), DEDIT_SHRT, "instrument_down");
303 
304       // wave editor
305       defShrt(SHRT_TOOL_RANGE,      Qt::Key_Y, QT_TRANSLATE_NOOP("shortcuts", "Tool: Range"), WAVE_SHRT, "range_tool");
306       defShrt(SHRT_TOOL_STRETCH,    Qt::Key_T, QT_TRANSLATE_NOOP("shortcuts", "Tool: Stretch"), WAVE_SHRT, "stretch_tool");
307       defShrt(SHRT_TOOL_SAMPLERATE, Qt::Key_Q, QT_TRANSLATE_NOOP("shortcuts", "Tool: Sample rate"), WAVE_SHRT, "samplerate_tool");
308 
309       // arranger
310       defShrt(SHRT_TOOL_SCISSORS,    Qt::Key_S, QT_TRANSLATE_NOOP("shortcuts", "Tool: Scissor"), ARRANG_SHRT, "scissor_tool");
311       defShrt(SHRT_TOOL_GLUE,        Qt::Key_G, QT_TRANSLATE_NOOP("shortcuts", "Tool: Glue"), ARRANG_SHRT, "glue_tool");
312       defShrt(SHRT_TOOL_MUTE,        Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Tool: Mute"), ARRANG_SHRT, "mute_tool");
313 
314       //Increase/decrease current position, is going to be in arranger & drumeditor as well
315       // p4.0.10 Editors and arranger handle these by themselves, otherwise global handler will now use them, too.
316       defShrt(SHRT_POS_INC,          Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase");
317       defShrt(SHRT_POS_DEC,          Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT, "curpos_decrease");
318 
319       defShrt(SHRT_POS_INC_NOSNAP,   Qt::SHIFT + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position, no snap"), GLOBAL_SHRT, "curpos_increase_nosnap");
320       defShrt(SHRT_POS_DEC_NOSNAP,   Qt::SHIFT + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position, no snap"), GLOBAL_SHRT,  "curpos_decrease_nosnap");
321 
322       /*
323       defShrt(SHRT_POS_INC_BAR,      Qt::CTRL + Qt::ALT + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_bar");
324       defShrt(SHRT_POS_DEC_BAR,      Qt::CTRL + Qt::ALT + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_bar");
325       defShrt(SHRT_POS_INC_BAR_NOSNAP,   Qt::SHIFT + Qt::CTRL + Qt::ALT + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_bar_nosnap");
326       defShrt(SHRT_POS_DEC_BAR_NOSNAP,   Qt::SHIFT + Qt::CTRL + Qt::ALT + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_bar_nosnap");
327 
328       defShrt(SHRT_POS_INC_BEAT,      Qt::ALT + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_beat");
329       defShrt(SHRT_POS_DEC_BEAT,      Qt::ALT + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_beat");
330       defShrt(SHRT_POS_INC_BEAT_NOSNAP,   Qt::SHIFT + Qt::ALT + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_beat_nosnap");
331       defShrt(SHRT_POS_DEC_BEAT_NOSNAP,   Qt::SHIFT + Qt::ALT + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_beat_nosnap");
332 
333       defShrt(SHRT_POS_INC_TICK,      Qt::CTRL + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_tick");
334       defShrt(SHRT_POS_DEC_TICK,      Qt::CTRL + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_tick");
335       defShrt(SHRT_POS_INC_TICK_NOSNAP,      Qt::SHIFT + Qt::CTRL + Qt::Key_Plus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_tick");
336       defShrt(SHRT_POS_DEC_TICK_NOSNAP,      Qt::SHIFT + Qt::CTRL + Qt::Key_Minus, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_tick");
337 
338       defShrt(SHRT_POS_INC_FRAME,      Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_frame");
339       defShrt(SHRT_POS_DEC_FRAME,      Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_frame");
340 
341       defShrt(SHRT_POS_INC_SECOND,      Qt::CTRL + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_second");
342       defShrt(SHRT_POS_DEC_SECOND,      Qt::CTRL + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_second");
343       defShrt(SHRT_POS_INC_SECOND_NOSNAP,   Qt::SHIFT + Qt::CTRL + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_second_nosnap");
344       defShrt(SHRT_POS_DEC_SECOND_NOSNAP,   Qt::SHIFT + Qt::CTRL + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_second_nosnap");
345 
346       defShrt(SHRT_POS_INC_MINUTE,      Qt::ALT + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_minute");
347       defShrt(SHRT_POS_DEC_MINUTE,      Qt::ALT + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_minute");
348       defShrt(SHRT_POS_INC_MINUTE_NOSNAP,   Qt::SHIFT + Qt::ALT + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Transport: Increase current position"), GLOBAL_SHRT, "curpos_increase_minute_nosnap");
349       defShrt(SHRT_POS_DEC_MINUTE_NOSNAP,   Qt::SHIFT + Qt::ALT + Qt::Key_B, QT_TRANSLATE_NOOP("shortcuts", "Transport: Decrease current position"), GLOBAL_SHRT,  "curpos_decrease_minute_nosnap");
350       */
351 
352 
353       defShrt(SHRT_SET_QUANT_BAR,    0,         QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to bar"),
354               ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_bar");
355       defShrt(SHRT_SET_QUANT_OFF,    Qt::Key_8, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to off"),
356               ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_off");
357       defShrt(SHRT_SET_QUANT_1,      Qt::Key_1, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/1 note"),
358               ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_1");
359       defShrt(SHRT_SET_QUANT_2,      Qt::Key_2, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/2 note"),
360               ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_2");
361       defShrt(SHRT_SET_QUANT_3,      Qt::Key_3, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/4 note"),
362               ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_3");
363       defShrt(SHRT_SET_QUANT_4,      Qt::Key_4, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/8 note"),
364               ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_4");
365       defShrt(SHRT_SET_QUANT_5,      Qt::Key_5, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/16 note"),
366               ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_5");
367       defShrt(SHRT_SET_QUANT_6,      Qt::Key_6, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/32 note"),
368               ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_6");
369       defShrt(SHRT_SET_QUANT_7,      Qt::Key_7, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Set quantize to 1/64 note"),
370               ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_7");
371 
372       defShrt(SHRT_TOGGLE_TRIOL,       Qt::Key_T, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Toggle triol quantization"),
373               PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_triol");
374       defShrt(SHRT_TOGGLE_PUNCT,       Qt::Key_Period, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Toggle punctuation quantization"),
375               PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_punct");
376       defShrt(SHRT_TOGGLE_PUNCT2,      Qt::Key_Comma, QT_TRANSLATE_NOOP("shortcuts", "Quantize: Toggle punctuation quantization (2)"),
377               PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "midi_quant_punct2");
378       defShrt(SHRT_INSERT_AT_LOCATION, Qt::SHIFT + Qt::Key_Right, QT_TRANSLATE_NOOP("shortcuts", "Edit: Insert at location"), PROLL_SHRT, "midi_insert_at_loc");
379 
380       defShrt(SHRT_INCREASE_LEN, Qt::CTRL + Qt::SHIFT + Qt::Key_Right, QT_TRANSLATE_NOOP("shortcuts", "Edit: Increase length"), PROLL_SHRT, "increase_len");
381       defShrt(SHRT_DECREASE_LEN, Qt::CTRL + Qt::SHIFT + Qt::Key_Left, QT_TRANSLATE_NOOP("shortcuts", "Edit: Decrease length"), PROLL_SHRT, "decrease_len");
382 
383       //-----------------------------------------------------------
384       // List edit:
385       //-----------------------------------------------------------
386 
387       defShrt(SHRT_LE_INS_NOTES, Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Insert Note"), LEDIT_SHRT,  "le_ins_note");
388       defShrt(SHRT_LE_INS_SYSEX, Qt::Key_S, QT_TRANSLATE_NOOP("shortcuts", "Insert SysEx"), LEDIT_SHRT, "le_ins_sysex");
389       defShrt(SHRT_LE_INS_CTRL,  Qt::Key_C, QT_TRANSLATE_NOOP("shortcuts", "Insert Ctrl"), LEDIT_SHRT,  "le_ins_ctrl");
390       defShrt(SHRT_LE_INS_META,  Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Insert Meta"), LEDIT_SHRT, "le_ins_meta");
391 //      defShrt(SHRT_LE_INS_CHAN_AFTERTOUCH, Qt::CTRL + Qt::Key_A, QT_TRANSLATE_NOOP("shortcuts", "Insert Channel Aftertouch"), LEDIT_SHRT, "le_ins_afttouch");
392 //      defShrt(SHRT_LE_INS_POLY_AFTERTOUCH, Qt::CTRL + Qt::Key_P, QT_TRANSLATE_NOOP("shortcuts", "Insert Key Aftertouch"), LEDIT_SHRT, "le_ins_poly");
393 
394       //-----------------------------------------------------------
395       // List masteredit:
396       //-----------------------------------------------------------
397       defShrt(SHRT_LM_INS_TEMPO,  Qt::Key_T,    QT_TRANSLATE_NOOP("shortcuts", "Insert Tempo"),     LMEDIT_SHRT,  "lm_ins_tempo");
398       defShrt(SHRT_LM_INS_SIG  ,  Qt::Key_S,    QT_TRANSLATE_NOOP("shortcuts", "Insert Signature"), LMEDIT_SHRT,  "lm_ins_sig");
399       defShrt(SHRT_LM_INS_KEY,    Qt::Key_K,    QT_TRANSLATE_NOOP("shortcuts", "Insert Key"),       LMEDIT_SHRT,  "lm_ins_key");
400       defShrt(SHRT_LM_EDIT_BEAT,  Qt::Key_P,    QT_TRANSLATE_NOOP("shortcuts", "Change Event Position"),  LMEDIT_SHRT,  "lm_edit_beat");
401       defShrt(SHRT_LM_EDIT_VALUE, Qt::Key_V,    QT_TRANSLATE_NOOP("shortcuts", "Edit Event Value"),       LMEDIT_SHRT,  "lm_edit_val");
402 
403       // Since the marker window is always created at start, these are actually global
404       //  because they are handled there, and affect the whole app.
405       defShrt(SHRT_NEXT_MARKER, Qt::Key_F6, QT_TRANSLATE_NOOP("shortcuts", "Goto Next Marker"), GLOBAL_SHRT,  "me_sel_next");
406       defShrt(SHRT_PREV_MARKER, Qt::Key_F5, QT_TRANSLATE_NOOP("shortcuts", "Goto Prev Marker"), GLOBAL_SHRT,  "me_sel_prev");
407 
408       defShrt(SHRT_PART_NORMALIZE,  Qt::ALT + Qt::Key_N, QT_TRANSLATE_NOOP("shortcuts", "Normalize"), ARRANG_SHRT, "wave_part_normalize");
409 
410       //-----------------------------------------------------------
411       // Mixer:
412       //-----------------------------------------------------------
413       defShrt(SHRT_MIXER_SELECT_STRIP_LEFT, Qt::CTRL + Qt::Key_Home,
414         QT_TRANSLATE_NOOP("shortcuts", "Select strip to the left"), MIXER_SHRT, "mixer_select_left");
415       defShrt(SHRT_MIXER_SELECT_STRIP_RIGHT, Qt::CTRL + Qt::Key_End,
416         QT_TRANSLATE_NOOP("shortcuts", "Select strip to the right"), MIXER_SHRT, "mixer_select_right");
417       // TODO Feature marked as todo in AudioMixerApp::selectNextStrip().
418       //defShrt(SHRT_MIXER_MULTI_SELECT_STRIP_LEFT, Qt::CTRL + Qt::SHIFT + Qt::Key_Home,
419       //  QT_TRANSLATE_NOOP("shortcuts", "Select multiple strips to the left"), MIXER_SHRT, "mixer_multi_select_left");
420       //defShrt(SHRT_MIXER_MULTI_SELECT_STRIP_RIGHT, Qt::CTRL + Qt::SHIFT + Qt::Key_End,
421       //  QT_TRANSLATE_NOOP("shortcuts", "Select multiple strips to the right"), MIXER_SHRT, "mixer_multi_select_right");
422 
423       defShrt(SHRT_MIXER_STRIP_VOL_DOWN, Qt::ALT + Qt::Key_Down,
424         QT_TRANSLATE_NOOP("shortcuts", "Mixer strip volume down"), ARRANG_SHRT + MIXER_SHRT, "mixer_strip_vol_dn");
425       defShrt(SHRT_MIXER_STRIP_VOL_UP, Qt::ALT + Qt::Key_Up,
426         QT_TRANSLATE_NOOP("shortcuts", "Mixer strip volume up"), ARRANG_SHRT + MIXER_SHRT, "mixer_strip_vol_up");
427       defShrt(SHRT_MIXER_STRIP_PAN_LEFT, Qt::ALT + Qt::Key_Left,
428         QT_TRANSLATE_NOOP("shortcuts", "Mixer strip pan left"), ARRANG_SHRT + MIXER_SHRT, "mixer_strip_pan_left");
429       defShrt(SHRT_MIXER_STRIP_PAN_RIGHT, Qt::ALT + Qt::Key_Right,
430         QT_TRANSLATE_NOOP("shortcuts", "Mixer strip pan right"), ARRANG_SHRT + MIXER_SHRT, "mixer_strip_pan_right");
431       defShrt(SHRT_MIXER_STRIP_VOL_DOWN_PAGE, Qt::ALT + Qt::SHIFT + Qt::Key_Down,
432         QT_TRANSLATE_NOOP("shortcuts", "Mixer strip volume down page"), ARRANG_SHRT + MIXER_SHRT, "mixer_strip_vol_dn_pg");
433       defShrt(SHRT_MIXER_STRIP_VOL_UP_PAGE, Qt::ALT + Qt::SHIFT + Qt::Key_Up,
434         QT_TRANSLATE_NOOP("shortcuts", "Mixer strip volume up page"), ARRANG_SHRT + MIXER_SHRT, "mixer_strip_vol_up_pg");
435       defShrt(SHRT_MIXER_STRIP_PAN_LEFT_PAGE, Qt::ALT + Qt::SHIFT + Qt::Key_Left,
436         QT_TRANSLATE_NOOP("shortcuts", "Mixer strip pan left page"), ARRANG_SHRT + MIXER_SHRT, "mixer_strip_pan_left_pg");
437       defShrt(SHRT_MIXER_STRIP_PAN_RIGHT_PAGE, Qt::ALT + Qt::SHIFT + Qt::Key_Right,
438         QT_TRANSLATE_NOOP("shortcuts", "Mixer strip pan right page"), ARRANG_SHRT + MIXER_SHRT, "mixer_strip_pan_right_pg");
439       }
440 
441  const shortcut_cg shortcut_category[SHRT_NUM_OF_CATEGORIES] = {
442       { GLOBAL_SHRT, "Global" },
443       { ARRANG_SHRT, "Arranger" },
444       { PROLL_SHRT,  "Pianoroll" },
445       { DEDIT_SHRT,  "Drumeditor" },
446       { LEDIT_SHRT,  "List editor" },
447       { LMEDIT_SHRT, "List Mastertrack" },
448       { SCORE_SHRT,  "Score editor" },
449       { WAVE_SHRT,   "Wave editor" },
450       { MIXER_SHRT,  "Mixer" },
451       { ALL_SHRT  ,  "All categories" }
452  };
453 
getShrtByTag(const char * xml)454 int getShrtByTag(const char* xml)
455       {
456       for (int i=0; i<SHRT_NUM_OF_ELEMENTS; i++) {
457             if (shortcuts[i].xml) {
458                   if (strcmp(shortcuts[i].xml, xml) == 0)
459                         return i;
460             }
461       }
462       return -1;
463       }
464 
writeShortCuts(int level,MusECore::Xml & xml)465 void writeShortCuts(int level, MusECore::Xml& xml)
466       {
467       xml.tag(level++, "shortcuts");
468       for (int i=0; i < SHRT_NUM_OF_ELEMENTS; i++) {
469             if (shortcuts[i].xml != nullptr && shortcuts[i].type != INVIS_SHRT) //Avoid nullptr & hardcoded shortcuts
470                   xml.intTag(level, shortcuts[i].xml, shortcuts[i].key);
471             }
472       xml.etag(level, "shortcuts");
473       }
474 
readShortCuts(MusECore::Xml & xml)475 void readShortCuts(MusECore::Xml& xml)
476       {
477       for (;;) {
478             MusECore::Xml::Token token = xml.parse();
479             if (token == MusECore::Xml::Error || token == MusECore::Xml::End)
480                   break;
481 
482             const QString& tag = xml.s1();
483             switch (token) {
484                   case MusECore::Xml::TagStart: {
485                         if (tag.length()) {
486                               int index = getShrtByTag(tag.toLatin1().constData());
487                               if (index == -1) //No such tag found
488                                     printf("Config file might be corrupted. Unknown shortcut: %s\n",tag.toLatin1().constData());
489                               else {
490                                     //printf("Index: %d\n",index);
491                                     shortcuts[index].key = xml.parseInt();
492                                     //printf("shortcuts[%d].key = %d, %s\n",index, shortcuts[index].key, shortcuts[index].descr);
493                                     }
494                               }
495                         }
496                         break;
497                   case MusECore::Xml::TagEnd:
498                         if (tag == "shortcuts")
499                               return;
500                   default:
501                         break;
502                   }
503             }
504       }
505 
shrtToStr(long int shrt)506 QString shrtToStr(long int shrt)
507 {
508  return QKeySequence(shortcuts[shrt].key).toString();
509 }
510 
511 } // namespace MusEGui
512