pub struct Barline { /* private fields */ }Expand description
A barline: music21’s bar.Barline, or its bar.Repeat where it is a
repeat sign.
Implementations§
Source§impl Barline
impl Barline
Sourcepub fn new(bar_type: BarlineType) -> Self
pub fn new(bar_type: BarlineType) -> Self
A plain barline of a type.
Sourcepub fn repeat(direction: RepeatDirection, times: Option<u32>) -> Self
pub fn repeat(direction: RepeatDirection, times: Option<u32>) -> Self
A repeat sign, drawn as music21 draws one: heavy-light where a
repeat starts and final where it ends. times is how many times the
passage is played, where the score says.
Sourcepub fn bar_type(&self) -> BarlineType
pub fn bar_type(&self) -> BarlineType
How the barline is drawn.
Sourcepub fn set_bar_type(&mut self, bar_type: BarlineType)
pub fn set_bar_type(&mut self, bar_type: BarlineType)
Changes how the barline is drawn.
Sourcepub fn repeat_direction(&self) -> Option<RepeatDirection>
pub fn repeat_direction(&self) -> Option<RepeatDirection>
Which way the music repeats, where this is a repeat sign.
Sourcepub fn repeat_times(&self) -> Option<u32>
pub fn repeat_times(&self) -> Option<u32>
How many times the passage is played, where a repeat sign says.
Sourcepub fn repeat_text_expression(
&self,
prefix: &str,
postfix: &str,
) -> Option<TextExpression>
pub fn repeat_text_expression( &self, prefix: &str, postfix: &str, ) -> Option<TextExpression>
The words a repeat’s count is written as, for a caller that wants
them over the staff: music21’s Repeat.getTextExpression, which
writes the times between a prefix and a postfix – 3x by
default.
music21 writes the count whatever it is, so a repeat that says no
count is written Nonex; this answers nothing instead, there
being nothing to say.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Barline
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Barline
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Barline
Source§impl From<Barline> for StreamElement
impl From<Barline> for StreamElement
impl StructuralPartialEq for Barline
Auto Trait Implementations§
impl Freeze for Barline
impl RefUnwindSafe for Barline
impl Send for Barline
impl Sync for Barline
impl Unpin for Barline
impl UnsafeUnpin for Barline
impl UnwindSafe for Barline
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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