X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fpanner_shell.cc;h=d99e5068c155a2cce7ed036df31400236bf99d8c;hb=9bf40bde3aed831791108bfccc4b1e10b071afdc;hp=a4a9342816375ac7ea8b8e34d9ef8c7c366fc8bc;hpb=e5e12acc5698090f2c0c614385e457cc0b46fbb0;p=ardour.git diff --git a/libs/ardour/panner_shell.cc b/libs/ardour/panner_shell.cc index a4a9342816..d99e5068c1 100644 --- a/libs/ardour/panner_shell.cc +++ b/libs/ardour/panner_shell.cc @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -33,7 +32,6 @@ #include #include "pbd/cartesian.h" -#include "pbd/boost_debug.h" #include "pbd/convert.h" #include "pbd/error.h" #include "pbd/failed_constructor.h" @@ -44,16 +42,18 @@ #include "ardour/audio_buffer.h" #include "ardour/audioengine.h" +#include "ardour/boost_debug.h" #include "ardour/buffer_set.h" #include "ardour/debug.h" #include "ardour/pannable.h" #include "ardour/panner.h" #include "ardour/panner_manager.h" #include "ardour/panner_shell.h" +#include "ardour/profile.h" #include "ardour/session.h" #include "ardour/speakers.h" -#include "i18n.h" +#include "pbd/i18n.h" #include "pbd/mathfix.h" @@ -74,7 +74,7 @@ PannerShell::PannerShell (string name, Session& s, boost::shared_ptr p { if (is_send) { _pannable_internal.reset(new Pannable (s)); - if (Config->get_link_send_and_route_panner()) { + if (Config->get_link_send_and_route_panner() && !ARDOUR::Profile->get_mixbus()) { _panlinked = true; } else { _panlinked = false; @@ -120,7 +120,7 @@ PannerShell::configure_io (ChanCount in, ChanCount out) PannerInfo* pi = PannerManager::instance().select_panner (in, out, _user_selected_panner_uri); if (!pi) { fatal << _("No panner found: check that panners are being discovered correctly during startup.") << endmsg; - /*NOTREACHED*/ + abort(); /*NOTREACHED*/ } DEBUG_TRACE (DEBUG::Panning, string_compose (_("select panner: %1\n"), pi->descriptor.name.c_str())); @@ -155,9 +155,9 @@ PannerShell::get_state () { XMLNode* node = new XMLNode ("PannerShell"); - node->add_property (X_("bypassed"), _bypassed ? X_("yes") : X_("no")); - node->add_property (X_("user-panner"), _user_selected_panner_uri); - node->add_property (X_("linked-to-route"), _panlinked ? X_("yes") : X_("no")); + node->set_property (X_("bypassed"), _bypassed); + node->set_property (X_("user-panner"), _user_selected_panner_uri); + node->set_property (X_("linked-to-route"), _panlinked); if (_panner && _is_send) { node->add_child_nocopy (_panner->get_state ()); @@ -171,29 +171,28 @@ PannerShell::set_state (const XMLNode& node, int version) { XMLNodeList nlist = node.children (); XMLNodeConstIterator niter; - const XMLProperty *prop; - LocaleGuard lg (X_("POSIX")); + bool yn; + std::string str; - if ((prop = node.property (X_("bypassed"))) != 0) { - set_bypassed (string_is_affirmative (prop->value ())); + if (node.get_property (X_("bypassed"), yn)) { + set_bypassed (yn); } - if ((prop = node.property (X_("linked-to-route"))) != 0) { - _panlinked = string_is_affirmative (prop->value ()); + if (node.get_property (X_("linked-to-route"), yn)) { + if (!ARDOUR::Profile->get_mixbus()) { + _panlinked = yn; + } } - if ((prop = node.property (X_("user-panner"))) != 0) { - _user_selected_panner_uri = prop->value (); - } + node.get_property (X_("user-panner"), _user_selected_panner_uri); _panner.reset (); - + for (niter = nlist.begin(); niter != nlist.end(); ++niter) { if ((*niter)->name() == X_("Panner")) { - - if ((prop = (*niter)->property (X_("uri")))) { - PannerInfo* p = PannerManager::instance().get_by_uri(prop->value()); + if ((*niter)->get_property (X_("uri"), str)) { + PannerInfo* p = PannerManager::instance().get_by_uri(str); if (p) { _panner.reset (p->descriptor.factory ( _is_send ? _pannable_internal : _pannable_route, _session.get_speakers ())); @@ -215,13 +214,13 @@ PannerShell::set_state (const XMLNode& node, int version) } else /* backwards compatibility */ - if ((prop = (*niter)->property (X_("type")))) { + if ((*niter)->get_property (X_("type"), str)) { list::iterator p; PannerManager& pm (PannerManager::instance()); for (p = pm.panner_info.begin(); p != pm.panner_info.end(); ++p) { - if (prop->value() == (*p)->descriptor.name) { + if (str == (*p)->descriptor.name) { /* note that we assume that all the stream panners are of the same type. pretty good @@ -253,7 +252,7 @@ PannerShell::set_state (const XMLNode& node, int version) if (p == pm.panner_info.end()) { error << string_compose (_("Unknown panner plugin \"%1\" found in pan state - ignored"), - prop->value()) + str) << endmsg; } @@ -284,13 +283,13 @@ PannerShell::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, pf AudioBuffer& dst = outbufs.get_audio(0); - if (gain_coeff == 0.0f) { + if (gain_coeff == GAIN_COEFF_ZERO) { /* gain was zero, so make it silent */ dst.silence (nframes); - } else if (gain_coeff == 1.0f){ + } else if (gain_coeff == GAIN_COEFF_UNITY){ /* mix all input buffers into the output */ @@ -341,7 +340,7 @@ PannerShell::distribute_no_automation (BufferSet& inbufs, BufferSet& outbufs, pf } void -PannerShell::run (BufferSet& inbufs, BufferSet& outbufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes) +PannerShell::run (BufferSet& inbufs, BufferSet& outbufs, samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes) { if (inbufs.count().n_audio() == 0) { /* Input has no audio buffers (e.g. Aux Send in a MIDI track at a @@ -383,16 +382,9 @@ PannerShell::run (BufferSet& inbufs, BufferSet& outbufs, framepos_t start_frame, // If we shouldn't play automation defer to distribute_no_automation - if (!(as & Play || ((as & Touch) && !_panner->touching()))) { + if (!((as & Play) || ((as & (Touch | Latch)) && !_panner->touching()))) { - // Speed quietning - gain_t gain_coeff = 1.0; - - if (fabsf(_session.transport_speed()) > 1.5f && Config->get_quieten_at_speed ()) { - gain_coeff = speed_quietning; - } - - distribute_no_automation (inbufs, outbufs, nframes, gain_coeff); + distribute_no_automation (inbufs, outbufs, nframes, 1.0); } else { @@ -403,7 +395,7 @@ PannerShell::run (BufferSet& inbufs, BufferSet& outbufs, framepos_t start_frame, i->silence(nframes); } - _panner->distribute_automated (inbufs, outbufs, start_frame, end_frame, nframes, _session.pan_automation_buffer()); + _panner->distribute_automated (inbufs, outbufs, start_sample, end_sample, nframes, _session.pan_automation_buffer()); } } @@ -413,7 +405,7 @@ PannerShell::set_bypassed (bool yn) if (yn == _bypassed) { return; } - + _bypassed = yn; _session.set_dirty (); Changed (); /* EMIT SIGNAL */