mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
[yabridgectl] Rename the Vst3Module functions
Creating a clear naming scheme here is more difficult than it should be.
This commit is contained in:
@@ -238,7 +238,7 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
|
|||||||
// 32-bit and 64-bit versions of the plugin cna live inside of the same bundle), and
|
// 32-bit and 64-bit versions of the plugin cna live inside of the same bundle), and
|
||||||
// show a warning if we come across any duplicates.
|
// show a warning if we come across any duplicates.
|
||||||
let already_installed_architectures = yabridge_vst3_bundles
|
let already_installed_architectures = yabridge_vst3_bundles
|
||||||
.entry(module.yabridge_bundle_home())
|
.entry(module.target_bundle_home())
|
||||||
.or_insert_with(|| BTreeSet::new());
|
.or_insert_with(|| BTreeSet::new());
|
||||||
if !already_installed_architectures.insert(module.architecture()) {
|
if !already_installed_architectures.insert(module.architecture()) {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
@@ -248,7 +248,7 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
|
|||||||
prefix, skipping '{}'\n",
|
prefix, skipping '{}'\n",
|
||||||
"WARNING".red(),
|
"WARNING".red(),
|
||||||
module.architecture(),
|
module.architecture(),
|
||||||
module.yabridge_bundle_home().display(),
|
module.target_bundle_home().display(),
|
||||||
module.original_module_path().display(),
|
module.original_module_path().display(),
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
@@ -256,14 +256,23 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let native_module_path = module.yabridge_native_module_path();
|
// We're building a merged VST3 bundle containing both a copy or symlink to
|
||||||
|
// `libyabridge-vst3.so` and the Windows VST3 plugin
|
||||||
// For VST3 plugins we'll first have to create the bundle structure
|
let native_module_path = module.target_native_module_path();
|
||||||
utils::create_dir_all(native_module_path.parent().unwrap())?;
|
utils::create_dir_all(native_module_path.parent().unwrap())?;
|
||||||
|
if install_file(
|
||||||
|
options.force,
|
||||||
|
config.method,
|
||||||
|
files.libyabridge_vst3.as_ref().unwrap(),
|
||||||
|
Some(libyabridge_vst3_hash),
|
||||||
|
&native_module_path,
|
||||||
|
)? {
|
||||||
|
num_new += 1;
|
||||||
|
}
|
||||||
|
|
||||||
// We'll then symlink the Windows VST3 module to that bundle to create a merged
|
// We'll then symlink the Windows VST3 module to that bundle to create a merged
|
||||||
// bundle: https://steinbergmedia.github.io/vst3_doc/vstinterfaces/vst3loc.html#mergedbundles
|
// bundle: https://steinbergmedia.github.io/vst3_doc/vstinterfaces/vst3loc.html#mergedbundles
|
||||||
let windows_module_path = module.yabridge_windows_module_path();
|
let windows_module_path = module.target_windows_module_path();
|
||||||
utils::create_dir_all(windows_module_path.parent().unwrap())?;
|
utils::create_dir_all(windows_module_path.parent().unwrap())?;
|
||||||
install_file(
|
install_file(
|
||||||
true,
|
true,
|
||||||
@@ -275,16 +284,6 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
|
|||||||
|
|
||||||
// TODO: Symlink resources and presets
|
// TODO: Symlink resources and presets
|
||||||
|
|
||||||
if install_file(
|
|
||||||
options.force,
|
|
||||||
config.method,
|
|
||||||
files.libyabridge_vst3.as_ref().unwrap(),
|
|
||||||
Some(libyabridge_vst3_hash),
|
|
||||||
&native_module_path,
|
|
||||||
)? {
|
|
||||||
num_new += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if options.verbose {
|
if options.verbose {
|
||||||
println!(" {}", module.original_path().display());
|
println!(" {}", module.original_path().display());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,13 +142,13 @@ impl Vst3Module {
|
|||||||
///
|
///
|
||||||
/// FIXME: How do we solve naming clashes from the same VST3 plugin being installed to multiple
|
/// FIXME: How do we solve naming clashes from the same VST3 plugin being installed to multiple
|
||||||
/// Wine prefixes?
|
/// Wine prefixes?
|
||||||
pub fn yabridge_bundle_home(&self) -> PathBuf {
|
pub fn target_bundle_home(&self) -> PathBuf {
|
||||||
yabridge_vst3_home().join(self.original_module_name())
|
yabridge_vst3_home().join(self.original_module_name())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the path to the `libyabridge.so` file in `~/.vst3` corresponding to the bridged version
|
/// Get the path to the `libyabridge.so` file in `~/.vst3` corresponding to the bridged version
|
||||||
/// of this module.
|
/// of this module.
|
||||||
pub fn yabridge_native_module_path(&self) -> PathBuf {
|
pub fn target_native_module_path(&self) -> PathBuf {
|
||||||
let native_module_name = match &self {
|
let native_module_name = match &self {
|
||||||
Vst3Module::Legacy(path, _) | Vst3Module::Bundle(path, _) => path
|
Vst3Module::Legacy(path, _) | Vst3Module::Bundle(path, _) => path
|
||||||
.with_extension("so")
|
.with_extension("so")
|
||||||
@@ -159,7 +159,7 @@ impl Vst3Module {
|
|||||||
.to_owned(),
|
.to_owned(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut path = self.yabridge_bundle_home();
|
let mut path = self.target_bundle_home();
|
||||||
path.push("Contents");
|
path.push("Contents");
|
||||||
path.push("x86_64-linux");
|
path.push("x86_64-linux");
|
||||||
path.push(native_module_name);
|
path.push(native_module_name);
|
||||||
@@ -168,8 +168,8 @@ impl Vst3Module {
|
|||||||
|
|
||||||
/// Get the path to where we'll symlink `original_module_path`. This is part of the merged VST3
|
/// Get the path to where we'll symlink `original_module_path`. This is part of the merged VST3
|
||||||
/// bundle in `~/.vst3/yabridge`.
|
/// bundle in `~/.vst3/yabridge`.
|
||||||
pub fn yabridge_windows_module_path(&self) -> PathBuf {
|
pub fn target_windows_module_path(&self) -> PathBuf {
|
||||||
let mut path = self.yabridge_bundle_home();
|
let mut path = self.target_bundle_home();
|
||||||
path.push("Contents");
|
path.push("Contents");
|
||||||
path.push(self.architecture().vst_arch());
|
path.push(self.architecture().vst_arch());
|
||||||
path.push(self.original_module_name());
|
path.push(self.original_module_name());
|
||||||
@@ -230,7 +230,7 @@ impl SearchResults {
|
|||||||
// And for VST3 modules. We have not stored the paths to the corresponding `.so` files yet
|
// And for VST3 modules. We have not stored the paths to the corresponding `.so` files yet
|
||||||
// because they are not in any of the directories we're indexing.
|
// because they are not in any of the directories we're indexing.
|
||||||
installation_status.extend(self.vst3_modules.iter().map(|module| {
|
installation_status.extend(self.vst3_modules.iter().map(|module| {
|
||||||
let module_path = module.yabridge_native_module_path();
|
let module_path = module.target_native_module_path();
|
||||||
let install_type = get_file_type(module_path.clone());
|
let install_type = get_file_type(module_path.clone());
|
||||||
(module_path, install_type)
|
(module_path, install_type)
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user