changes to support new key bindings editor design

This commit is contained in:
Paul Davis 2015-08-04 14:00:57 -04:00
parent 40cdb01832
commit 2c6799f247
7 changed files with 26 additions and 10 deletions

View File

@ -333,6 +333,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
bool tabbed_window_state_event_handler (GdkEventWindowState*, void* object);
bool key_event_handler (GdkEventKey*, Gtk::Window* window);
Gtkmm2ext::ActionMap global_actions;
Gtkmm2ext::Bindings global_bindings;
protected:
friend class PublicEditor;
@ -648,7 +651,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
Gtk::HBox rc_option_editor_placeholder;
WM::Proxy<SpeakerDialog> speaker_config_window;
WM::Proxy<KeyEditor> key_editor;
WM::Proxy<AddRouteDialog> add_route_dialog;
WM::Proxy<About> about;
WM::Proxy<LocationUIWindow> location_ui;
@ -664,6 +666,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
WM::ProxyWithConstructor<BigClockWindow> big_clock_window;
WM::ProxyWithConstructor<GlobalPortMatrixWindow> audio_port_matrix;
WM::ProxyWithConstructor<GlobalPortMatrixWindow> midi_port_matrix;
WM::ProxyWithConstructor<KeyEditor> key_editor;
/* creator methods */
@ -672,7 +675,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
AddVideoDialog* create_add_video_dialog ();
BigClockWindow* create_big_clock_window();
GlobalPortMatrixWindow* create_global_port_matrix (ARDOUR::DataType);
KeyEditor* create_key_editor ();
ARDOUR::SystemExec *video_server_process;
void handle_locations_change (ARDOUR::Location*);
@ -828,8 +832,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
bool main_window_delete_event (GdkEventAny*);
bool idle_ask_about_quit ();
Gtkmm2ext::ActionMap global_actions;
Gtkmm2ext::Bindings global_bindings;
void load_bindings ();
};

View File

@ -473,6 +473,18 @@ ARDOUR_UI::new_midi_tracer_window ()
}
}
KeyEditor*
ARDOUR_UI::create_key_editor ()
{
KeyEditor* kedit = new KeyEditor;
kedit->add_tab (_("Global"), global_bindings);
kedit->add_tab (_("Editing"), editor->bindings);
kedit->add_tab (_("Mixing"), mixer->bindings);
return kedit;
}
BundleManager*
ARDOUR_UI::create_bundle_manager ()
{

View File

@ -471,7 +471,7 @@ Editor::Editor ()
last_event_time.tv_sec = 0;
last_event_time.tv_usec = 0;
global_hpacker.set_data ("ardour-bindings", &key_bindings);
global_hpacker.set_data ("ardour-bindings", &bindings);
selection_op_history.clear();
before.clear();
@ -5862,7 +5862,7 @@ Editor::use_own_window (bool and_fill_it)
// win->signal_realize().connect (*this, &Editor::on_realize);
win->signal_event().connect (sigc::mem_fun (*this, &Editor::generic_event_handler));
win->set_data ("ardour-bindings", &key_bindings);
win->set_data ("ardour-bindings", &bindings);
update_title ();
}

View File

@ -551,7 +551,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
bool constructed;
Gtkmm2ext::ActionMap myactions;
Gtkmm2ext::Bindings key_bindings;
// to keep track of the playhead position for control_scroll
boost::optional<framepos_t> _control_scroll_target;

View File

@ -754,8 +754,8 @@ Editor::register_actions ()
void
Editor::load_bindings ()
{
key_bindings.set_action_map (myactions);
key_bindings.load ("editor");
bindings.set_action_map (myactions);
bindings.load ("editor");
}
void

View File

@ -35,7 +35,7 @@ using namespace Gtk;
using namespace PBD;
using namespace ARDOUR;
using Gtkmm2ext::Keyboard;
static void
accel_map_changed (GtkAccelMap* /*map*/,
gchar* /*path*/,

View File

@ -43,6 +43,7 @@
#include "canvas/fwd.h"
#include "gtkmm2ext/actions.h"
#include "gtkmm2ext/bindings.h"
#include "gtkmm2ext/tabbable.h"
#include "gtkmm2ext/visibility_tracker.h"
@ -421,6 +422,8 @@ class PublicEditor : public Gtkmm2ext::Tabbable {
PBD::Signal0<void> SnapChanged;
PBD::Signal0<void> MouseModeChanged;
Gtkmm2ext::Bindings bindings;
protected:
friend class DisplaySuspender;
virtual void suspend_route_redisplay () = 0;