pub struct AbcMetadata {
pub src: String,
pub tag: String,
pub data: String,
pub line: usize,
}Expand description
A line of metadata, T:Title and the like: music21’s ABCMetadata. Its
tag and data are empty until AbcMetadata::pre_parse.
Fields§
§src: StringThe text it was read from.
tag: StringThe capital letter, or w, before the colon.
data: StringWhat follows the colon, trimmed, a comment taken off.
line: usizeThe line of the text it stands on, counted from one; nought where unknown.
Implementations§
Source§impl AbcMetadata
impl AbcMetadata
Sourcepub fn pre_parse(&mut self)
pub fn pre_parse(&mut self)
music21’s preParse: the tag and the data split apart.
use music21::abc::step::AbcMetadata;
let mut line = AbcMetadata::new("T:tagData % a comment");
line.pre_parse();
assert_eq!((line.tag.as_str(), line.data.as_str()), ("T", "tagData"));Sourcepub fn meter_parameters(&self) -> Result<Option<(u32, u32, &'static str)>>
pub fn meter_parameters(&self) -> Result<Option<(u32, u32, &'static str)>>
music21’s getTimeSignatureParameters: the meter’s numerator,
denominator and symbol (normal, common or cut), nothing for
M:none.
Sourcepub fn meter(&self) -> Result<Option<TimeSignature>>
pub fn meter(&self) -> Result<Option<TimeSignature>>
music21’s getTimeSignatureObject.
Sourcepub fn key_parameters(&self) -> Result<(IntegerType, Option<&'static str>)>
pub fn key_parameters(&self) -> Result<(IntegerType, Option<&'static str>)>
music21’s getKeySignatureParameters: the signed count of sharps and
the mode, where the key names one.
use music21::abc::step::AbcMetadata;
let mut line = AbcMetadata::new("K:Eb Lydian");
line.pre_parse();
assert_eq!(line.key_parameters()?, (-2, Some("lydian")));Sourcepub fn key(&self) -> Result<StreamElement>
pub fn key(&self) -> Result<StreamElement>
music21’s getKeySignatureObject: a key where there is a mode, a
signature otherwise.
Sourcepub fn clef(&self) -> Result<Option<(Clef, IntegerType)>>
pub fn clef(&self) -> Result<Option<(Clef, IntegerType)>>
music21’s getClefObject: the clef a key line names, and how far the
notes under it are moved.
Sourcepub fn tempo(&self) -> Result<MetronomeMark>
pub fn tempo(&self) -> Result<MetronomeMark>
music21’s getMetronomeMarkObject.
Sourcepub fn default_quarter_length(&self) -> Result<FloatType>
pub fn default_quarter_length(&self) -> Result<FloatType>
music21’s getDefaultQuarterLength, for an L: or an M: line.
use music21::abc::step::AbcMetadata;
let mut line = AbcMetadata::new("M:2/4");
line.pre_parse();
assert_eq!(line.default_quarter_length()?, 0.25);Trait Implementations§
Source§impl Clone for AbcMetadata
impl Clone for AbcMetadata
Source§impl Debug for AbcMetadata
impl Debug for AbcMetadata
Source§impl Default for AbcMetadata
impl Default for AbcMetadata
Source§impl PartialEq for AbcMetadata
impl PartialEq for AbcMetadata
impl StructuralPartialEq for AbcMetadata
Auto Trait Implementations§
impl Forget for AbcMetadata
impl Freeze for AbcMetadata
impl Move for AbcMetadata
impl RefUnwindSafe for AbcMetadata
impl Send for AbcMetadata
impl Sync for AbcMetadata
impl Unpin for AbcMetadata
impl UnsafeUnpin for AbcMetadata
impl UnwindSafe for AbcMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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