mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Move initialization message to a function
It was starting to get a bit unwieldy.
This commit is contained in:
@@ -103,58 +103,7 @@ PluginBridge::PluginBridge(audioMasterCallback host_callback)
|
|||||||
bp::start_dir = vst_plugin_path.parent_path())
|
bp::start_dir = vst_plugin_path.parent_path())
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
std::stringstream init_msg;
|
log_init_message();
|
||||||
init_msg << "Initializing yabridge version " << yabridge_git_version
|
|
||||||
<< std::endl;
|
|
||||||
init_msg << "host: '" << vst_host_path.string() << "'" << std::endl;
|
|
||||||
init_msg << "plugin: '" << vst_plugin_path.string() << "'"
|
|
||||||
<< std::endl;
|
|
||||||
init_msg << "socket: '" << socket_endpoint.path() << "'" << std::endl;
|
|
||||||
init_msg << "wine prefix: '"
|
|
||||||
<< find_wineprefix().value_or("<default>").string() << "'"
|
|
||||||
<< std::endl;
|
|
||||||
init_msg << "wine version: '" << wine_version << "'" << std::endl;
|
|
||||||
init_msg << std::endl;
|
|
||||||
|
|
||||||
// Print the path to the currently loaded configuration file and all
|
|
||||||
// settings in use. Printing the matched glob pattern could also be useful
|
|
||||||
// but it'll be very noisy and it's likely going to be clear from the shown
|
|
||||||
// values anyways.
|
|
||||||
init_msg << "config path: '"
|
|
||||||
<< config.matched_file.value_or("<default>").string() << "'"
|
|
||||||
<< std::endl;
|
|
||||||
init_msg << "hosting mode: '";
|
|
||||||
if (config.group.has_value()) {
|
|
||||||
init_msg << "group \"" << config.group.value() << "\"";
|
|
||||||
} else {
|
|
||||||
init_msg << "individual";
|
|
||||||
}
|
|
||||||
if (vst_plugin_arch == PluginArchitecture::vst_32) {
|
|
||||||
init_msg << ", 32-bit";
|
|
||||||
} else {
|
|
||||||
init_msg << ", 64-bit";
|
|
||||||
}
|
|
||||||
init_msg << "'" << std::endl;
|
|
||||||
init_msg << std::endl;
|
|
||||||
|
|
||||||
// Include a list of enabled compile-tiem features, mostly to make debug
|
|
||||||
// logs more useful
|
|
||||||
// TODO: Add a feature flag for the plugin group support
|
|
||||||
init_msg << "Enabled features:" << std::endl;
|
|
||||||
#ifdef USE_BITBRIDGE
|
|
||||||
init_msg << "- bitbridge support" << std::endl;
|
|
||||||
#endif
|
|
||||||
#ifdef USE_WINEDBG
|
|
||||||
init_msg << "- winedbg" << std::endl;
|
|
||||||
#endif
|
|
||||||
#if !(defined(USE_BITBRIDGE) || defined(USE_WINEDBG))
|
|
||||||
init_msg << " <none>" << std::endl;
|
|
||||||
#endif
|
|
||||||
init_msg << std::endl;
|
|
||||||
|
|
||||||
for (std::string line = ""; std::getline(init_msg, line);) {
|
|
||||||
logger.log(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print the Wine host's STDOUT and STDERR streams to the log file. This
|
// Print the Wine host's STDOUT and STDERR streams to the log file. This
|
||||||
// should be done before trying to accept the sockets as otherwise we will
|
// should be done before trying to accept the sockets as otherwise we will
|
||||||
@@ -676,6 +625,66 @@ void PluginBridge::async_log_pipe_lines(patched_async_pipe& pipe,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PluginBridge::log_init_message() {
|
||||||
|
std::stringstream init_msg;
|
||||||
|
|
||||||
|
init_msg << "Initializing yabridge version " << yabridge_git_version
|
||||||
|
<< std::endl;
|
||||||
|
init_msg << "host: '" << vst_host_path.string() << "'" << std::endl;
|
||||||
|
init_msg << "plugin: '" << vst_plugin_path.string() << "'"
|
||||||
|
<< std::endl;
|
||||||
|
init_msg << "socket: '" << socket_endpoint.path() << "'" << std::endl;
|
||||||
|
init_msg << "wine prefix: '"
|
||||||
|
<< find_wineprefix().value_or("<default>").string() << "'"
|
||||||
|
<< std::endl;
|
||||||
|
init_msg << "wine version: '" << wine_version << "'" << std::endl;
|
||||||
|
init_msg << std::endl;
|
||||||
|
|
||||||
|
// Print the path to the currently loaded configuration file and all
|
||||||
|
// settings in use. Printing the matched glob pattern could also be useful
|
||||||
|
// but it'll be very noisy and it's likely going to be clear from the shown
|
||||||
|
// values anyways.
|
||||||
|
// TODO: The group socket should take into account the:
|
||||||
|
// - wine prefix
|
||||||
|
// - group name
|
||||||
|
// - architecture
|
||||||
|
init_msg << "config path: '"
|
||||||
|
<< config.matched_file.value_or("<default>").string() << "'"
|
||||||
|
<< std::endl;
|
||||||
|
init_msg << "hosting mode: '";
|
||||||
|
if (config.group.has_value()) {
|
||||||
|
init_msg << "group \"" << config.group.value() << "\"";
|
||||||
|
} else {
|
||||||
|
init_msg << "individual";
|
||||||
|
}
|
||||||
|
if (vst_plugin_arch == PluginArchitecture::vst_32) {
|
||||||
|
init_msg << ", 32-bit";
|
||||||
|
} else {
|
||||||
|
init_msg << ", 64-bit";
|
||||||
|
}
|
||||||
|
init_msg << "'" << std::endl;
|
||||||
|
init_msg << std::endl;
|
||||||
|
|
||||||
|
// Include a list of enabled compile-tiem features, mostly to make debug
|
||||||
|
// logs more useful
|
||||||
|
// TODO: Add a feature flag for the plugin group support
|
||||||
|
init_msg << "Enabled features:" << std::endl;
|
||||||
|
#ifdef USE_BITBRIDGE
|
||||||
|
init_msg << "- bitbridge support" << std::endl;
|
||||||
|
#endif
|
||||||
|
#ifdef USE_WINEDBG
|
||||||
|
init_msg << "- winedbg" << std::endl;
|
||||||
|
#endif
|
||||||
|
#if !(defined(USE_BITBRIDGE) || defined(USE_WINEDBG))
|
||||||
|
init_msg << " <none>" << std::endl;
|
||||||
|
#endif
|
||||||
|
init_msg << std::endl;
|
||||||
|
|
||||||
|
for (std::string line = ""; std::getline(init_msg, line);) {
|
||||||
|
logger.log(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// The below functions are proxy functions for the methods defined in
|
// The below functions are proxy functions for the methods defined in
|
||||||
// `Bridge.cpp`
|
// `Bridge.cpp`
|
||||||
|
|
||||||
|
|||||||
@@ -109,6 +109,11 @@ class PluginBridge {
|
|||||||
boost::asio::streambuf& buffer,
|
boost::asio::streambuf& buffer,
|
||||||
std::string prefix = "");
|
std::string prefix = "");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format and log all relevant debug information during initialization.
|
||||||
|
*/
|
||||||
|
void log_init_message();
|
||||||
|
|
||||||
boost::asio::io_context io_context;
|
boost::asio::io_context io_context;
|
||||||
boost::asio::local::stream_protocol::endpoint socket_endpoint;
|
boost::asio::local::stream_protocol::endpoint socket_endpoint;
|
||||||
boost::asio::local::stream_protocol::acceptor socket_acceptor;
|
boost::asio::local::stream_protocol::acceptor socket_acceptor;
|
||||||
|
|||||||
Reference in New Issue
Block a user