basic skeleton for clip editor bindings
This commit is contained in:
parent
ef07d47bf8
commit
02026c98ff
@ -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
|
||||
|
@ -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<Gtk::ActionGroup> 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 ()
|
||||
{
|
||||
|
@ -65,6 +65,19 @@ public:
|
||||
~ClipEditorBox () {}
|
||||
|
||||
virtual void set_region (boost::shared_ptr<ARDOUR::Region>) =0;
|
||||
|
||||
static void init ();
|
||||
static void register_clip_editor_actions (Gtkmm2ext::Bindings*);
|
||||
static Glib::RefPtr<Gtk::ActionGroup> clip_editor_actions;
|
||||
};
|
||||
|
||||
class ClipEditor
|
||||
{
|
||||
public:
|
||||
virtual ~ClipEditor() {}
|
||||
|
||||
virtual void zoom_in () = 0;
|
||||
virtual void zoom_out () = 0;
|
||||
};
|
||||
|
||||
class AudioClipEditor : public ArdourCanvas::GtkCanvas
|
||||
|
6
gtk2_ardour/clip_editor.bindings
Normal file
6
gtk2_ardour/clip_editor.bindings
Normal file
@ -0,0 +1,6 @@
|
||||
<Bindings name="Clip Editing">
|
||||
<Press>
|
||||
<Binding key="equal" action="ClipEditing/zoom-in"/>
|
||||
<Binding key="minus" action="ClipEditing/zoom-in"/>
|
||||
</Press>
|
||||
</Bindings>
|
@ -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']
|
||||
|
@ -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 (<HARDCODED>) {
|
||||
|
Loading…
Reference in New Issue
Block a user