Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address interface ordering issue #16

Merged
merged 3 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions com/macros/support/src/utils/idents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ pub fn base_interface_idents(attr_args: &AttributeArgs) -> Vec<Ident> {

for item in &attr.nested {
if let NestedMeta::Meta(Meta::Path(p)) = item {
assert!(
p.segments.len() == 1,
assert_eq!(
p.segments.len(),
1,
"Incapable of handling multiple path segments yet."
);
base_interface_idents.push(
Expand All @@ -61,6 +62,22 @@ pub fn base_interface_idents(attr_args: &AttributeArgs) -> Vec<Ident> {
}
}

if base_interface_idents.contains(&format_ident!("IComponent")) {
assert_eq!(
base_interface_idents[0],
format_ident!("IComponent"),
"IComponent should always be first."
);
}

if base_interface_idents.contains(&format_ident!("IEditController")) {
assert_eq!(
base_interface_idents[0],
format_ident!("IEditController"),
"IEditController should always be first."
);
}

base_interface_idents
}

Expand Down Expand Up @@ -92,8 +109,9 @@ pub fn get_aggr_map(attr_args: &AttributeArgs) -> HashMap<Ident, Vec<Ident>> {

for item in &attr.nested {
if let NestedMeta::Meta(Meta::Path(p)) = item {
assert!(
p.segments.len() == 1,
assert_eq!(
p.segments.len(),
1,
"Incapable of handling multiple path segments yet."
);
aggr_interfaces_idents.push(
Expand Down
2 changes: 0 additions & 2 deletions examples/passthru.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ unsafe fn wstrcpy(src: &str, dst: *mut c_short) {
}

#[VST3(implements(
IComponent,
IPluginBase,
IEditController,
IAudioProcessor,
IAutomationState,
Expand Down