Skip to main content

AnalysisMetrics

Struct AnalysisMetrics 

Source
pub struct AnalysisMetrics {
    pub bass: f32,
    pub mid: f32,
    pub treb: f32,
    pub onset: f32,
    pub downbeat_confidence: f32,
    pub downbeat_locked: bool,
}
Expand description

A snapshot of the analysis side of diagnostics: what the audio is doing, as against Metrics’s what the renderer is doing.

§Why this is a second struct rather than six more fields on Metrics

Metrics claims, in its doc comment, to mirror the C ABI’s RlxMetrics. Growing it would either widen the C ABI or quietly make that claim false, and ADR-0052 chose neither: these values stay native-only, so the split makes “does not cross the ABI” a property of the type instead of a comment on a field that a later plan has no reason to read. It follows the standing line rather than inventing one — no analysis value has ever crossed the boundary (novelty is already marked native-API-only on the frame itself).

The named cost, from the same ADR: the foobar plugin gets no analysis diagnostics programmatically — no rlx_get_metrics counterpart, so nothing on that path can compute a lock rate — and it is the one frontend that never touches loopback capture. It does get them on screen: this overlay is core-drawn, so a host setting RLX_DEBUG_OVERLAY paints the same six rows the standalone’s F3 does (Plan 0049 close review corrected ADR-0052 on that point; see its Outcome section). If the estimator ever needs the machine-readable half on that path, RlxMetrics still leads with struct_size, so the growth is available — behind a superseding ADR.

Exactly the six values Plan 0048 Phase 6 needs to make its two judgements: whether the normalized levels ride the music, and whether the downbeat estimator locks. Nothing speculative — the *_raw twins, bpm, bar and novelty stay off until something asks.

Fields§

§bass: f32

Bass level, normalized against its recent peak (ADR-0049).

§mid: f32

Mid level, normalized against its recent peak.

§treb: f32

Treble level, normalized against its recent peak.

§onset: f32

Onset envelope, normalized against its recent peak.

§downbeat_confidence: f32

The downbeat estimator’s confidence in 0..1 (ADR-0050).

§downbeat_locked: bool

Whether the bar position came from the estimator rather than the counter fallback. This is the value ADR-0050’s stopping condition needs: from outside the app a wrong lock and the fallback look identical.

Trait Implementations§

Source§

impl Clone for AnalysisMetrics

Source§

fn clone(&self) -> AnalysisMetrics

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AnalysisMetrics

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AnalysisMetrics

Source§

fn default() -> AnalysisMetrics

Returns the “default value” for a type. Read more
Source§

impl From<&AnalysisFrame> for AnalysisMetrics

Source§

fn from(frame: &AnalysisFrame) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for AnalysisMetrics

Source§

fn eq(&self, other: &AnalysisMetrics) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for AnalysisMetrics

Source§

impl StructuralPartialEq for AnalysisMetrics

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,