pub struct TagContainer { /* private fields */ }
Expand description

Provides a streamlined interface for retrieving Serato tag data.

If you’re not interested in the low-level format details, just use this instead of the low-level structs (e.g. Markers, Markers2, etc.)

Some of the data in Serato’s tags is redundant and may contradict each other. This class implements the same merge strategies for inconsistent data that Serato uses, too.

Implementations§

source§

impl TagContainer

source

pub const fn new() -> Self

Create an empty Serato tag container.

source

pub fn parse_autotags( &mut self, input: &[u8], tag_format: TagFormat ) -> Result<(), Error>

Parse the Serato Autotags tag.

source

pub fn write_autotags( &self, writer: &mut impl Write, tag_format: TagFormat ) -> Result<usize, Error>

Write the Serato Autotags tag.

source

pub fn parse_beatgrid( &mut self, input: &[u8], tag_format: TagFormat ) -> Result<(), Error>

Parse the Serato BeatGrid tag.

source

pub fn write_beatgrid( &self, writer: &mut impl Write, tag_format: TagFormat ) -> Result<usize, Error>

Write the Serato BeatGrid tag.

source

pub fn parse_markers( &mut self, input: &[u8], tag_format: TagFormat ) -> Result<(), Error>

Parse the Serato Markers_ tag.

source

pub fn write_markers( &self, writer: &mut impl Write, tag_format: TagFormat ) -> Result<usize, Error>

Write the Serato Markers_ tag.

source

pub fn parse_markers2( &mut self, input: &[u8], tag_format: TagFormat ) -> Result<(), Error>

Parse the Serato Markers2 tag.

source

pub fn write_markers2( &self, writer: &mut impl Write, tag_format: TagFormat ) -> Result<usize, Error>

Write the Serato Markers2 tag.

source

pub fn parse_overview( &mut self, input: &[u8], tag_format: TagFormat ) -> Result<(), Error>

Parse the Serato Overview tag.

source

pub fn write_overview( &self, writer: &mut impl Write, tag_format: TagFormat ) -> Result<usize, Error>

Write the Serato Overview tag.

source

pub fn auto_gain(&self) -> Option<f64>

Returns the auto_gain value from the Serato Autotags tag.

source

pub fn gain_db(&self) -> Option<f64>

Returns the gain_db value from the Serato Autotags tag.

source

pub fn beatgrid(&self) -> Option<(&Vec<NonTerminalMarker>, &TerminalMarker)>

Returns the beatgrid from the Serato BeatGrid tag.

source

pub fn bpm_locked(&self) -> Option<bool>

Returns BPM lock status from the Serato Markers2 tag.

source

pub fn cues(&self) -> Vec<Cue>

Returns cues from the Serato Markers_ and Serato Markers2 tags.

This retrieves the Serato Markers2 cues first, then overwrite the values with those from Serato Markers_. This is what Serato does too (i.e. if Serato Markers_ and Serato Markers2 contradict each other, Serato will use the values from Serato Markers_).

source

pub fn loops(&self) -> Vec<Loop>

Returns loops from the Serato Markers_ and Serato Markers2 tags.

This retrieves the Serato Markers2 loops first, then overwrite the values with those from Serato Markers_. This is what Serato does too (i.e. if Serato Markers_ and Serato Markers2 contradict each other, Serato will use the values from Serato Markers_).

source

pub fn flips(&self) -> Option<impl Iterator<Item = &Flip>>

Returns flips from the Serato Markers2 tag.

source

pub fn track_color(&self) -> Option<Color>

Returns the track color from the Serato Markers_ and Serato Markers2 tags.

If present the color in Serato Markers_ takes precedence over that in Serato Markers2. This is what Serato does too, i.e. if Serato Markers_ and Serato Markers2 contradict each other, Serato will use the value from Serato Markers_.

source

pub fn overview_data(&self) -> Option<&[Vec<u8>]>

Returns the waveform overview data color from the Serato Overview tag.

Trait Implementations§

source§

impl Clone for TagContainer

source§

fn clone(&self) -> TagContainer

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for TagContainer

source§

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

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

impl Default for TagContainer

source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.