pub struct TrackLoudness {
pub track_id: String,
pub file_path: String,
pub integrated_lufs: f64,
pub true_peak_dbtp: f64,
pub loudness_range: Option<f64>,
pub track_gain_db: f64,
pub album_gain_db: Option<f64>,
pub scan_version: i32,
pub scanned_at: i64,
pub file_mtime: Option<i64>,
pub file_size: Option<i64>,
/* private fields */
}Expand description
Loudness metadata for a single track
Fields§
§track_id: StringUnique identifier (file path or hash)
file_path: StringOriginal file path
integrated_lufs: f64Integrated loudness in LUFS
true_peak_dbtp: f64True peak in dBTP
loudness_range: Option<f64>Loudness range in LU (optional)
track_gain_db: f64Pre-computed track gain in dB (target - integrated)
album_gain_db: Option<f64>Album gain in dB (optional, for album mode)
scan_version: i32Scanner algorithm version
scanned_at: i64Unix timestamp of scan
file_mtime: Option<i64>File modification time (Unix timestamp, for change detection) FIX for Defect 40: Track file changes
file_size: Option<i64>File size in bytes (for change detection) FIX for Defect 40: Track file changes
Implementations§
Source§impl TrackLoudness
impl TrackLoudness
Sourcepub fn new(
file_path: &str,
integrated_lufs: f64,
true_peak_dbtp: f64,
loudness_range: Option<f64>,
target_lufs: f64,
) -> Self
pub fn new( file_path: &str, integrated_lufs: f64, true_peak_dbtp: f64, loudness_range: Option<f64>, target_lufs: f64, ) -> Self
Create a new loudness record from measurement results
FIX for Defect 40: Record file mtime and size for change detection. If file metadata cannot be read (e.g., HTTP URL), these will be None.
Sourcepub fn gain_for_target(&self, target_lufs: f64) -> f64
pub fn gain_for_target(&self, target_lufs: f64) -> f64
Get gain in dB for a specific target loudness
Sourcepub fn gain_linear(&self, target_lufs: f64) -> f32
pub fn gain_linear(&self, target_lufs: f64) -> f32
Convert dB gain to linear coefficient
Trait Implementations§
Source§impl Clone for TrackLoudness
impl Clone for TrackLoudness
Source§fn clone(&self) -> TrackLoudness
fn clone(&self) -> TrackLoudness
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for TrackLoudness
impl !RefUnwindSafe for TrackLoudness
impl !Sync for TrackLoudness
impl Send for TrackLoudness
impl Unpin for TrackLoudness
impl UnsafeUnpin for TrackLoudness
impl UnwindSafe for TrackLoudness
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more