Struct triseratops::tag::container::TagContainer
source · [−]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
sourceimpl TagContainer
impl TagContainer
Parse the Serato Autotags
tag.
Write the Serato Autotags
tag.
sourcepub fn parse_beatgrid(
&mut self,
input: &[u8],
tag_format: TagFormat
) -> Result<(), Error>
pub fn parse_beatgrid(
&mut self,
input: &[u8],
tag_format: TagFormat
) -> Result<(), Error>
Parse the Serato BeatGrid
tag.
sourcepub fn write_beatgrid(
&self,
writer: &mut impl Write,
tag_format: TagFormat
) -> Result<usize, Error>
pub fn write_beatgrid(
&self,
writer: &mut impl Write,
tag_format: TagFormat
) -> Result<usize, Error>
Write the Serato BeatGrid
tag.
sourcepub fn parse_markers(
&mut self,
input: &[u8],
tag_format: TagFormat
) -> Result<(), Error>
pub fn parse_markers(
&mut self,
input: &[u8],
tag_format: TagFormat
) -> Result<(), Error>
Parse the Serato Markers_
tag.
sourcepub fn write_markers(
&self,
writer: &mut impl Write,
tag_format: TagFormat
) -> Result<usize, Error>
pub fn write_markers(
&self,
writer: &mut impl Write,
tag_format: TagFormat
) -> Result<usize, Error>
Write the Serato Markers_
tag.
sourcepub fn parse_markers2(
&mut self,
input: &[u8],
tag_format: TagFormat
) -> Result<(), Error>
pub fn parse_markers2(
&mut self,
input: &[u8],
tag_format: TagFormat
) -> Result<(), Error>
Parse the Serato Markers2
tag.
sourcepub fn write_markers2(
&self,
writer: &mut impl Write,
tag_format: TagFormat
) -> Result<usize, Error>
pub fn write_markers2(
&self,
writer: &mut impl Write,
tag_format: TagFormat
) -> Result<usize, Error>
Write the Serato Markers2
tag.
sourcepub fn parse_overview(
&mut self,
input: &[u8],
tag_format: TagFormat
) -> Result<(), Error>
pub fn parse_overview(
&mut self,
input: &[u8],
tag_format: TagFormat
) -> Result<(), Error>
Parse the Serato Overview
tag.
sourcepub fn write_overview(
&self,
writer: &mut impl Write,
tag_format: TagFormat
) -> Result<usize, Error>
pub fn write_overview(
&self,
writer: &mut impl Write,
tag_format: TagFormat
) -> Result<usize, Error>
Write the Serato Overview
tag.
sourcepub fn auto_gain(&self) -> Option<f64>
pub fn auto_gain(&self) -> Option<f64>
Returns the auto_gain
value from the Serato Autotags
tag.
sourcepub fn beatgrid(&self) -> Option<(&Vec<NonTerminalMarker>, &TerminalMarker)>
pub fn beatgrid(&self) -> Option<(&Vec<NonTerminalMarker>, &TerminalMarker)>
Returns the beatgrid from the Serato BeatGrid
tag.
sourcepub fn bpm_locked(&self) -> Option<bool>
pub fn bpm_locked(&self) -> Option<bool>
Returns BPM lock status from the Serato Markers2
tag.
sourcepub fn cues(&self) -> Vec<Cue>
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_
).
sourcepub fn loops(&self) -> Vec<Loop>
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_
).
sourcepub fn flips(&self) -> Option<impl Iterator<Item = &Flip>>
pub fn flips(&self) -> Option<impl Iterator<Item = &Flip>>
Returns flips from the Serato Markers2
tag.
sourcepub fn track_color(&self) -> Option<Color>
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_
.
sourcepub fn overview_data(&self) -> Option<&[Vec<u8>]>
pub fn overview_data(&self) -> Option<&[Vec<u8>]>
Returns the waveform overview data color from the Serato Overview
tag.
Trait Implementations
sourceimpl Clone for TagContainer
impl Clone for TagContainer
sourcefn clone(&self) -> TagContainer
fn clone(&self) -> TagContainer
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TagContainer
impl Debug for TagContainer
Auto Trait Implementations
impl RefUnwindSafe for TagContainer
impl Send for TagContainer
impl Sync for TagContainer
impl Unpin for TagContainer
impl UnwindSafe for TagContainer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more