main.cc compiles.
[ardour.git] / gtk2_ardour / default_keys.cc
1 /*
2     Copyright (C) 1999 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18     $Id$
19 */
20
21 #include <sigc++/bind.h>
22 #include <pbd/error.h>
23
24 #include "ardour_ui.h"
25 #include "keyboard_target.h"
26
27 using namespace ARDOUR;
28 using namespace Gtkmm2ext;
29 using namespace Gtk;
30 using namespace sigc;
31
32 void
33 ARDOUR_UI::install_keybindings ()
34 {
35         KeyboardTarget::add_action ("start-prefix", mem_fun(*this, &ARDOUR_UI::start_keyboard_prefix));
36
37         KeyboardTarget::add_action ("toggle-editor-window", mem_fun(*this, &ARDOUR_UI::goto_editor_window));
38         KeyboardTarget::add_action ("toggle-mixer-window", mem_fun(*this, &ARDOUR_UI::goto_mixer_window));
39         KeyboardTarget::add_action ("toggle-locations-window", mem_fun(*this, &ARDOUR_UI::toggle_location_window));
40         KeyboardTarget::add_action ("toggle-big-clock-window", mem_fun(*this, &ARDOUR_UI::toggle_big_clock_window));
41         KeyboardTarget::add_action ("toggle-options-window", mem_fun(*this, &ARDOUR_UI::toggle_options_window));
42         KeyboardTarget::add_action ("toggle-auto-loop", mem_fun(*this, &ARDOUR_UI::toggle_session_auto_loop));
43         KeyboardTarget::add_action ("toggle-punch-in", mem_fun(*this, &ARDOUR_UI::toggle_session_punch_in));
44
45         KeyboardTarget::add_action ("new-session", bind (mem_fun(*this, &ARDOUR_UI::new_session), false, string()));
46         KeyboardTarget::add_action ("add-audio-track", bind (mem_fun(*this, &ARDOUR_UI::session_add_audio_track), 1, 1));
47         KeyboardTarget::add_action ("add-audio-bus", bind (mem_fun(*this, &ARDOUR_UI::session_add_audio_bus), 1, 1));
48
49         KeyboardTarget::add_action ("save-state", bind (mem_fun(*this, &ARDOUR_UI::save_state), string ("")));
50         KeyboardTarget::add_action ("quit", (mem_fun(*this, &ARDOUR_UI::finish)));
51
52         KeyboardTarget::add_action ("remove-last-capture", mem_fun(*this, &ARDOUR_UI::remove_last_capture));
53
54         KeyboardTarget::add_action ("transport-stop", mem_fun(*this, &ARDOUR_UI::transport_stop));
55         KeyboardTarget::add_action ("transport-stop-and-forget-capture", mem_fun(*this, &ARDOUR_UI::transport_stop_and_forget_capture));
56         KeyboardTarget::add_action ("transport-roll", mem_fun(*this, &ARDOUR_UI::transport_roll));
57         KeyboardTarget::add_action ("transport-loop", mem_fun(*this, &ARDOUR_UI::transport_loop));
58         KeyboardTarget::add_action ("transport-record", mem_fun(*this, &ARDOUR_UI::transport_record));
59         KeyboardTarget::add_action ("transport-rewind", bind (mem_fun(*this, &ARDOUR_UI::transport_rewind), 0));
60         KeyboardTarget::add_action ("transport-rewind-slow", bind (mem_fun(*this, &ARDOUR_UI::transport_rewind), -1));
61         KeyboardTarget::add_action ("transport-rewind-fast", bind (mem_fun(*this, &ARDOUR_UI::transport_rewind), 1));
62         KeyboardTarget::add_action ("transport-forward", bind (mem_fun(*this, &ARDOUR_UI::transport_forward), 0));
63         KeyboardTarget::add_action ("transport-forward-slow", bind (mem_fun(*this, &ARDOUR_UI::transport_forward), -1));
64         KeyboardTarget::add_action ("transport-forward-fast", bind (mem_fun(*this, &ARDOUR_UI::transport_forward), 1));
65
66         KeyboardTarget::add_action ("transport-goto-start", mem_fun(*this, &ARDOUR_UI::transport_goto_start));
67         KeyboardTarget::add_action ("transport-goto-end", mem_fun(*this, &ARDOUR_UI::transport_goto_end));
68
69         KeyboardTarget::add_action ("send-all-midi-feedback", mem_fun(*this, &ARDOUR_UI::send_all_midi_feedback));
70         
71         KeyboardTarget::add_action ("toggle-record-enable-track1", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable),  0U));
72         KeyboardTarget::add_action ("toggle-record-enable-track2", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable),  1U));
73         KeyboardTarget::add_action ("toggle-record-enable-track3", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable),  2U));
74         KeyboardTarget::add_action ("toggle-record-enable-track4", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable),  3U));
75         KeyboardTarget::add_action ("toggle-record-enable-track5", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable),  4U));
76         KeyboardTarget::add_action ("toggle-record-enable-track6", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable),  5U));
77         KeyboardTarget::add_action ("toggle-record-enable-track7", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable),  6U));
78         KeyboardTarget::add_action ("toggle-record-enable-track8", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable),  7U));
79         KeyboardTarget::add_action ("toggle-record-enable-track9", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable),  8U));
80         KeyboardTarget::add_action ("toggle-record-enable-track10", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 9U));
81         KeyboardTarget::add_action ("toggle-record-enable-track11", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 10U));
82         KeyboardTarget::add_action ("toggle-record-enable-track12", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 11U));
83         KeyboardTarget::add_action ("toggle-record-enable-track13", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 12U));
84         KeyboardTarget::add_action ("toggle-record-enable-track14", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 13U));
85         KeyboardTarget::add_action ("toggle-record-enable-track15", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 14U));
86         KeyboardTarget::add_action ("toggle-record-enable-track16", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 15U));
87         KeyboardTarget::add_action ("toggle-record-enable-track17", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 16U));
88         KeyboardTarget::add_action ("toggle-record-enable-track18", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 17U));
89         KeyboardTarget::add_action ("toggle-record-enable-track19", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 18U));
90         KeyboardTarget::add_action ("toggle-record-enable-track20", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 19U));
91         KeyboardTarget::add_action ("toggle-record-enable-track21", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 20U));
92         KeyboardTarget::add_action ("toggle-record-enable-track22", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 21U));
93         KeyboardTarget::add_action ("toggle-record-enable-track23", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 22U));
94         KeyboardTarget::add_action ("toggle-record-enable-track24", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 23U));
95         KeyboardTarget::add_action ("toggle-record-enable-track25", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 24U));
96         KeyboardTarget::add_action ("toggle-record-enable-track26", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 25U));
97         KeyboardTarget::add_action ("toggle-record-enable-track27", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 26U));
98         KeyboardTarget::add_action ("toggle-record-enable-track28", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 27U));
99         KeyboardTarget::add_action ("toggle-record-enable-track29", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 28U));
100         KeyboardTarget::add_action ("toggle-record-enable-track30", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 29U));
101         KeyboardTarget::add_action ("toggle-record-enable-track31", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 30U));
102         KeyboardTarget::add_action ("toggle-record-enable-track32", bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 31U));
103         
104 #if 0
105         ADD ME TO ARDOUR RC SOMEDAY
106         add_binding ("Shift-F1",, bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 0+12U));
107         add_binding ("Control-F1",, bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 0+24U));
108         add_binding ("Alt-F1",, bind (mem_fun(*this, &ARDOUR_UI::toggle_monitor_enable), 0U));
109         add_binding ("Alt-Shift-F1",, bind (mem_fun(*this, &ARDOUR_UI::toggle_monitor_enable), 0+12U));
110         add_binding ("Alt-Control-F1",, bind (mem_fun(*this, &ARDOUR_UI::toggle_monitor_enable), 0+24U));
111 #endif
112 }