fix a few issues following the pianoroll renaming

This commit is contained in:
Paul Davis
2025-01-07 12:58:54 -07:00
parent f5d15aac0b
commit 89c6c46f65
5 changed files with 18 additions and 13 deletions

View File

@@ -59,7 +59,7 @@ MidiClipEditorBox::MidiClipEditorBox ()
_header_label.set_alignment (0.0, 0.5);
pack_start (_header_label, false, false, 6);
editor = new Pianoroll ();
editor = new Pianoroll (X_("MIDICueEditor"));
editor->viewport().set_size_request (600, 120);
pack_start (editor->viewport(), true, true);

View File

@@ -1,8 +1,8 @@
<Bindings name="Pianoroll">
<Press>
<Binding key="d" action="MIDICueEditor/set-mouse-mode-draw" group="pianoroll"/>
<Binding key="e" action="MIDICueEditor/set-mouse-mode-content" group="pianoroll"/>
<Binding key="equal" action="MIDICueEditor/zoom-in" group="pianoroll"/>
<Binding key="minus" action="MIDICueEditor/zoom-in" group="pianoroll"/>
<Binding key="d" action="Pianoroll/set-mouse-mode-draw" group="pianoroll"/>
<Binding key="e" action="Pianoroll/set-mouse-mode-content" group="pianoroll"/>
<Binding key="equal" action="Pianoroll/zoom-in" group="pianoroll"/>
<Binding key="minus" action="Pianoroll/zoom-in" group="pianoroll"/>
</Press>
</Bindings>

View File

@@ -57,8 +57,8 @@ using namespace ArdourWidgets;
using namespace Gtkmm2ext;
using namespace Temporal;
Pianoroll::Pianoroll()
: CueEditor (X_("Pianoroll"))
Pianoroll::Pianoroll (std::string const & name)
: CueEditor (name)
, timebar_height (15.)
, n_timebars (3)
, prh (nullptr)
@@ -239,6 +239,7 @@ Pianoroll::build_upper_toolbar ()
Gtk::HBox* _toolbar_inner = manage (new Gtk::HBox);
Gtk::HBox* _toolbar_outer = manage (new Gtk::HBox);
Gtk::HBox* _toolbar_left = manage (new Gtk::HBox);
_toolbar_inner->pack_start (*mouse_mode_box, false, false);
_toolbar_inner->pack_start (snap_box, false, false);
@@ -262,7 +263,6 @@ Pianoroll::build_upper_toolbar ()
_toolbar_outer->pack_start (play_note_selection_button, false, false);
_toolbar_outer->pack_start (note_mode_button, false, false);
_toolbar_outer->pack_start (follow_playhead_button, false, false);
_toolbar_outer->pack_start (full_zoom_button, false, false);
_toolbar_outer->pack_start (*_toolbar_inner, true, false);
build_zoom_focus_menu ();
@@ -270,8 +270,13 @@ Pianoroll::build_upper_toolbar ()
if (str != zoom_focus_selector.get_text()) {
zoom_focus_selector.set_text (str);
}
_toolbar_outer->pack_start (zoom_focus_selector, true, false);
_toolbar_left->pack_start (zoom_in_button, false, false);
_toolbar_left->pack_start (zoom_out_button, false, false);
_toolbar_left->pack_start (full_zoom_button, false, false);
_toolbar_left->pack_start (zoom_focus_selector, false, false);
_toolbar_outer->pack_start (*_toolbar_left, true, false);
_toolbox.pack_start (*_toolbar_outer, false, false);
Bindings* pr_bindings = Bindings::get_bindings (X_("Pianoroll"));
@@ -1281,7 +1286,7 @@ Pianoroll::set_state (XMLNode const & node, int version)
XMLNode&
Pianoroll::get_state () const
{
XMLNode* node (new XMLNode (_("MIDICueEditor")));
XMLNode* node (new XMLNode (editor_name()));
get_common_editing_state (*node);
return *node;
}

View File

@@ -50,7 +50,7 @@ class CueMidiBackground;
class Pianoroll : public CueEditor
{
public:
Pianoroll ();
Pianoroll (std::string const & name);
~Pianoroll ();
ArdourCanvas::Container* get_trackview_group () const { return data_group; }

View File

@@ -138,7 +138,7 @@ TriggerPage::TriggerPage ()
add_sidebar_page (_("Sources"), _trigger_source_list.widget ());
add_sidebar_page (_("Regions"), _trigger_region_list.widget ());
_midi_editor = new Pianoroll;
_midi_editor = new Pianoroll (X_("MIDICueEditor"));
/* Bottom -- Properties of selected Slot/Region */
Gtk::Table* table = manage (new Gtk::Table);
@@ -268,7 +268,7 @@ TriggerPage::set_state (const XMLNode& node, int version)
_sidebar_notebook.set_current_page (sidebar_page);
}
XMLNode* mn = node.child (X_("MIDICueEditor"));
XMLNode* mn = node.child (_midi_editor->editor_name().c_str());
if (mn) {
_midi_editor->set_state (*mn, version);
}