fix SConstruct so that it can build from a git checkout rather than an svn checkout
[ardour.git] / libs / ardour / audioengine.cc
index 6a76e98c3c5efdda5c23d72bccb3bba82105552d..3122ff760c71eb22d8378dd213310b039cebe881 100644 (file)
@@ -85,6 +85,23 @@ AudioEngine::AudioEngine (string client_name)
        }
 
        Port::set_engine (this);
+       
+       // Initialize parameter metadata (e.g. ranges)
+       Evoral::Parameter p(NullAutomation);
+       p = EventTypeMap::instance().new_parameter(NullAutomation);
+       p = EventTypeMap::instance().new_parameter(GainAutomation);
+       p = EventTypeMap::instance().new_parameter(PanAutomation);
+       p = EventTypeMap::instance().new_parameter(PluginAutomation);
+       p = EventTypeMap::instance().new_parameter(SoloAutomation);
+       p = EventTypeMap::instance().new_parameter(MuteAutomation);
+       p = EventTypeMap::instance().new_parameter(MidiCCAutomation);
+       p = EventTypeMap::instance().new_parameter(MidiPgmChangeAutomation);
+       p = EventTypeMap::instance().new_parameter(MidiPitchBenderAutomation);
+       p = EventTypeMap::instance().new_parameter(MidiChannelPressureAutomation);
+       p = EventTypeMap::instance().new_parameter(FadeInAutomation);
+       p = EventTypeMap::instance().new_parameter(FadeOutAutomation);
+       p = EventTypeMap::instance().new_parameter(EnvelopeAutomation);
+       p = EventTypeMap::instance().new_parameter(MidiCCAutomation);
 }
 
 AudioEngine::~AudioEngine ()
@@ -327,9 +344,16 @@ AudioEngine::process_callback (nframes_t nframes)
 
        boost::shared_ptr<Ports> p = ports.reader();
 
-       // Prepare ports (ie read data if necessary)
        for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
-               (*i)->cycle_start (nframes, 0);
+
+               /* Only run cycle_start() on output ports, because 
+                  inputs must be done in the correct processing order,
+                  which requires interleaving with route processing.
+               */
+
+               if ((*i)->sends_output()) {
+                       (*i)->cycle_start (nframes, 0);
+               }
        }
 
        if (_freewheeling) {
@@ -499,7 +523,9 @@ AudioEngine::set_session (Session *s)
                boost::shared_ptr<Ports> p = ports.reader();
 
                for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
-                       (*i)->cycle_start (blocksize, 0);
+                       if ((*i)->sends_output()) {
+                               (*i)->cycle_start (blocksize, 0);
+                       }
                }
 
                s->process (blocksize);
@@ -1186,19 +1212,10 @@ AudioEngine::connect_to_jack (string client_name)
        _jack = jack_client_open (jack_client_name.c_str(), options, &status, server_name);
 
        if (_jack == NULL) {
-
-               if (status & JackServerFailed) {
-                       error << _("Unable to connect to JACK server") << endmsg;
-               }
-               
                // error message is not useful here
                return -1;
        }
 
-       if (status & JackServerStarted) {
-               info << _("JACK server started") << endmsg;
-       }
-
        if (status & JackNameNotUnique) {
                jack_client_name = jack_get_client_name (_jack);
        }