Register the loggers for VST3 and CLAP plugins
This commit is contained in:
parent
5ae0bee3ee
commit
015c554d79
|
@ -7,3 +7,6 @@ pub(crate) mod util;
|
||||||
|
|
||||||
#[cfg(feature = "vst3")]
|
#[cfg(feature = "vst3")]
|
||||||
pub mod vst3;
|
pub mod vst3;
|
||||||
|
|
||||||
|
// This is used by the wrappers.
|
||||||
|
pub use util::setup_logger;
|
||||||
|
|
|
@ -29,8 +29,8 @@ macro_rules! nih_export_clap {
|
||||||
static ref FACTORY: ::nih_plug::wrapper::clap::Factory<$plugin_ty> = ::nih_plug::wrapper::clap::Factory::default();
|
static ref FACTORY: ::nih_plug::wrapper::clap::Factory<$plugin_ty> = ::nih_plug::wrapper::clap::Factory::default();
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't need any special initialization or deinitialization handling
|
|
||||||
pub extern "C" fn init(_plugin_path: *const ::std::os::raw::c_char) -> bool {
|
pub extern "C" fn init(_plugin_path: *const ::std::os::raw::c_char) -> bool {
|
||||||
|
::nih_plug::wrapper::setup_logger();
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,10 +56,6 @@ pub fn strlcpy(dest: &mut [c_char], src: &str) {
|
||||||
/// `OutputDebugString()`.
|
/// `OutputDebugString()`.
|
||||||
/// - A file path, in which case the output gets appended to the end of that file which will be
|
/// - A file path, in which case the output gets appended to the end of that file which will be
|
||||||
/// created if necessary.
|
/// created if necessary.
|
||||||
///
|
|
||||||
/// # TODO
|
|
||||||
///
|
|
||||||
/// Document `NIH_LOG` in an easier to find place.
|
|
||||||
pub fn setup_logger() {
|
pub fn setup_logger() {
|
||||||
// `win_dbg_logger` has no way to let us know that the logger has already been set up, so we'll
|
// `win_dbg_logger` has no way to let us know that the logger has already been set up, so we'll
|
||||||
// need to do it this way
|
// need to do it this way
|
||||||
|
|
|
@ -23,15 +23,13 @@ macro_rules! nih_export_vst3 {
|
||||||
Box::into_raw(factory) as *mut ::std::ffi::c_void
|
Box::into_raw(factory) as *mut ::std::ffi::c_void
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't need any special initialization logic, so all of these module entry point
|
|
||||||
// functions just return true all the time
|
|
||||||
|
|
||||||
// These two entry points are used on Linux, and they would theoretically also be used on
|
// These two entry points are used on Linux, and they would theoretically also be used on
|
||||||
// the BSDs:
|
// the BSDs:
|
||||||
// https://github.com/steinbergmedia/vst3_public_sdk/blob/c3948deb407bdbff89de8fb6ab8500ea4df9d6d9/source/main/linuxmain.cpp#L47-L52
|
// https://github.com/steinbergmedia/vst3_public_sdk/blob/c3948deb407bdbff89de8fb6ab8500ea4df9d6d9/source/main/linuxmain.cpp#L47-L52
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[cfg(all(target_family = "unix", not(target_os = "macos")))]
|
#[cfg(all(target_family = "unix", not(target_os = "macos")))]
|
||||||
pub extern "C" fn ModuleEntry(_lib_handle: *mut ::std::ffi::c_void) -> bool {
|
pub extern "C" fn ModuleEntry(_lib_handle: *mut ::std::ffi::c_void) -> bool {
|
||||||
|
::nih_plug::wrapper::setup_logger();
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,6 +44,7 @@ macro_rules! nih_export_vst3 {
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub extern "C" fn bundleEntry(_lib_handle: *mut ::std::ffi::c_void) -> bool {
|
pub extern "C" fn bundleEntry(_lib_handle: *mut ::std::ffi::c_void) -> bool {
|
||||||
|
::nih_plug::wrapper::setup_logger();
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +59,7 @@ macro_rules! nih_export_vst3 {
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub extern "system" fn InitDll() -> bool {
|
pub extern "system" fn InitDll() -> bool {
|
||||||
|
::nih_plug::wrapper::setup_logger();
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue