summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-01-10 12:36:20 +0100
committerRobin Gareus <robin@gareus.org>2014-01-10 12:36:20 +0100
commit7396fcf0b174344706083ea927ede616f03c5e0a (patch)
tree8fd8a7b056d8bf9172afb7aaf75e2003320d98b3
parent8d64665ce18a7feab1ad0483b2dc73e036ca2bf8 (diff)
re-configure _all_ panners on a route, when panner type changes
-rw-r--r--libs/ardour/route.cc53
1 files changed, 30 insertions, 23 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 951a4ff30c..6f23e920d4 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -1577,6 +1577,11 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams*
void
Route::set_custom_panner_uri (std::string const panner_uri)
{
+ if (_in_configure_processors) {
+ DEBUG_TRACE (DEBUG::Panning, string_compose (_("Route::set_custom_panner_uri '%1' -- called while in_configure_processors\n"), name()));
+ return;
+ }
+
if (!_main_outs->panner_shell()->set_user_selected_panner_uri(panner_uri)) {
DEBUG_TRACE (DEBUG::Panning, string_compose (_("Route::set_custom_panner_uri '%1 '%2' -- no change needed\n"), name(), panner_uri));
/* no change needed */
@@ -1585,33 +1590,35 @@ Route::set_custom_panner_uri (std::string const panner_uri)
DEBUG_TRACE (DEBUG::Panning, string_compose (_("Route::set_custom_panner_uri '%1 '%2' -- reconfigure I/O\n"), name(), panner_uri));
- if (_in_configure_processors) {
- DEBUG_TRACE (DEBUG::Panning, string_compose (_("Route::set_custom_panner_uri '%1' -- called while in_configure_processors\n"), name()));
- return;
- }
-
- /* reconfigure I/O */
+ /* reconfigure I/O -- re-initialize panner modules */
{
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
- ProcessorState pstate (this);
- if (panner())
- {
- /* there is already a panner it can just be re-configured in-place */
- Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
- ChanCount in = panner()->in();
- ChanCount out = panner()->out();
- _main_outs->panner_shell()->configure_io(in, out);
- _main_outs->panner_shell()->pannable()->set_panner(panner());
- }
- else
- {
- Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
+ Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());
- if (configure_processors_unlocked (0)) {
- pstate.restore ();
- configure_processors_unlocked (0); // it worked before we tried to add it ...
- return;
+ for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p) {
+ boost::shared_ptr<Delivery> dl;
+ boost::shared_ptr<Panner> panner;
+ if ((dl = boost::dynamic_pointer_cast<Delivery> (*p)) == 0) {
+ continue;
+ }
+ if (!dl->panner_shell()) {
+ continue;
+ }
+ if (!(panner = dl->panner_shell()->panner())) {
+ continue;
}
+ /* _main_outs has already been set before the loop.
+ * Ignore the return status here. It need reconfiguration */
+ if (dl->panner_shell() != _main_outs->panner_shell()) {
+ if (!dl->panner_shell()->set_user_selected_panner_uri(panner_uri)) {
+ continue;
+ }
+ }
+
+ ChanCount in = panner->in();
+ ChanCount out = panner->out();
+ dl->panner_shell()->configure_io(in, out);
+ dl->panner_shell()->pannable()->set_panner(dl->panner_shell()->panner());
}
}