fix scanning of VST shell plugins
[ardour.git] / libs / ardour / automatable.cc
index 0f6fbdbe17c6501a669fc84f8e21a7bb1e3674d8..8629722889de2fe5d86a65140893146237addcbe 100644 (file)
@@ -25,8 +25,6 @@
 
 #include "pbd/error.h"
 
-#include "midi++/names.h"
-
 #include "ardour/amp.h"
 #include "ardour/automatable.h"
 #include "ardour/event_type_map.h"
@@ -42,7 +40,6 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
-framecnt_t Automatable::_automation_interval = 0;
 const string Automatable::xml_node_name = X_("Automation");
 
 Automatable::Automatable(Session& session)
@@ -140,16 +137,20 @@ Automatable::add_control(boost::shared_ptr<Evoral::Control> ac)
        Evoral::Parameter param = ac->parameter();
 
        boost::shared_ptr<AutomationList> al = boost::dynamic_pointer_cast<AutomationList> (ac->list ());
-       assert (al);
 
-       al->automation_state_changed.connect_same_thread (
-               _list_connections, boost::bind (&Automatable::automation_list_automation_state_changed, this, ac->parameter(), _1)
-               );
+       if (al) {
+               al->automation_state_changed.connect_same_thread (
+                       _list_connections,
+                       boost::bind (&Automatable::automation_list_automation_state_changed,
+                                    this, ac->parameter(), _1));
+       }
 
        ControlSet::add_control (ac);
        _can_automate_list.insert (param);
 
-       automation_list_automation_state_changed (param, al->automation_state ()); // sync everything up
+       if (al) {
+               automation_list_automation_state_changed (param, al->automation_state ()); // sync everything up
+       }
 }
 
 string
@@ -159,9 +160,10 @@ Automatable::describe_parameter (Evoral::Parameter param)
 
        if (param == Evoral::Parameter(GainAutomation)) {
                return _("Fader");
+       } else if (param.type() == MuteAutomation) {
+               return _("Mute");
        } else if (param.type() == MidiCCAutomation) {
-               return string_compose("%1: %2 [%3]",
-                               param.id(), midi_name(param.id()), int(param.channel()) + 1);
+               return string_compose("Controller %1 [%2]", param.id(), int(param.channel()) + 1);
        } else if (param.type() == MidiPgmChangeAutomation) {
                return string_compose("Program [%1]", int(param.channel()) + 1);
        } else if (param.type() == MidiPitchBenderAutomation) {
@@ -396,6 +398,7 @@ Automatable::control_factory(const Evoral::Parameter& param)
                MidiTrack* mt = dynamic_cast<MidiTrack*>(this);
                if (mt) {
                        control = new MidiTrack::MidiControl(mt, param);
+                       list.reset();  // No list, this is region "automation"
                } else {
                        warning << "MidiCCAutomation for non-MidiTrack" << endl;
                }