Use memento_command_binder() to (probably) fix MSVC build and other things.
authorDavid Robillard <d@drobilla.net>
Thu, 20 Nov 2014 17:01:39 +0000 (12:01 -0500)
committerDavid Robillard <d@drobilla.net>
Thu, 20 Nov 2014 17:01:39 +0000 (12:01 -0500)
Remove ugly hack that does the same thing.

gtk2_ardour/automation_region_view.cc

index 76591fa3d8ade048c50748325b8ddc3dc0854ffb..ab13a99c16034819b243c41f62627e268ff3e4fc 100644 (file)
@@ -180,14 +180,8 @@ AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double
 
        XMLNode& after = _line->the_list()->get_state();
 
-       /* XXX: hack! */
-       boost::shared_ptr<ARDOUR::MidiRegion> mr = boost::dynamic_pointer_cast<ARDOUR::MidiRegion> (_region);
-       assert (mr);
-
        view->session()->commit_reversible_command (
-               new MementoCommand<ARDOUR::AutomationList> (new ARDOUR::MidiAutomationListBinder (mr->midi_source(), _parameter), &before, &after)
-               );
-
+               new MementoCommand<ARDOUR::AutomationList> (_line->memento_command_binder(), &before, &after));
 
        view->session()->set_dirty ();
 }
@@ -215,7 +209,7 @@ AutomationRegionView::paste (framepos_t                                      pos
        XMLNode& before = my_list->get_state();
        my_list->paste(*slist, model_pos, times);
        view->session()->add_command(
-               new MementoCommand<ARDOUR::AutomationList>(*my_list.get(), &before, &my_list->get_state()));
+               new MementoCommand<ARDOUR::AutomationList>(_line->memento_command_binder(), &before, &my_list->get_state()));
 
        return true;
 }