Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion crates/firewheel-nodes/src/convolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ use firewheel_core::{
///
/// Convolution is often used to achieve reverb effects, but is more
/// computationally expensive than algorithmic reverb.
#[derive(Clone, Copy, Patch, Diff, PartialEq)]
#[derive(Patch, Diff, Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature = "bevy", derive(bevy_ecs::prelude::Component))]
#[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ConvolutionNode<const CHANNELS: usize> {
/// Pause the convolution processing.
///
Expand Down Expand Up @@ -65,6 +67,7 @@ pub struct ConvolutionNode<const CHANNELS: usize> {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "bevy", derive(bevy_ecs::prelude::Component))]
#[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ConvolutionNodeConfig<const CHANNELS: usize> {
/// The maximum number of supported IR channels (must be
/// `ChannelCount::MONO` or `ChannelCount::STEREO`). This determines the
Expand Down
3 changes: 3 additions & 0 deletions crates/firewheel-nodes/src/fast_rms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ use num_traits::Float;
/// algorithm using a sliding window.) But it should be good enough for games that
/// simply wish to react to player audio.
#[derive(Debug, Diff, Patch, Clone, Copy, PartialEq)]
#[cfg_attr(feature = "bevy", derive(bevy_ecs::prelude::Component))]
#[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct FastRmsNode {
/// Whether or not this node is enabled.
pub enabled: bool,
Expand Down
4 changes: 3 additions & 1 deletion crates/firewheel-nodes/src/freeverb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ mod freeverb;
///
/// Freeverb tends to have a somewhat metallic sound, but
/// its minimal computational cost makes it highly versatile.
#[derive(Diff, Patch, Clone, Debug, PartialEq)]
#[derive(Diff, Patch, Clone, Copy, Debug, PartialEq)]
#[cfg_attr(feature = "bevy", derive(bevy_ecs::component::Component))]
#[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct FreeverbNode {
/// Set the size of the emulated room, expressed from 0 to 1.
///
Expand All @@ -51,6 +52,7 @@ pub struct FreeverbNode {
pub pause: bool,

/// Reset the reverb, clearing its internal state.
#[cfg_attr(feature = "serde", serde(skip))]
pub reset: Notify<()>,

/// Adjusts the time in seconds over which parameters are smoothed.
Expand Down
2 changes: 2 additions & 0 deletions crates/firewheel-nodes/src/peak_meter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use firewheel_core::{

/// The configuration for a [`PeakMeterSmoother`]
#[derive(Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature = "bevy", derive(bevy_ecs::prelude::Component))]
#[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct PeakMeterSmootherConfig {
Expand Down Expand Up @@ -160,6 +161,7 @@ impl<const NUM_CHANNELS: usize> PeakMeterSmoother<NUM_CHANNELS> {
/// A node that calculates the peak amplitude of a signal, and then sends that value
/// to [`PeakMeterState`].
#[derive(Diff, Patch, Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "bevy", derive(bevy_ecs::prelude::Component))]
#[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct PeakMeterNode<const NUM_CHANNELS: usize> {
Expand Down
7 changes: 7 additions & 0 deletions crates/firewheel-nodes/src/sampler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ pub enum PlaybackSpeedQuality {
/// It supports pausing, resuming, looping, and changing the playback speed.
#[derive(Clone, Diff, Patch, PartialEq)]
#[cfg_attr(feature = "bevy", derive(bevy_ecs::prelude::Component))]
#[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct SamplerNode {
/// The sample resource to use.
#[cfg_attr(feature = "bevy_reflect", reflect(ignore))]
#[cfg_attr(feature = "serde", serde(skip))]
pub sample: Option<ArcGc<dyn SampleResource>>,

/// The volume to play the sample at.
Expand All @@ -109,6 +113,7 @@ pub struct SamplerNode {

/// Whether or not the current sample should start/restart playing (true), or be
/// paused/stopped (false).
#[cfg_attr(feature = "serde", serde(skip))]
pub play: Notify<bool>,

/// Defines where the sampler should start playing from when
Expand Down Expand Up @@ -453,6 +458,7 @@ impl SamplerState {
/// [`SamplerNode::play`] is set to `true`.
#[derive(Debug, Clone, Copy, PartialEq, RealtimeClone)]
#[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum PlayFrom {
/// When [`SamplerNode::play`] is set to `true`, the sampler will resume
/// playing from where it last left off.
Expand Down Expand Up @@ -525,6 +531,7 @@ impl Patch for PlayFrom {
/// How many times a sample should be repeated.
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Diff, Patch)]
#[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum RepeatMode {
/// Play the sample once and then stop.
#[default]
Expand Down