pub struct BrailleGrandSegment {
pub groupings: BTreeMap<SegmentKey, BrailleElementGrouping>,
pub line_length: usize,
pub right_contexts: Vec<NoteContext>,
pub left_contexts: Vec<NoteContext>,
}Expand description
A piano’s two staves cut into segments of groupings for each hand,
written side by side: music21’s BrailleGrandSegment.
Fields§
§groupings: BTreeMap<SegmentKey, BrailleElementGrouping>The groupings of both hands, by key.
line_length: usizeHow many cells a line holds.
right_contexts: Vec<NoteContext>What music21 marked on each leaf of the right hand’s part.
left_contexts: Vec<NoteContext>What music21 marked on each leaf of the left hand’s part.
Implementations§
Source§impl BrailleGrandSegment
impl BrailleGrandSegment
Sourcepub fn combined_keys(&self) -> Vec<KeyPair> ⓘ
pub fn combined_keys(&self) -> Vec<KeyPair> ⓘ
The keys of the two hands, paired measure by measure: music21’s
yieldCombinedGroupingKeys.
Sourcepub fn transcribe(&mut self) -> Result<String>
pub fn transcribe(&mut self) -> Result<String>
The two hands in braille: a heading, then each measure’s groupings
side by side: music21’s transcribe.
§Errors
Something too wide for a line, or that music21 cannot write.
Sourcepub fn transcribe_into(&mut self, keyboard: &mut BrailleKeyboard) -> Result<()>
pub fn transcribe_into(&mut self, keyboard: &mut BrailleKeyboard) -> Result<()>
BrailleGrandSegment::transcribe into a keyboard’s text as it
stands, rather than a fresh one.
§Errors
Something too wide for a line, or that music21 cannot write.
Sourcepub fn extract_heading(
&mut self,
pairs: &mut VecDeque<KeyPair>,
keyboard: &mut BrailleKeyboard,
) -> Result<()>
pub fn extract_heading( &mut self, pairs: &mut VecDeque<KeyPair>, keyboard: &mut BrailleKeyboard, ) -> Result<()>
The heading out of the pairs the segment starts with, which it
takes off them: music21’s extractHeading. Nothing is written
where there is nothing for a heading.
§Errors
A heading too wide for a line.
Sourcepub fn extract_note_grouping(
&mut self,
(right, left): KeyPair,
keyboard: &mut BrailleKeyboard,
) -> Result<()>
pub fn extract_note_grouping( &mut self, (right, left): KeyPair, keyboard: &mut BrailleKeyboard, ) -> Result<()>
A measure’s pair of groupings written side by side: music21’s
extractNoteGrouping.
§Errors
A pair with neither hand, or a grouping too wide for a line.
Trait Implementations§
Source§impl Clone for BrailleGrandSegment
impl Clone for BrailleGrandSegment
Auto Trait Implementations§
impl Forget for BrailleGrandSegment
impl Freeze for BrailleGrandSegment
impl RefUnwindSafe for BrailleGrandSegment
impl Send for BrailleGrandSegment
impl Sync for BrailleGrandSegment
impl Unpin for BrailleGrandSegment
impl UnsafeUnpin for BrailleGrandSegment
impl UnwindSafe for BrailleGrandSegment
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