mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-06 19:40:10 +02:00
Allow missing Compatibility sections in moduleinfo
Don't know why anyone would do this though.
This commit is contained in:
@@ -17,6 +17,13 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
makes sure that Wine will keep using X11 even if Wayland support becomes
|
||||
available at some point.
|
||||
|
||||
### yabridgectl
|
||||
|
||||
- VST 3.7.5 `moduleinfo.json` files without a `Compatibility` field are now
|
||||
supported. Previously this would result in a parsing error because the whole
|
||||
point of the `moduleinfo.json` files is to provide `Compatibility` mappings
|
||||
for older VST2 plugins.
|
||||
|
||||
## [5.0.4] - 2023-02-23
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -28,8 +28,12 @@ use std::fmt::Write;
|
||||
pub struct ModuleInfo {
|
||||
#[serde(rename = "Classes")]
|
||||
classes: Vec<Class>,
|
||||
// The whole point of moduleinfo.json is so plugins can provide these compatibility mappings,
|
||||
// but apparently there are now plugins that have a moduleinfo file without compatibility
|
||||
// mappings
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[serde(rename = "Compatibility")]
|
||||
compatibility_mappings: Vec<CompatibilityMapping>,
|
||||
compatibility_mappings: Option<Vec<CompatibilityMapping>>,
|
||||
#[serde(flatten)]
|
||||
other: serde_jsonrc::Map<String, serde_jsonrc::Value>,
|
||||
}
|
||||
@@ -64,10 +68,13 @@ impl ModuleInfo {
|
||||
class.cid = encode_hex_uid(&rewrite_uid_byte_order(&decode_hex_uid(&class.cid)?));
|
||||
}
|
||||
|
||||
for mapping in &mut self.compatibility_mappings {
|
||||
mapping.new = encode_hex_uid(&rewrite_uid_byte_order(&decode_hex_uid(&mapping.new)?));
|
||||
for cid in &mut mapping.old {
|
||||
*cid = encode_hex_uid(&rewrite_uid_byte_order(&decode_hex_uid(cid)?))
|
||||
if let Some(compatibility_mappings) = &mut self.compatibility_mappings {
|
||||
for mapping in compatibility_mappings {
|
||||
mapping.new =
|
||||
encode_hex_uid(&rewrite_uid_byte_order(&decode_hex_uid(&mapping.new)?));
|
||||
for cid in &mut mapping.old {
|
||||
*cid = encode_hex_uid(&rewrite_uid_byte_order(&decode_hex_uid(cid)?))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user