22 #include <glibmm/pattern.h>
23 #include <glibmm/fileutils.h>
30 #include "ardour/debug.h"
43 PannerManager::PannerManager ()
47 PannerManager::~PannerManager ()
49 for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
55 PannerManager::instance ()
75 return str.length() > 12 && (str.find (
"panner_") == 0) && (str.find (
"D.dll") == (str.length() - 5));
76 #elif defined (RDC_BUILD)
77 return str.length() > 14 && (str.find (
"panner_") == 0) && (str.find (
"RDC.dll") == (str.length() - 7));
78 #elif defined (_WIN64)
79 return str.length() > 13 && (str.find (
"panner_") == 0) && (str.find (
"64.dll") == (str.length() - 6));
81 return str.length() > 13 && (str.find (
"panner_") == 0) && (str.find (
"32.dll") == (str.length() - 6));
83 #elif defined (__APPLE__)
84 return str[0] !=
'.' && (str.length() > 6 && str.find (
".dylib") == (str.length() - 6));
86 return str[0] !=
'.' && (str.length() > 3 && (str.find (
".so") == (str.length() - 3) || str.find (
".dll") == (str.length() - 4)));
91 PannerManager::discover_panners ()
93 std::vector<std::string> panner_modules;
99 for (vector<std::string>::iterator i = panner_modules.begin(); i != panner_modules.end(); ++i) {
100 panner_discover (*i);
105 PannerManager::panner_discover (
string path)
109 if ((pinfo = get_descriptor (path)) != 0) {
111 list<PannerInfo*>::iterator i;
113 for (i = panner_info.begin(); i != panner_info.end(); ++i) {
119 if (i == panner_info.end()) {
120 panner_info.push_back (pinfo);
131 PannerManager::get_descriptor (
string path)
133 Glib::Module* module =
new Glib::Module(path);
141 Glib::Module::get_last_error()) <<
endmsg;
146 if (!module->get_symbol(
"panner_descriptor", func)) {
154 descriptor = dfunc();
172 uint32_t priority = 0;
175 for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
176 d = &(*p)->descriptor;
178 if (d->
in != nin && d->
in != -1)
continue;
179 if (d->
out != nout && d->
out != -1)
continue;
185 for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
186 d = &(*p)->descriptor;
188 if (d->
in == nin && d->
out == nout && d->
priority > priority) {
193 if (rv) {
return rv; }
198 for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
199 d = &(*p)->descriptor;
201 if (d->
in == nin && d->
out == -1 && d->
priority > priority) {
206 if (rv) {
return rv; }
211 for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
212 d = &(*p)->descriptor;
214 if (d->
in == -1 && d->
out == nout && d->
priority > priority) {
219 if (rv) {
return rv; }
224 for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
225 d = &(*p)->descriptor;
232 if (rv) {
return rv; }
240 PannerManager::get_by_uri (std::string uri)
const
243 for (list<PannerInfo*>::const_iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
244 if ((*p)->descriptor.panner_uri != uri)
continue;
252 PannerManager::get_available_panners(uint32_t
const a_in, uint32_t
const a_out)
const
255 int const out = a_out;
258 if (out < 2 || in == 0) {
263 for (list<PannerInfo*>::const_iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
265 if (d->
in != -1 && d->
in != in)
continue;
266 if (d->
out != -1 && d->
out != out)
continue;
267 if (d->
in == -1 && d->
out == -1 && out <= 2)
continue;
268 panner_list.insert(std::pair<std::string,std::string>(d->
panner_uri,d->
name));
std::string to_string(T t, std::ios_base &(*f)(std::ios_base &))
LIBARDOUR_API PBD::Searchpath panner_search_path()
LIBPBD_API Transmitter error
LIBPBD_API Transmitter warning
std::ostream & endmsg(std::ostream &ostr)
static bool panner_filter(const string &str, void *)
PanPluginDescriptor descriptor
#define DEBUG_TRACE(bits, str)
LIBPBD_API Transmitter info
std::map< std::string, std::string > PannerUriMap
LIBARDOUR_API uint64_t Panning
void find_files_matching_filter(vector< string > &result, const Searchpath &paths, bool(*filter)(const string &, void *), void *arg, bool pass_fullpath, bool return_fullpath, bool recurse)
std::string string_compose(const std::string &fmt, const T1 &o1)