mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Add unknown interface logging on the Wine side
This commit is contained in:
@@ -32,9 +32,9 @@ Vst3ComponentHandlerProxyImpl::queryInterface(const Steinberg::TUID _iid,
|
||||
// TODO: Successful queries should also be logged
|
||||
const tresult result = Vst3ComponentHandlerProxy::queryInterface(_iid, obj);
|
||||
if (result != Steinberg::kResultOk) {
|
||||
std::cerr << "TODO: Implement unknown interface logging on Wine side "
|
||||
"for Vst3ComponentHandlerProxyImpl::queryInterface"
|
||||
<< std::endl;
|
||||
bridge.logger.log_unknown_interface(
|
||||
"In IComponentHandler::queryInterface()",
|
||||
Steinberg::FUID::fromTUID(_iid));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -29,9 +29,9 @@ Vst3ConnectionPointProxyImpl::queryInterface(const Steinberg::TUID _iid,
|
||||
// TODO: Successful queries should also be logged
|
||||
const tresult result = Vst3ConnectionPointProxy::queryInterface(_iid, obj);
|
||||
if (result != Steinberg::kResultOk) {
|
||||
std::cerr << "TODO: Implement unknown interface logging on Wine side "
|
||||
"for Vst3ConnectionPointProxyImpl::queryInterface"
|
||||
<< std::endl;
|
||||
bridge.logger.log_unknown_interface(
|
||||
"In IConnectionPoint::queryInterface()",
|
||||
Steinberg::FUID::fromTUID(_iid));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -37,9 +37,8 @@ Vst3HostContextProxyImpl::queryInterface(const Steinberg::TUID _iid,
|
||||
// TODO: Successful queries should also be logged
|
||||
const tresult result = Vst3HostContextProxy::queryInterface(_iid, obj);
|
||||
if (result != Steinberg::kResultOk) {
|
||||
std::cerr << "TODO: Implement unknown interface logging on Wine side "
|
||||
"for Vst3HostContextProxyImpl::queryInterface"
|
||||
<< std::endl;
|
||||
bridge.logger.log_unknown_interface("In FUnknown::queryInterface()",
|
||||
Steinberg::FUID::fromTUID(_iid));
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -84,9 +83,8 @@ Vst3HostContextProxyImpl::createInstance(Steinberg::TUID /*cid*/,
|
||||
// When the host requests an interface we do not (yet) implement,
|
||||
// we'll print a recognizable log message
|
||||
const Steinberg::FUID uid = Steinberg::FUID::fromTUID(_iid);
|
||||
std::cerr << "TODO: Implement unknown interface logging on Wine side "
|
||||
"for Vst3HostContextProxyImpl::createInstance"
|
||||
<< std::endl;
|
||||
bridge.logger.log_unknown_interface(
|
||||
"In IHostApplication::createInstance()", uid);
|
||||
|
||||
return Steinberg::kNotImplemented;
|
||||
}
|
||||
|
||||
@@ -31,9 +31,8 @@ Vst3PlugFrameProxyImpl::queryInterface(const Steinberg::TUID _iid, void** obj) {
|
||||
// TODO: Successful queries should also be logged
|
||||
const tresult result = Vst3PlugFrameProxy::queryInterface(_iid, obj);
|
||||
if (result != Steinberg::kResultOk) {
|
||||
std::cerr << "TODO: Implement unknown interface logging on Wine side "
|
||||
"for Vst3PlugFrameProxyImpl::queryInterface"
|
||||
<< std::endl;
|
||||
bridge.logger.log_unknown_interface("In IPlugFrame::queryInterface()",
|
||||
Steinberg::FUID::fromTUID(_iid));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -40,6 +40,8 @@ Vst3Bridge::Vst3Bridge(MainContext& main_context,
|
||||
std::string plugin_dll_path,
|
||||
std::string endpoint_base_dir)
|
||||
: HostBridge(plugin_dll_path),
|
||||
generic_logger(Logger::create_wine_stderr()),
|
||||
logger(generic_logger),
|
||||
main_context(main_context),
|
||||
sockets(main_context.context, endpoint_base_dir, false) {
|
||||
std::string error;
|
||||
|
||||
@@ -263,6 +263,20 @@ class Vst3Bridge : public HostBridge {
|
||||
return do_call_response.get();
|
||||
}
|
||||
|
||||
private:
|
||||
Logger generic_logger;
|
||||
|
||||
public:
|
||||
/**
|
||||
* A logger instance we'll use to log about failed
|
||||
* `FUnknown::queryInterface` calls, so they can be hidden on verbosity
|
||||
* level 0.
|
||||
*
|
||||
* This only has to be used instead of directly writing to `std::cerr` when
|
||||
* the message should be hidden on lower verbosity levels.
|
||||
*/
|
||||
Vst3Logger logger;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Generate a nique instance identifier using an atomic fetch-and-add. This
|
||||
|
||||
Reference in New Issue
Block a user