gooey/interface/view/component/sfx.rs
1use crate::interface::view::Sound;
2use super::impl_kind;
3
4#[derive(Clone, Debug, Default, Eq, PartialEq)]
5pub struct Sfx {
6 /// A generic ID for the backend to interpret as representing the sound being
7 /// played together with a playback state
8 pub playback : Option <(Sound, State)>
9}
10impl_kind!(Sfx);
11
12#[derive(Clone, Debug, Default, Eq, PartialEq)]
13pub enum State {
14 #[default]
15 Ready,
16 Play,
17 Loop,
18 /// Play from position in sample (PCM) timeunits
19 PlayFrom (u32),
20 /// Loop from position in sample (PCM) timeunits
21 LoopFrom (u32)
22}
23