Editor zoom: add 2hour and 24hour zoom limits.
[ardour.git] / gtk2_ardour / midi_region_view.cc
index d0abc7d4e827830b72d2e4dde21456feee2361a1..9d5a6f86e601e11d382c6640a030b0870f065efb 100644 (file)
@@ -1093,6 +1093,7 @@ MidiRegionView::abort_command()
 {
        delete _note_diff_command;
        _note_diff_command = 0;
+       trackview.editor().abort_reversible_command();
        clear_editor_note_selection();
 }
 
@@ -2081,7 +2082,6 @@ MidiRegionView::change_patch_change (MidiModel::PatchChangePtr old_change, const
 void
 MidiRegionView::add_patch_change (framecnt_t t, Evoral::PatchChange<Evoral::Beats> const & patch)
 {
-       MidiTimeAxisView* const mtv = dynamic_cast<MidiTimeAxisView*>(&trackview);
        string name = _("add patch change");
 
        trackview.editor().begin_reversible_command (name);
@@ -2089,7 +2089,7 @@ MidiRegionView::add_patch_change (framecnt_t t, Evoral::PatchChange<Evoral::Beat
        c->add (MidiModel::PatchChangePtr (
                        new Evoral::PatchChange<Evoral::Beats> (
                                absolute_frames_to_source_beats (_region->position() + t),
-                               mtv->get_channel_for_add(), patch.program(), patch.bank()
+                               patch.channel(), patch.program(), patch.bank()
                                )
                        )
                );
@@ -4224,7 +4224,10 @@ MidiRegionView::trim_front_starting ()
 void
 MidiRegionView::trim_front_ending ()
 {
-
+       if (_region->start() < 0) {
+               /* Trim drag made start time -ve; fix this */
+               midi_region()->fix_negative_start ();
+       }
 }
 
 void