MetadataFields

Trait MetadataFields 

Source
pub trait MetadataFields {
    // Required methods
    fn title(&self) -> &str;
    fn author(&self) -> &str;
    fn format(&self) -> &str;

    // Provided methods
    fn comments(&self) -> &str { ... }
    fn frame_count(&self) -> Option<usize> { ... }
    fn frame_rate(&self) -> u32 { ... }
    fn duration_seconds(&self) -> Option<f32> { ... }
    fn loop_frame(&self) -> Option<usize> { ... }
}
Expand description

Unified metadata trait for chiptune playback.

Implementations of this trait provide a common interface to access song metadata regardless of the underlying file format.

Required Methods§

Source

fn title(&self) -> &str

Get the song title.

Source

fn author(&self) -> &str

Get the author/composer name.

Source

fn format(&self) -> &str

Get the file format identifier.

Examples: “YM6”, “AKS”, “AY”

Provided Methods§

Source

fn comments(&self) -> &str

Get additional comments or description.

Returns an empty string if no comments are available.

Source

fn frame_count(&self) -> Option<usize>

Get the total frame count, if known.

Source

fn frame_rate(&self) -> u32

Get the playback frame rate in Hz.

Typical values: 50 (PAL) or 60 (NTSC).

Source

fn duration_seconds(&self) -> Option<f32>

Get the song duration in seconds, if known.

Source

fn loop_frame(&self) -> Option<usize>

Get the loop start frame, if the song loops.

Implementors§