add comment/doxygen doc
[ardour.git] / gtk2_ardour / midi_time_axis.cc
index 59c30c0c021cb1b15d42dc82e6d66ecf8ede453f..af19c9b037552e93a878bb885ceebf2a6c0edea1 100644 (file)
@@ -91,6 +91,7 @@
 #include "i18n.h"
 
 using namespace ARDOUR;
+using namespace ARDOUR_UI_UTILS;
 using namespace PBD;
 using namespace Gtk;
 using namespace Gtkmm2ext;
@@ -170,6 +171,11 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
                create_automation_child (GainAutomation, false);
        }
 
+       /* if set_state above didn't create a mute automation child, we need to make one */
+       if (automation_child (MuteAutomation) == 0) {
+               create_automation_child (MuteAutomation, false);
+       }
+
        if (_route->panner_shell()) {
                _route->panner_shell()->Changed.connect (*this, invalidator (*this), boost::bind (&MidiTimeAxisView::ensure_pan_views, this, false), gui_context());
        }
@@ -1264,6 +1270,10 @@ MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool
                create_gain_automation_child (param, show);
                break;
 
+       case MuteAutomation:
+               create_mute_automation_child (param, show);
+               break;
+
        case PluginAutomation:
                /* handled elsewhere */
                break;
@@ -1521,8 +1531,7 @@ MidiTimeAxisView::add_region (framepos_t pos, framecnt_t length, bool commit)
 
        real_editor->snap_to (pos, 0);
 
-       boost::shared_ptr<Source> src = _session->create_midi_source_for_session (
-               view()->trackview().track().get(), view()->trackview().track()->name());
+       boost::shared_ptr<Source> src = _session->create_midi_source_by_stealing_name (view()->trackview().track());
        PropertyList plist;
 
        plist.add (ARDOUR::Properties::start, 0);