diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index 5146a7b7b9..8e08a69f41 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -42,6 +42,7 @@ #include "actions.h" #include "ardour_message.h" #include "ardour_ui.h" +#include "audio_clip_editor.h" #include "public_editor.h" #include "meterbridge.h" #include "luainstance.h" @@ -92,6 +93,7 @@ ARDOUR_UI::we_have_dependents () ProcessorBox::register_actions (); StepEntry::setup_actions_and_bindings (); TriggerBoxUI::setup_actions_and_bindings (); + ClipEditorBox::init (); /* Global, editor, mixer, processor box actions are defined now. Link them with any bindings, so that GTK does not get a chance to define diff --git a/gtk2_ardour/audio_clip_editor.cc b/gtk2_ardour/audio_clip_editor.cc index c100445404..c996b55467 100644 --- a/gtk2_ardour/audio_clip_editor.cc +++ b/gtk2_ardour/audio_clip_editor.cc @@ -51,6 +51,7 @@ #include "pbd/i18n.h" using namespace Gtk; +using namespace Gtkmm2ext; using namespace ARDOUR; using namespace ArdourCanvas; using namespace ArdourWaveView; @@ -58,6 +59,31 @@ using namespace ArdourWidgets; using std::min; using std::max; + +Glib::RefPtr ClipEditorBox::clip_editor_actions; + +void +ClipEditorBox::init () +{ + Bindings* bindings = Bindings::get_bindings (X_("Clip Editing")); + + register_clip_editor_actions (bindings); + + //_track_canvas_viewport->canvas()->set_data ("ardour-bindings", + //midi_bindings); +} + +void +ClipEditorBox::register_clip_editor_actions (Bindings* clip_editor_bindings) +{ + clip_editor_actions = ActionManager::create_action_group (clip_editor_bindings, X_("ClipEditing")); + + /* two versions to allow same action for Delete and Backspace */ + + // ActionManager::register_action (clip_editor_actions, X_("zoom-in"), _("Zoom In"), sigc::mem_fun (*this, &ClipEditorBox::zoom_in)); + // ActionManager::register_action (clip_editor_actions, X_("zoom-in"), _("Zoom In"), sigc::mem_fun (*this, &ClipEditorBox::zoom_out)); +} + /* ------------ */ AudioClipEditor::AudioClipEditor () @@ -125,6 +151,10 @@ AudioClipEditor::line_event_handler (GdkEvent* ev, ArdourCanvas::Line* l) } break; + + case GDK_KEY_PRESS: + return key_press (&ev->key); + default: break; } @@ -132,6 +162,12 @@ AudioClipEditor::line_event_handler (GdkEvent* ev, ArdourCanvas::Line* l) return false; } +bool +AudioClipEditor::key_press (GdkEventKey* ev) +{ + return false; +} + void AudioClipEditor::position_lines () { diff --git a/gtk2_ardour/audio_clip_editor.h b/gtk2_ardour/audio_clip_editor.h index 414ce7075c..6f51a4a641 100644 --- a/gtk2_ardour/audio_clip_editor.h +++ b/gtk2_ardour/audio_clip_editor.h @@ -65,6 +65,19 @@ public: ~ClipEditorBox () {} virtual void set_region (boost::shared_ptr) =0; + + static void init (); + static void register_clip_editor_actions (Gtkmm2ext::Bindings*); + static Glib::RefPtr clip_editor_actions; +}; + +class ClipEditor +{ + public: + virtual ~ClipEditor() {} + + virtual void zoom_in () = 0; + virtual void zoom_out () = 0; }; class AudioClipEditor : public ArdourCanvas::GtkCanvas diff --git a/gtk2_ardour/clip_editor.bindings b/gtk2_ardour/clip_editor.bindings new file mode 100644 index 0000000000..720a30be35 --- /dev/null +++ b/gtk2_ardour/clip_editor.bindings @@ -0,0 +1,6 @@ + + + + + + diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 678fe86314..392d23c9ce 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -926,7 +926,7 @@ def build(bld): for b in [ 'ardour' ] : obj = bld( target = b + '.keys', - source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings', 'trigger.bindings' ], + source = [ b + '.keys.in', 'mixer.bindings', 'processor_box.bindings', 'step_editing.bindings', 'monitor.bindings', 'trigger.bindings', 'clip_editor.bindings' ], rule = a_rule ) obj.install_path = bld.env['CONFDIR'] diff --git a/tools/fmt-bindings b/tools/fmt-bindings index a6a8c79e40..b784a0aa14 100755 --- a/tools/fmt-bindings +++ b/tools/fmt-bindings @@ -334,7 +334,7 @@ if ($make_accelmap) { # merge in the "fixed" bindings that are not defined by the argument given to this program # this covers things like the step editor, monitor and processor box bindings - foreach $hardcoded_bindings ("mixer.bindings", "step_editing.bindings", "monitor.bindings", "processor_box.bindings", "trigger.bindings") { + foreach $hardcoded_bindings ("mixer.bindings", "step_editing.bindings", "monitor.bindings", "processor_box.bindings", "trigger.bindings", 'clip_editor.bindings') { $path = File::Spec->catfile (dirname ($ARGV[0]), $hardcoded_bindings); open HARDCODED, "<", $path or die $!; while () {