1
0
Fork 0

Move ParamPtr to the prelude

This commit is contained in:
Robbert van der Helm 2022-03-23 12:46:46 +01:00
parent d97826e6a3
commit 9e3149b931
9 changed files with 9 additions and 16 deletions

View file

@ -220,7 +220,7 @@ pub fn derive_params(input: TokenStream) -> TokenStream {
unsafe impl #impl_generics Params for #struct_name #ty_generics #where_clause { unsafe impl #impl_generics Params for #struct_name #ty_generics #where_clause {
fn param_map( fn param_map(
self: std::pin::Pin<&Self>, self: std::pin::Pin<&Self>,
) -> Vec<(String, nih_plug::param::internals::ParamPtr, String)> { ) -> Vec<(String, nih_plug::prelude::ParamPtr, String)> {
// This may not be in scope otherwise, used to call .as_ptr() // This may not be in scope otherwise, used to call .as_ptr()
use ::nih_plug::param::Param; use ::nih_plug::param::Param;

View file

@ -5,8 +5,7 @@ use std::pin::Pin;
use egui::{TextStyle, Ui, Vec2}; use egui::{TextStyle, Ui, Vec2};
use nih_plug::context::ParamSetter; use nih_plug::context::ParamSetter;
use nih_plug::param::internals::ParamPtr; use nih_plug::prelude::{Param, ParamPtr, Params};
use nih_plug::prelude::{Param, Params};
use super::ParamSlider; use super::ParamSlider;

View file

@ -5,7 +5,7 @@
//! None of these widgets are finalized, and their sizes or looks can change at any point. Feel free //! None of these widgets are finalized, and their sizes or looks can change at any point. Feel free
//! to copy the widgets and modify them to your personal taste. //! to copy the widgets and modify them to your personal taste.
use nih_plug::param::internals::ParamPtr; use nih_plug::prelude::ParamPtr;
pub mod generic_ui; pub mod generic_ui;
pub mod param_slider; pub mod param_slider;

View file

@ -7,8 +7,7 @@ use std::collections::HashMap;
use std::marker::PhantomData; use std::marker::PhantomData;
use std::pin::Pin; use std::pin::Pin;
use nih_plug::param::internals::ParamPtr; use nih_plug::prelude::{Param, ParamPtr, Params};
use nih_plug::prelude::{Param, Params};
use super::{ParamMessage, ParamSlider}; use super::{ParamMessage, ParamSlider};
use crate::backend::Renderer; use crate::backend::Renderer;

View file

@ -5,8 +5,7 @@
//! None of these widgets are finalized, and their sizes or looks can change at any point. Feel free //! None of these widgets are finalized, and their sizes or looks can change at any point. Feel free
//! to copy the widgets and modify them to your personal taste. //! to copy the widgets and modify them to your personal taste.
use nih_plug::param::internals::ParamPtr; use nih_plug::prelude::{GuiContext, Param, ParamPtr};
use nih_plug::prelude::{GuiContext, Param};
use std::sync::Arc; use std::sync::Arc;
use vizia::{Context, Model}; use vizia::{Context, Model};

View file

@ -2,8 +2,7 @@
use std::{ops::Deref, pin::Pin}; use std::{ops::Deref, pin::Pin};
use nih_plug::param::internals::ParamPtr; use nih_plug::prelude::{ParamPtr, Params};
use nih_plug::prelude::Params;
use vizia::*; use vizia::*;
use super::{ParamSlider, ParamSliderExt, ParamSliderStyle}; use super::{ParamSlider, ParamSliderExt, ParamSliderStyle};

View file

@ -1,7 +1,6 @@
//! A slider that integrates with NIH-plug's [`Param`] types. //! A slider that integrates with NIH-plug's [`Param`] types.
use nih_plug::param::internals::ParamPtr; use nih_plug::prelude::{Param, ParamPtr};
use nih_plug::prelude::Param;
use vizia::*; use vizia::*;
use super::util::{self, ModifiersExt}; use super::util::{self, ModifiersExt};

View file

@ -1,6 +1,4 @@
//! TODO: Document how to use the [`Param`] trait. Also mention both interfaces: direct initialization //! TODO: Document how to use the [`Param`] trait. For now, just look at the gain example.
//! + `..Default::default()`, and the builder interface. For the moment, just look at the gain
//! example.
use std::fmt::Display; use std::fmt::Display;

View file

@ -14,7 +14,7 @@ pub use super::buffer::Buffer;
pub use super::context::{GuiContext, ParamSetter, ProcessContext}; pub use super::context::{GuiContext, ParamSetter, ProcessContext};
// This also includes the derive macro // This also includes the derive macro
pub use super::param::enums::{Enum, EnumParam}; pub use super::param::enums::{Enum, EnumParam};
pub use super::param::internals::Params; pub use super::param::internals::{ParamPtr, Params};
pub use super::param::range::{FloatRange, IntRange}; pub use super::param::range::{FloatRange, IntRange};
pub use super::param::smoothing::{Smoother, SmoothingStyle}; pub use super::param::smoothing::{Smoother, SmoothingStyle};
pub use super::param::{BoolParam, FloatParam, IntParam, Param}; pub use super::param::{BoolParam, FloatParam, IntParam, Param};