mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
[yabridgectl] Symlink VST 3.6.10 bundle resources
Although I haven't run into any of these 'new' bundles yet. Everything's still in the legacy format.
This commit is contained in:
@@ -282,7 +282,19 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
|
||||
&windows_module_path,
|
||||
)?;
|
||||
|
||||
// TODO: Symlink resources and presets
|
||||
// If `module` is a bundle, then it may contain a `Resources` directory with
|
||||
// screenshots and documentation
|
||||
// TODO: Also symlink presets, but this is a bit more involved. See
|
||||
// https://steinbergmedia.github.io/vst3_doc/vstinterfaces/vst3loc.html#win7preset
|
||||
if let Some(original_resources_dir) = module.original_resources_dir() {
|
||||
install_file(
|
||||
false,
|
||||
InstallationMethod::Symlink,
|
||||
&original_resources_dir,
|
||||
None,
|
||||
&module.target_resources_dir(),
|
||||
)?;
|
||||
}
|
||||
|
||||
if options.verbose {
|
||||
println!(" {}", module.original_path().display());
|
||||
|
||||
@@ -138,6 +138,23 @@ impl Vst3Module {
|
||||
}
|
||||
}
|
||||
|
||||
/// If this was a VST 3.6.10 style bundle, then return the path to the `Resources` directory if
|
||||
/// it has one.
|
||||
pub fn original_resources_dir(&self) -> Option<PathBuf> {
|
||||
match &self {
|
||||
Vst3Module::Bundle(bundle_home, _) => {
|
||||
let mut path = bundle_home.join("Contents");
|
||||
path.push("Resources");
|
||||
if path.exists() {
|
||||
Some(path)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
Vst3Module::Legacy(_, _) => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the path to the bundle in `~/.vst3` corresponding to the bridged version of this module.
|
||||
///
|
||||
/// FIXME: How do we solve naming clashes from the same VST3 plugin being installed to multiple
|
||||
@@ -175,6 +192,16 @@ impl Vst3Module {
|
||||
path.push(self.original_module_name());
|
||||
path
|
||||
}
|
||||
|
||||
/// If the Windows VST3 plugin we're bridging was in a VST 3.6.10 style bundle and had a
|
||||
/// resources directory, then we'll symlink that directory to here so the host can access all
|
||||
/// its original resources.
|
||||
pub fn target_resources_dir(&self) -> PathBuf {
|
||||
let mut path = self.target_bundle_home();
|
||||
path.push("Contents");
|
||||
path.push("Resources");
|
||||
path
|
||||
}
|
||||
}
|
||||
|
||||
/// The architecture of a `.dll` file. Needed so we can create a merged bundle for VST3 plugins.
|
||||
|
||||
Reference in New Issue
Block a user