diff --git a/CHANGELOG.md b/CHANGELOG.md index cc670669..988414f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). - Changed the wording in `yabridgectl status` for plugins that have not been setup yet to look less dramatic and hopefully cause less confusion. +- Aside from the installation status, `yabridgectl status` now also shows a + plugin's type and architecture. This is color coded to make it easier to + visually parse the output. - Plugin paths printed during `yabridgectl status` and `yabridgectl sync --verbose` are now always shown relative to the plugin location instead of repeating the same path prefix for every plugin. diff --git a/tools/yabridgectl/src/actions.rs b/tools/yabridgectl/src/actions.rs index 11cdc199..9154a51c 100644 --- a/tools/yabridgectl/src/actions.rs +++ b/tools/yabridgectl/src/actions.rs @@ -121,7 +121,17 @@ pub fn show_status(config: &Config) -> Result<()> { // be added both with and without a trailing slash println!("\n{}", path.join("").display()); - for (plugin, status) in search_results.installation_status() { + for (plugin, (status, vst3_module)) in search_results.installation_status() { + let plugin_type = match vst3_module { + Some(module) => format!( + "{}, {}, {}", + "VST3".magenta(), + module.type_str(), + module.architecture + ), + None => "VST2".cyan().to_string(), + }; + let status_str = match status { Some(NativeFile::Regular(_)) => "copy".green(), Some(NativeFile::Symlink(_)) => "symlink".green(), @@ -130,8 +140,9 @@ pub fn show_status(config: &Config) -> Result<()> { }; println!( - " {} :: {}", + " {} :: {}, {}", plugin.strip_prefix(path).unwrap_or(&plugin).display(), + plugin_type, status_str ); } diff --git a/tools/yabridgectl/src/files.rs b/tools/yabridgectl/src/files.rs index 554b7c7d..2a0babbd 100644 --- a/tools/yabridgectl/src/files.rs +++ b/tools/yabridgectl/src/files.rs @@ -213,6 +213,14 @@ impl Vst3Module { path.push("Resources"); path } + + /// Get a textual representation of the module type. Used in `yabridgectl status`. + pub fn type_str(&self) -> &str { + match &self.module { + Vst3ModuleType::Legacy(_) => "legacy", + Vst3ModuleType::Bundle(_) => "bundle", + } + } } /// The architecture of a `.dll` file. Needed so we can create a merged bundle for VST3 plugins. @@ -245,8 +253,12 @@ impl LibArchitecture { impl SearchResults { /// For every found VST2 plugin and VST3 module, find the associated copy or symlink of /// `libyabridge-{vst2,vst3}.so`. The returned hashmap will contain a `None` value for plugins - /// that have not yet been set up. - pub fn installation_status(&self) -> BTreeMap> { + /// that have not yet been set up. For VST3 modules we'll also return the actual module since + /// this contains a lot of additional information we might want to print during `yabridgectl + /// status`. + pub fn installation_status( + &self, + ) -> BTreeMap, Option<&Vst3Module>)> { let so_files: HashMap<&Path, &NativeFile> = self .so_files .iter() @@ -254,13 +266,13 @@ impl SearchResults { .collect(); // Do this for the VST2 plugins - let mut installation_status: BTreeMap> = self + let mut installation_status: BTreeMap = self .vst2_files .iter() .map( |path| match so_files.get(path.with_extension("so").as_path()) { - Some(&file_type) => (path.clone(), Some(file_type.clone())), - None => (path.clone(), None), + Some(&file_type) => (path.clone(), (Some(file_type.clone()), None)), + None => (path.clone(), (None, None)), }, ) .collect(); @@ -270,7 +282,10 @@ impl SearchResults { installation_status.extend(self.vst3_modules.iter().map(|module| { ( module.original_path().to_owned(), - get_file_type(module.target_native_module_path()), + ( + get_file_type(module.target_native_module_path()), + Some(module), + ), ) }));