pub struct Waveform { /* private fields */ }Expand description
Realtime audio waveform widget.
Implementations§
Source§impl Waveform
impl Waveform
Sourcepub fn set_samples(&mut self, samples: &[f32])
pub fn set_samples(&mut self, samples: &[f32])
Replace the sample buffer in place; call this once per frame.
Sourcepub fn line_width(self, width: f32) -> Self
pub fn line_width(self, width: f32) -> Self
Set the line width (negative values become 0; NaN and infinities become 0 and huge values are clamped to +-1e15, so the stroke is always finite).
Sourcepub fn max_points(self, max_points: usize) -> Self
pub fn max_points(self, max_points: usize) -> Self
Set the upper bound on drawn points.
Sourcepub fn width(self, width: f32) -> Self
pub fn width(self, width: f32) -> Self
Set the preferred width.
Negative values become 0 and values above 1e15 are clamped to it; NaN
and infinities count as “not set”, so measure falls back to the
default width instead of reporting a non-finite size.
Sourcepub fn height(self, height: f32) -> Self
pub fn height(self, height: f32) -> Self
Set the preferred height (same rules as Waveform::width).
Sourcepub fn accessible_name(self, name: impl Into<String>) -> Self
pub fn accessible_name(self, name: impl Into<String>) -> Self
Set the accessible name.
Sourcepub fn get_samples(&self) -> &[f32]
pub fn get_samples(&self) -> &[f32]
The raw sample buffer.
Sourcepub fn get_line_width(&self) -> f32
pub fn get_line_width(&self) -> f32
The line width.
Sourcepub const fn get_max_points(&self) -> usize
pub const fn get_max_points(&self) -> usize
The upper bound on drawn points.
Trait Implementations§
Source§impl Brick for Waveform
impl Brick for Waveform
Source§fn brick_name(&self) -> &'static str
fn brick_name(&self) -> &'static str
Get the brick’s unique type name
Source§fn assertions(&self) -> &[BrickAssertion]
fn assertions(&self) -> &[BrickAssertion]
Get all assertions for this brick
Source§fn budget(&self) -> BrickBudget
fn budget(&self) -> BrickBudget
Get the performance budget
Source§fn verify(&self) -> BrickVerification
fn verify(&self) -> BrickVerification
Verify all assertions against current state Read more
Source§fn can_render(&self) -> bool
fn can_render(&self) -> bool
Check if this brick can be rendered (all assertions pass)
Source§impl Widget for Waveform
impl Widget for Waveform
Source§fn measure(&self, constraints: Constraints) -> Size
fn measure(&self, constraints: Constraints) -> Size
Compute intrinsic size constraints.
Source§fn layout(&mut self, bounds: Rect) -> LayoutResult
fn layout(&mut self, bounds: Rect) -> LayoutResult
Position children within allocated bounds.
Source§fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
Get mutable child widgets.
Source§fn accessible_name(&self) -> Option<&str>
fn accessible_name(&self) -> Option<&str>
Get the accessible name for screen readers.
Source§fn accessible_role(&self) -> AccessibleRole
fn accessible_role(&self) -> AccessibleRole
Get the accessible role.
Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Check if this widget is interactive (can receive focus/events).
Source§fn is_focusable(&self) -> bool
fn is_focusable(&self) -> bool
Check if this widget can receive keyboard focus.
Auto Trait Implementations§
impl Forget for Waveform
impl Freeze for Waveform
impl Move for Waveform
impl RefUnwindSafe for Waveform
impl Send for Waveform
impl Sync for Waveform
impl Unpin for Waveform
impl UnsafeUnpin for Waveform
impl UnwindSafe for Waveform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more