+
+uint32_t
+VSTPlugin::designated_bypass_port ()
+{
+ if (_plugin->dispatcher (_plugin, effCanDo, 0, 0, const_cast<char*> ("bypass"), 0.0f) != 0) {
+#ifdef ALLOW_VST_BYPASS_TO_FAIL // yet unused, see also plugin_insert.cc
+ return UINT32_MAX - 1; // emulate a port
+#else
+ /* check if plugin actually supports it,
+ * e.g. u-he Presswerk CanDo "bypass" but calling effSetBypass is a NO-OP.
+ * (presumably the plugin-author thinks hard-bypassing is a bad idea,
+ * particularly since the plugin itself provides a bypass-port)
+ */
+ intptr_t value = 0; // not bypassed
+ if (0 != _plugin->dispatcher (_plugin, 44 /*effSetBypass*/, 0, value, NULL, 0)) {
+ cerr << "Emulate VST Bypass Port for " << name() << endl; // XXX DEBUG
+ return UINT32_MAX - 1; // emulate a port
+ } else {
+ cerr << "Do *not* Emulate VST Bypass Port for " << name() << endl; // XXX DEBUG
+ }
+#endif
+ }
+ return UINT32_MAX;
+}
+