summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/configuration_vars.h4
-rw-r--r--libs/ardour/audio_unit.cc11
-rw-r--r--libs/ardour/route.cc54
-rw-r--r--libs/ardour/session.cc6
4 files changed, 34 insertions, 41 deletions
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index 3a6c8399b0..e2fd95edd0 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -33,8 +33,8 @@ CONFIG_VARIABLE (std::string, midi_port_name, "midi-port-name", "default")
CONFIG_VARIABLE (bool, trace_midi_input, "trace-midi-input", false)
CONFIG_VARIABLE (bool, trace_midi_output, "trace-midi-output", false)
CONFIG_VARIABLE (bool, send_mtc, "send-mtc", false)
-CONFIG_VARIABLE (bool, send_mmc, "send-mmc", false)
-CONFIG_VARIABLE (bool, mmc_control, "mmc-control", false)
+CONFIG_VARIABLE (bool, send_mmc, "send-mmc", true)
+CONFIG_VARIABLE (bool, mmc_control, "mmc-control", true)
CONFIG_VARIABLE (bool, midi_feedback, "midi-feedback", false)
CONFIG_VARIABLE (uint8_t, mmc_receive_device_id, "mmc-receive-device-id", 0)
CONFIG_VARIABLE (uint8_t, mmc_send_device_id, "mmc-send-device-id", 0x7f)
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc
index df4ff59be5..93cab504f6 100644
--- a/libs/ardour/audio_unit.cc
+++ b/libs/ardour/audio_unit.cc
@@ -93,12 +93,10 @@ AUPlugin::AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAC
streamFormat.mSampleRate = session.frame_rate();
streamFormat.mFormatID = kAudioFormatLinearPCM;
streamFormat.mFormatFlags = kAudioFormatFlagIsFloat|kAudioFormatFlagIsPacked|kAudioFormatFlagIsNonInterleaved;
+
#ifdef __LITTLE_ENDIAN__
- /* relax, for now */
+ /* relax */
#else
- /* it is ridiculous that this flag is needed when its
- opposite flag is not.
- */
streamFormat.mFormatFlags |= kAudioFormatFlagIsBigEndian;
#endif
@@ -329,7 +327,7 @@ AUPlugin::activate ()
if (!initialized) {
OSErr err;
if ((err = unit->Initialize()) != noErr) {
- error << string_compose (_("AUPlugin: cannot initialize plugin (err = %1)"), err) << endmsg;
+ error << string_compose (_("AUPlugin: %1 cannot initialize plugin (err = %2)"), name(), err) << endmsg;
} else {
frames_processed = 0;
initialized = true;
@@ -454,9 +452,10 @@ uint32_t
AUPlugin::output_streams() const
{
if (!(format_set & 0x2)) {
- warning << _("AUPlugin: output_streams() called without any format set!") << endmsg;
+ warning << string_compose (_("AUPlugin: %1 output_streams() called without any format set!"), name()) << endmsg;
return 1;
}
+
return streamFormat.mChannelsPerFrame;
}
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 1b26dd8c7f..f63524032d 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -861,6 +861,14 @@ Route::add_redirect (boost::shared_ptr<Redirect> redirect, void *src, uint32_t*
boost::shared_ptr<PluginInsert> pi;
boost::shared_ptr<PortInsert> porti;
+ _redirects.push_back (redirect);
+
+ if (_reset_plugin_counts (err_streams)) {
+ _redirects.pop_back ();
+ _reset_plugin_counts (0); // it worked before we tried to add it ...
+ return -1;
+ }
+
uint32_t potential_max_streams = 0;
if ((pi = boost::dynamic_pointer_cast<PluginInsert>(redirect)) != 0) {
@@ -901,14 +909,6 @@ Route::add_redirect (boost::shared_ptr<Redirect> redirect, void *src, uint32_t*
_max_peak_power.push_back(-INFINITY);
}
- _redirects.push_back (redirect);
-
- if (_reset_plugin_counts (err_streams)) {
- _redirects.pop_back ();
- _reset_plugin_counts (0); // it worked before we tried to add it ...
- return -1;
- }
-
redirect->activate ();
redirect->active_changed.connect (mem_fun (*this, &Route::redirect_active_proxy));
}
@@ -1129,14 +1129,14 @@ int
Route::_reset_plugin_counts (uint32_t* err_streams)
{
RedirectList::iterator r;
- uint32_t i_cnt;
- uint32_t s_cnt;
+ uint32_t insert_cnt = 0;
+ uint32_t send_cnt = 0;
map<Placement,list<InsertCount> > insert_map;
+ RedirectList::iterator prev;
nframes_t initial_streams;
+ int ret = -1;
redirect_max_outs = 0;
- i_cnt = 0;
- s_cnt = 0;
/* divide inserts up by placement so we get the signal flow
properly modelled. we need to do this because the _redirects
@@ -1148,14 +1148,8 @@ Route::_reset_plugin_counts (uint32_t* err_streams)
boost::shared_ptr<Insert> insert;
- /* do this here in case we bomb out before we get to the end of
- this function.
- */
-
- redirect_max_outs = max ((*r)->output_streams (), redirect_max_outs);
-
if ((insert = boost::dynamic_pointer_cast<Insert>(*r)) != 0) {
- ++i_cnt;
+ ++insert_cnt;
insert_map[insert->placement()].push_back (InsertCount (insert));
/* reset plugin counts back to one for now so
@@ -1170,15 +1164,16 @@ Route::_reset_plugin_counts (uint32_t* err_streams)
}
} else if (boost::dynamic_pointer_cast<Send> (*r) != 0) {
- ++s_cnt;
+ ++send_cnt;
}
}
- if (i_cnt == 0) {
- if (s_cnt) {
+ if (insert_cnt == 0) {
+ if (send_cnt) {
goto recompute;
} else {
- return 0;
+ ret = 0;
+ goto streamcount;
}
}
@@ -1189,7 +1184,7 @@ Route::_reset_plugin_counts (uint32_t* err_streams)
/* A: PreFader */
if (check_some_plugin_counts (insert_map[PreFader], n_inputs (), err_streams)) {
- return -1;
+ goto streamcount;
}
/* figure out the streams that will feed into PreFader */
@@ -1204,7 +1199,7 @@ Route::_reset_plugin_counts (uint32_t* err_streams)
/* B: PostFader */
if (check_some_plugin_counts (insert_map[PostFader], initial_streams, err_streams)) {
- return -1;
+ goto streamcount;
}
/* OK, everything can be set up correctly, so lets do it */
@@ -1217,7 +1212,7 @@ Route::_reset_plugin_counts (uint32_t* err_streams)
recompute:
redirect_max_outs = 0;
- RedirectList::iterator prev = _redirects.end();
+ prev = _redirects.end();
for (r = _redirects.begin(); r != _redirects.end(); prev = r, ++r) {
boost::shared_ptr<Send> s;
@@ -1241,8 +1236,13 @@ Route::_reset_plugin_counts (uint32_t* err_streams)
}
/* we're done */
-
return 0;
+
+ streamcount:
+ for (r = _redirects.begin(); r != _redirects.end(); ++r) {
+ redirect_max_outs = max ((*r)->output_streams (), redirect_max_outs);
+ }
+ return ret;
}
int32_t
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index a084a16574..d53291b178 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -578,16 +578,10 @@ Session::destroy ()
tmp = i;
++tmp;
- cerr << "Drop refs to " << i->second->name() << endl;
-
i->second->drop_references ();
-
- cerr << "move on\n";
i = tmp;
}
-
- cerr << "clear audio sources\n";
audio_sources.clear ();
#ifdef TRACK_DESTRUCTION