|
|
|
|
@@ -29,6 +29,7 @@
|
|
|
|
|
#include "pbd/error.h"
|
|
|
|
|
#include "pbd/compose.h"
|
|
|
|
|
#include "pbd/file_utils.h"
|
|
|
|
|
#include "pbd/stateful.h"
|
|
|
|
|
#include "pbd/stl_delete.h"
|
|
|
|
|
|
|
|
|
|
#include "ardour/debug.h"
|
|
|
|
|
@@ -68,13 +69,13 @@ PannerManager::instance ()
|
|
|
|
|
static bool panner_filter (const string& str, void */*arg*/)
|
|
|
|
|
{
|
|
|
|
|
#ifdef COMPILER_MSVC
|
|
|
|
|
/**
|
|
|
|
|
* Different build targets (Debug / Release etc) use different versions
|
|
|
|
|
* of the 'C' runtime (which can't be 'mixed & matched'). Therefore, in
|
|
|
|
|
* case the supplied search path contains multiple version(s) of a given
|
|
|
|
|
* panner module, only select the one(s) which match the current build
|
|
|
|
|
* target (otherwise, all hell will break loose !!)
|
|
|
|
|
*/
|
|
|
|
|
/**
|
|
|
|
|
* Different build targets (Debug / Release etc) use different versions
|
|
|
|
|
* of the 'C' runtime (which can't be 'mixed & matched'). Therefore, in
|
|
|
|
|
* case the supplied search path contains multiple version(s) of a given
|
|
|
|
|
* panner module, only select the one(s) which match the current build
|
|
|
|
|
* target (otherwise, all hell will break loose !!)
|
|
|
|
|
*/
|
|
|
|
|
#if defined (_DEBUG)
|
|
|
|
|
return str.length() > 12 && (str.find ("panner_") == 0) && (str.find ("D.dll") == (str.length() - 5));
|
|
|
|
|
#elif defined (RDC_BUILD)
|
|
|
|
|
@@ -170,27 +171,34 @@ PannerInfo*
|
|
|
|
|
PannerManager::select_panner (ChanCount in, ChanCount out, std::string const uri)
|
|
|
|
|
{
|
|
|
|
|
PannerInfo* rv = NULL;
|
|
|
|
|
PanPluginDescriptor* d;
|
|
|
|
|
int32_t nin = in.n_audio();
|
|
|
|
|
int32_t nout = out.n_audio();
|
|
|
|
|
uint32_t priority = 0;
|
|
|
|
|
|
|
|
|
|
/* look for user-preference -- check if channels match */
|
|
|
|
|
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
|
|
|
|
d = &(*p)->descriptor;
|
|
|
|
|
if (d->panner_uri != uri) continue;
|
|
|
|
|
if (d->in != nin && d->in != -1) continue;
|
|
|
|
|
if (d->out != nout && d->out != -1) continue;
|
|
|
|
|
PanPluginDescriptor const& d ((*p)->descriptor);
|
|
|
|
|
if (d.panner_uri != uri) continue;
|
|
|
|
|
if (d.in != nin && d.in != -1) continue;
|
|
|
|
|
if (d.out != nout && d.out != -1) continue;
|
|
|
|
|
return *p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* look for exact match first */
|
|
|
|
|
|
|
|
|
|
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
|
|
|
|
d = &(*p)->descriptor;
|
|
|
|
|
PanPluginDescriptor const& d ((*p)->descriptor);
|
|
|
|
|
|
|
|
|
|
if (d->in == nin && d->out == nout && d->priority > priority) {
|
|
|
|
|
priority = d->priority;
|
|
|
|
|
/* backward compat */
|
|
|
|
|
if (Stateful::loading_state_version < 6000 && d.panner_uri == "http://ardour.org/plugin/panner_2in2out") {
|
|
|
|
|
if (d.in == nin && d.out == nout) {
|
|
|
|
|
priority = 9999;
|
|
|
|
|
rv = *p;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (d.in == nin && d.out == nout && d.priority > priority) {
|
|
|
|
|
priority = d.priority;
|
|
|
|
|
rv = *p;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -198,38 +206,45 @@ PannerManager::select_panner (ChanCount in, ChanCount out, std::string const uri
|
|
|
|
|
|
|
|
|
|
/* no exact match, look for good fit on inputs and variable on outputs */
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
priority = 0;
|
|
|
|
|
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
|
|
|
|
d = &(*p)->descriptor;
|
|
|
|
|
/* unused, so far Ardour only features 4 panners:
|
|
|
|
|
* in = 1 ; out = 2 // Mono to Stereo
|
|
|
|
|
* in = 2 ; out = 2 // Equal Power Stereo
|
|
|
|
|
* in = 2 ; out = 2 // Stereo Balance
|
|
|
|
|
* in = -1 ; out = -1 // VBAP
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (d->in == nin && d->out == -1 && d->priority > priority) {
|
|
|
|
|
priority = d->priority;
|
|
|
|
|
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
|
|
|
|
PanPluginDescriptor const& d ((*p)->descriptor);
|
|
|
|
|
|
|
|
|
|
if (d.in == nin && d.out == -1 && d.priority > priority) {
|
|
|
|
|
priority = d.priority;
|
|
|
|
|
rv = *p;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (rv) { return rv; }
|
|
|
|
|
|
|
|
|
|
/* no exact match, look for good fit on outputs and variable on inputs */
|
|
|
|
|
|
|
|
|
|
priority = 0;
|
|
|
|
|
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
|
|
|
|
d = &(*p)->descriptor;
|
|
|
|
|
PanPluginDescriptor const& d ((*p)->descriptor);
|
|
|
|
|
|
|
|
|
|
if (d->in == -1 && d->out == nout && d->priority > priority) {
|
|
|
|
|
priority = d->priority;
|
|
|
|
|
if (d.in == -1 && d.out == nout && d.priority > priority) {
|
|
|
|
|
priority = d.priority;
|
|
|
|
|
rv = *p;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (rv) { return rv; }
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* no exact match, look for variable fit on inputs and outputs */
|
|
|
|
|
|
|
|
|
|
priority = 0;
|
|
|
|
|
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
|
|
|
|
d = &(*p)->descriptor;
|
|
|
|
|
PanPluginDescriptor const& d ((*p)->descriptor);
|
|
|
|
|
|
|
|
|
|
if (d->in == -1 && d->out == -1 && d->priority > priority) {
|
|
|
|
|
priority = d->priority;
|
|
|
|
|
if (d.in == -1 && d.out == -1 && d.priority > priority) {
|
|
|
|
|
priority = d.priority;
|
|
|
|
|
rv = *p;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -265,11 +280,11 @@ PannerManager::get_available_panners(uint32_t const a_in, uint32_t const a_out)
|
|
|
|
|
|
|
|
|
|
/* get available panners for current configuration. */
|
|
|
|
|
for (list<PannerInfo*>::const_iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
|
|
|
|
|
PanPluginDescriptor* d = &(*p)->descriptor;
|
|
|
|
|
if (d->in != -1 && d->in != in) continue;
|
|
|
|
|
if (d->out != -1 && d->out != out) continue;
|
|
|
|
|
if (d->in == -1 && d->out == -1 && out <= 2) continue;
|
|
|
|
|
panner_list.insert(std::pair<std::string,std::string>(d->panner_uri,d->name));
|
|
|
|
|
PanPluginDescriptor const& d ((*p)->descriptor);
|
|
|
|
|
if (d.in != -1 && d.in != in) continue;
|
|
|
|
|
if (d.out != -1 && d.out != out) continue;
|
|
|
|
|
if (d.in == -1 && d.out == -1 && out <= 2) continue;
|
|
|
|
|
panner_list.insert(std::pair<std::string,std::string>(d.panner_uri,d.name));
|
|
|
|
|
}
|
|
|
|
|
return panner_list;
|
|
|
|
|
}
|
|
|
|
|
|