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§
source§impl 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§
source§impl Clone for TagContainer
impl Clone for TagContainer
source§fn clone(&self) -> TagContainer
fn clone(&self) -> TagContainer
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more