summaryrefslogtreecommitdiff
path: root/libs/ardour/luaproc.cc
diff options
context:
space:
mode:
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-08-02 13:41:29 +0200
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-08-06 19:38:09 +0200
commit08f3ef4ecdbd4369c8de844967648ec3b0656919 (patch)
tree91d45be9004d405bcb1333a51b67b1261544a0e3 /libs/ardour/luaproc.cc
parent865ab375d69d57572a9761dbada93f7edf1e4073 (diff)
Set \imprecise when a configuration is chosen
Instead of setting \imprecise at the end of the loop if a configuration was found (which clobbered valuable information, see dae2406187), set it each time a new configuration is chosen. In the second loop that tries harder, resetting \imprecise also avoids a previous "imprecise->set(AUDIO, 0)" to last even if another configuration is chosen later. Last but not least, it will enable correctly setting the midi input count hoped for by the configuration.
Diffstat (limited to 'libs/ardour/luaproc.cc')
-rw-r--r--libs/ardour/luaproc.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc
index cfe6682067..ae0b09717f 100644
--- a/libs/ardour/luaproc.cc
+++ b/libs/ardour/luaproc.cc
@@ -391,6 +391,9 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan
if ((nch) > preferred_out) { p *= 1.1; } \
if (p < penalty) { \
audio_out = (nch); \
+ if (imprecise) { \
+ *imprecise = in; \
+ } \
penalty = p; \
found = true; \
} \
@@ -505,10 +508,6 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan
}
- if (found && imprecise) {
- *imprecise = in;
- }
-
if (!found && imprecise) {
/* try harder */
for (luabridge::Iterator i (iotable); !i.isNil (); ++i) {
@@ -531,7 +530,6 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan
assert (possible_in > 0); // all other cases will have been matched above
- imprecise->set (DataType::AUDIO, possible_in);
if (possible_out == -1 || possible_out == -2) {
FOUNDCFG (2);
} else if (possible_out < -2) {
@@ -541,6 +539,7 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan
/* exact number of outputs */
FOUNDCFG (possible_out);
}
+ imprecise->set (DataType::AUDIO, possible_in);
// ideally we'll also find the closest, best matching
// input configuration with minimal output penalty...
}