Skip to content

Commit

Permalink
rename param module to params
Browse files Browse the repository at this point in the history
  • Loading branch information
micahrj committed Jan 15, 2024
1 parent b4fb898 commit f469bbb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions coupler-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub fn derive_params(input: TokenStream) -> TokenStream {
range.to_token_stream()
} else {
let ty = &param.ty;
quote! { <#ty as ::coupler::param::DefaultRange>::default_range() }
quote! { <#ty as ::coupler::params::DefaultRange>::default_range() }
}
})
.collect();
Expand All @@ -193,7 +193,7 @@ pub fn derive_params(input: TokenStream) -> TokenStream {
LitStr::new(&param.ident.to_string(), param.ident.span())
};

let encode = quote! { ::coupler::param::Range::<#ty>::encode(&(#range), __value) };
let encode = quote! { ::coupler::params::Range::<#ty>::encode(&(#range), __value) };
let parse = if let Some(parse) = &param.parse {
quote! {
match (#parse)(__str) {
Expand All @@ -210,7 +210,7 @@ pub fn derive_params(input: TokenStream) -> TokenStream {
}
};

let decode = quote! { ::coupler::param::Range::<#ty>::decode(&(#range), __value) };
let decode = quote! { ::coupler::params::Range::<#ty>::decode(&(#range), __value) };
let display = if let Some(display) = &param.display {
quote! { (#display)(#decode, __formatter) }
} else if let Some(format) = &param.format {
Expand All @@ -220,11 +220,11 @@ pub fn derive_params(input: TokenStream) -> TokenStream {
};

quote! {
::coupler::param::ParamInfo {
::coupler::params::ParamInfo {
id: #id,
name: ::std::string::ToString::to_string(#name),
default: ::coupler::param::Range::<#ty>::encode(&(#range), __default.#ident),
steps: ::coupler::param::Range::<#ty>::steps(&(#range)),
default: ::coupler::params::Range::<#ty>::encode(&(#range), __default.#ident),
steps: ::coupler::params::Range::<#ty>::steps(&(#range)),
parse: ::std::boxed::Box::new(|__str| #parse),
display: ::std::boxed::Box::new(|__value, __formatter| #display),
}
Expand All @@ -238,7 +238,7 @@ pub fn derive_params(input: TokenStream) -> TokenStream {

quote! {
#id => {
self.#ident = ::coupler::param::Range::<#ty>::decode(&(#range), __value);
self.#ident = ::coupler::params::Range::<#ty>::decode(&(#range), __value);
}
}
});
Expand All @@ -250,14 +250,14 @@ pub fn derive_params(input: TokenStream) -> TokenStream {

quote! {
#id => {
::coupler::param::Range::<#ty>::encode(&(#range), self.#ident)
::coupler::params::Range::<#ty>::encode(&(#range), self.#ident)
}
}
});

let expanded = quote! {
impl #impl_generics ::coupler::param::Params for #ident #ty_generics #where_clause {
fn params() -> ::std::vec::Vec<::coupler::param::ParamInfo> {
impl #impl_generics ::coupler::params::Params for #ident #ty_generics #where_clause {
fn params() -> ::std::vec::Vec<::coupler::params::ParamInfo> {
let __default: #ident #ty_generics = ::std::default::Default::default();

::std::vec![
Expand Down
2 changes: 1 addition & 1 deletion examples/gain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};

use coupler::format::clap::*;
use coupler::format::vst3::*;
use coupler::{buffers::*, bus::*, events::*, param::*, parent::*, *};
use coupler::{buffers::*, bus::*, events::*, params::*, parent::*, *};

#[derive(Params, Serialize, Deserialize, Clone)]
struct GainParams {
Expand Down
2 changes: 1 addition & 1 deletion src/format/clap/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use clap_sys::{events::*, id::*, plugin::*, process::*, stream::*};
use crate::buffers::{Buffers, BusData};
use crate::bus::{BusDir, Format};
use crate::events::{Data, Event, Events};
use crate::param::ParamInfo;
use crate::params::ParamInfo;
use crate::sync::params::ParamValues;
use crate::util::{copy_cstring, slice_from_raw_parts_checked, DisplayParam};
use crate::{Config, Editor, Host, ParamId, ParamValue, Plugin, PluginInfo, Processor};
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod buffers;
pub mod bus;
pub mod events;
pub mod format;
pub mod param;
pub mod params;
pub mod parent;

mod sync;
Expand All @@ -13,7 +13,7 @@ mod util;
use buffers::Buffers;
use bus::{BusInfo, Layout};
use events::Events;
use param::ParamInfo;
use params::ParamInfo;
use parent::Parent;

pub type ParamId = u32;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::fmt::{self, Display, Formatter};
use std::os::raw::c_char;
use std::slice;

use crate::param::ParamInfo;
use crate::params::ParamInfo;
use crate::ParamValue;

pub fn copy_cstring(src: &str, dst: &mut [c_char]) {
Expand Down

0 comments on commit f469bbb

Please sign in to comment.