13
0

properly track step edit status in editor & mixer windows

git-svn-id: svn://localhost/ardour2/branches/3.0@7533 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-08-03 21:50:15 +00:00
parent b1f5a6a68d
commit 6b641cdde4
5 changed files with 54 additions and 37 deletions

View File

@ -891,20 +891,6 @@ MidiTimeAxisView::route_active_changed ()
} }
} }
void
MidiTimeAxisView::toggle_step_edit ()
{
if (_route->record_enabled()) {
return;
}
if (midi_track()->step_editing ()) {
stop_step_editing ();
} else {
start_step_editing ();
}
}
void void
MidiTimeAxisView::start_step_editing () MidiTimeAxisView::start_step_editing ()
{ {
@ -923,7 +909,6 @@ MidiTimeAxisView::start_step_editing ()
step_edit_region_view = 0; step_edit_region_view = 0;
} }
midi_track()->set_step_editing (true);
if (step_editor == 0) { if (step_editor == 0) {
step_editor = new StepEntry (*this); step_editor = new StepEntry (*this);
@ -937,15 +922,14 @@ MidiTimeAxisView::start_step_editing ()
bool bool
MidiTimeAxisView::step_editor_hidden (GdkEventAny*) MidiTimeAxisView::step_editor_hidden (GdkEventAny*)
{ {
stop_step_editing (); /* everything else will follow the change in the model */
midi_track()->set_step_editing (false);
return true; return true;
} }
void void
MidiTimeAxisView::stop_step_editing () MidiTimeAxisView::stop_step_editing ()
{ {
midi_track()->set_step_editing (false);
if (step_editor) { if (step_editor) {
step_editor->hide (); step_editor->hide ();
} }

View File

@ -87,9 +87,6 @@ class MidiTimeAxisView : public RouteTimeAxisView
return _midi_patch_settings_changed; return _midi_patch_settings_changed;
} }
void toggle_step_edit ();
void start_step_editing ();
void stop_step_editing ();
void check_step_edit (); void check_step_edit ();
void step_edit_rest (); void step_edit_rest ();
int step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, int step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity,
@ -103,6 +100,10 @@ class MidiTimeAxisView : public RouteTimeAxisView
Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter); Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter);
protected:
void start_step_editing ();
void stop_step_editing ();
private: private:
sigc::signal<void, std::string, std::string> _midi_patch_settings_changed; sigc::signal<void, std::string, std::string> _midi_patch_settings_changed;

View File

@ -589,10 +589,7 @@ RouteUI::build_record_menu ()
/* no rec-button context menu for non-MIDI tracks /* no rec-button context menu for non-MIDI tracks
*/ */
if (!is_midi_track()) { if (is_midi_track()) {
return;
}
record_menu = new Menu; record_menu = new Menu;
record_menu->set_name ("ArdourContextMenu"); record_menu->set_name ("ArdourContextMenu");
@ -601,11 +598,23 @@ RouteUI::build_record_menu ()
items.push_back (CheckMenuElem (_("Step Edit"), sigc::mem_fun (*this, &RouteUI::toggle_step_edit))); items.push_back (CheckMenuElem (_("Step Edit"), sigc::mem_fun (*this, &RouteUI::toggle_step_edit)));
step_edit_item = dynamic_cast<CheckMenuItem*> (&items.back()); step_edit_item = dynamic_cast<CheckMenuItem*> (&items.back());
if (_route->record_enabled()) {
step_edit_item->set_sensitive (false);
}
step_edit_item->set_active (midi_track()->step_editing());
}
} }
void void
RouteUI::toggle_step_edit () RouteUI::toggle_step_edit ()
{ {
if (!is_midi_track() || _route->record_enabled()) {
return;
}
midi_track()->set_step_editing (step_edit_item->get_active());
} }
void void
@ -615,10 +624,24 @@ RouteUI::step_edit_changed (bool yn)
if (rec_enable_button) { if (rec_enable_button) {
rec_enable_button->set_visual_state (3); rec_enable_button->set_visual_state (3);
} }
start_step_editing ();
if (step_edit_item) {
step_edit_item->set_active (true);
}
} else { } else {
if (rec_enable_button) { if (rec_enable_button) {
rec_enable_button->set_visual_state (0); rec_enable_button->set_visual_state (0);
} }
stop_step_editing ();
if (step_edit_item) {
step_edit_item->set_active (false);
}
} }
} }
@ -1020,9 +1043,18 @@ RouteUI::update_rec_display ()
} }
if (step_edit_item) {
step_edit_item->set_sensitive (false);
}
} else { } else {
rec_enable_button->set_visual_state (0); rec_enable_button->set_visual_state (0);
if (step_edit_item) {
step_edit_item->set_sensitive (true);
} }
}
check_rec_enable_sensitivity (); check_rec_enable_sensitivity ();
} }

View File

@ -184,7 +184,7 @@ class RouteUI : public virtual AxisView
void build_record_menu (); void build_record_menu ();
Gtk::CheckMenuItem *step_edit_item; Gtk::CheckMenuItem *step_edit_item;
virtual void toggle_step_edit (); void toggle_step_edit ();
virtual void step_edit_changed (bool); virtual void step_edit_changed (bool);
virtual void polarity_changed (); virtual void polarity_changed ();
@ -221,6 +221,8 @@ class RouteUI : public virtual AxisView
void reset (); void reset ();
void self_delete (); void self_delete ();
virtual void start_step_editing () {}
virtual void stop_step_editing() {}
private: private:
void check_rec_enable_sensitivity (); void check_rec_enable_sensitivity ();

View File

@ -173,8 +173,6 @@ StepEntry::StepEntry (MidiTimeAxisView& mtv)
upper_box.pack_start (channel_spinner, false, false); upper_box.pack_start (channel_spinner, false, false);
_piano = (PianoKeyboard*) piano_keyboard_new (); _piano = (PianoKeyboard*) piano_keyboard_new ();
piano_keyboard_set_keyboard_cue (PIANO_KEYBOARD(_piano), 1);
piano = Glib::wrap ((GtkWidget*) _piano); piano = Glib::wrap ((GtkWidget*) _piano);
piano->set_flags (Gtk::CAN_FOCUS); piano->set_flags (Gtk::CAN_FOCUS);