Skip to content

Commit edf3794

Browse files
committed
added derives to sampler
1 parent a29cd2b commit edf3794

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/firewheel-nodes/src/sampler.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,12 @@ pub enum PlaybackSpeedQuality {
9494
/// It supports pausing, resuming, looping, and changing the playback speed.
9595
#[derive(Clone, Diff, Patch, PartialEq)]
9696
#[cfg_attr(feature = "bevy", derive(bevy_ecs::prelude::Component))]
97+
#[cfg_attr(feature = "bevy_reflect", derive(bevy_reflect::Reflect))]
98+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9799
pub struct SamplerNode {
98100
/// The sample resource to use.
101+
#[cfg_attr(feature = "bevy_reflect", reflect(ignore))]
102+
#[cfg_attr(feature = "serde", serde(skip))]
99103
pub sample: Option<ArcGc<dyn SampleResource>>,
100104

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

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

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

0 commit comments

Comments
 (0)