pub struct BrailleText {
pub line_length: usize,
pub all_lines: Vec<BrailleTextLine>,
pub right_hand_symbol: bool,
pub left_hand_symbol: bool,
pub all_headings: Vec<(usize, usize)>,
}Expand description
Braille laid out in lines, with headings, measure numbers and the signs
of a hand at the keyboard: music21’s BrailleText.
Fields§
§line_length: usizeHow many cells a line holds.
all_lines: Vec<BrailleTextLine>Every line.
right_hand_symbol: boolWhether lines of notes start with the right hand’s sign.
left_hand_symbol: boolWhether lines of notes start with the left hand’s sign.
all_headings: Vec<(usize, usize)>Where each heading’s lines start and end.
Implementations§
Source§impl BrailleText
impl BrailleText
Sourcepub fn new(line_length: usize, show_hand: Option<&str>) -> Result<Self>
pub fn new(line_length: usize, show_hand: Option<&str>) -> Result<Self>
Text of lines this long, with a hand’s sign where asked: right or
left.
§Errors
A hand music21 does not know.
Sourcepub fn set_show_hand(&mut self, hand: Option<&str>) -> Result<()>
pub fn set_show_hand(&mut self, hand: Option<&str>) -> Result<()>
Which hand’s sign the notes’ lines start with: music21’s showHand
setter. music21’s getter never answers what was set.
§Errors
A hand music21 does not know.
Sourcepub fn current_line(&mut self) -> &mut BrailleTextLine
pub fn current_line(&mut self) -> &mut BrailleTextLine
The line being written.
Sourcepub fn make_new_line(&mut self)
pub fn make_new_line(&mut self)
Starts a new line: music21’s makeNewLine.
Sourcepub fn add_heading(&mut self, heading: &str) -> Result<()>
pub fn add_heading(&mut self, heading: &str) -> Result<()>
A heading, a line each, on lines of its own: music21’s addHeading.
§Errors
A heading line wider than a line.
Sourcepub fn add_long_expression(&mut self, expression: &str) -> Result<()>
pub fn add_long_expression(&mut self, expression: &str) -> Result<()>
Words of a long text expression, each where it fits: music21’s
addLongExpression.
§Errors
A word wider than a line.
Sourcepub fn add_to_new_line(&mut self, grouping: &str) -> Result<()>
pub fn add_to_new_line(&mut self, grouping: &str) -> Result<()>
A group of notes on a new line, indented two cells or after the
hand’s sign: music21’s addToNewLine.
§Errors
A group wider than a line.
Sourcepub fn append_or_insert_current(
&mut self,
text: &str,
add_space: bool,
) -> Result<()>
pub fn append_or_insert_current( &mut self, text: &str, add_space: bool, ) -> Result<()>
Text at the end of the line, or on a new one indented two cells:
music21’s appendOrInsertCurrent.
§Errors
Text wider than a line.
Sourcepub fn add_inaccord(&mut self, inaccord: &str) -> Result<()>
pub fn add_inaccord(&mut self, inaccord: &str) -> Result<()>
Voices written in accord, on the line or a new one: music21’s
addInaccord.
§Errors
Voices wider than a line.
Sourcepub fn add_measure_number(&mut self, number: &str) -> Result<()>
pub fn add_measure_number(&mut self, number: &str) -> Result<()>
A measure number at the start of a line: music21’s
addMeasureNumber.
§Errors
A number wider than a line.
Sourcepub fn add_measure_number_value(&mut self, number: i64) -> Result<()>
pub fn add_measure_number_value(&mut self, number: i64) -> Result<()>
Sourcepub fn optional_add_keyboard_symbols_and_dots(
&mut self,
grouping: Option<&str>,
) -> Result<bool>
pub fn optional_add_keyboard_symbols_and_dots( &mut self, grouping: Option<&str>, ) -> Result<bool>
The hand’s sign and the dots of a group’s first cell, before the
first group of a line, and whether what follows is spaced from it:
music21’s optionalAddKeyboardSymbolsAndDots.
§Errors
Signs wider than a line.
Sourcepub fn add_signatures(&mut self, signatures: &str) -> Result<()>
pub fn add_signatures(&mut self, signatures: &str) -> Result<()>
Key and time signatures, after a space unless they start the line:
music21’s addSignatures.
§Errors
Signatures wider than a line.
Sourcepub fn recenter_headings(&mut self)
pub fn recenter_headings(&mut self)
Each heading line centred over the widest line of music below it,
up to the next heading: music21’s recenterHeadings.
Trait Implementations§
Source§impl Clone for BrailleText
impl Clone for BrailleText
Source§impl Debug for BrailleText
impl Debug for BrailleText
impl Eq for BrailleText
Source§impl PartialEq for BrailleText
impl PartialEq for BrailleText
impl StructuralPartialEq for BrailleText
Auto Trait Implementations§
impl Freeze for BrailleText
impl RefUnwindSafe for BrailleText
impl Send for BrailleText
impl Sync for BrailleText
impl Unpin for BrailleText
impl UnsafeUnpin for BrailleText
impl UnwindSafe for BrailleText
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