pub trait Placing {
type Measure;
type Voice;
type Element;
type Handle;
type Error;
Show 15 methods
// Required methods
fn copy_measure(&self, measure: &Self::Measure) -> Self::Measure;
fn copy_handle(&self, handle: &Self::Handle) -> Self::Handle;
fn same_measure(
&self,
first: &Self::Measure,
second: &Self::Measure,
) -> bool;
fn same_handle(&self, first: &Self::Handle, second: &Self::Handle) -> bool;
fn handle(
&self,
element: &Self::Element,
) -> Result<Self::Handle, Self::Error>;
fn highest_time(
&self,
measure: &Self::Measure,
) -> Result<FloatType, Self::Error>;
fn length(&self, element: &Self::Element) -> Result<FloatType, Self::Error>;
fn voices(
&self,
measure: &Self::Measure,
) -> Result<Vec<Self::Voice>, Self::Error>;
fn voice_end(&self, voice: &Self::Voice) -> Result<FloatType, Self::Error>;
fn gather_voice(
&mut self,
measure: &Self::Measure,
) -> Result<Self::Voice, Self::Error>;
fn new_voice(
&mut self,
measure: &Self::Measure,
id: usize,
) -> Result<Self::Voice, Self::Error>;
fn insert(
&mut self,
measure: &Self::Measure,
offset: FloatType,
element: Self::Element,
) -> Result<(), Self::Error>;
fn insert_in(
&mut self,
voice: &Self::Voice,
offset: FloatType,
element: Self::Element,
) -> Result<(), Self::Error>;
fn set_ties(
&mut self,
element: &mut Self::Element,
ties: &[Option<TieType>],
) -> Result<(), Self::Error>;
fn slur(
&mut self,
measure: &Self::Measure,
start: &Self::Handle,
end: &Self::Handle,
) -> Result<(), Self::Error>;
}Expand description
What a measure of either kind does for the translator.
Required Associated Types§
Required Methods§
Sourcefn copy_measure(&self, measure: &Self::Measure) -> Self::Measure
fn copy_measure(&self, measure: &Self::Measure) -> Self::Measure
Another reference to the same measure.
Sourcefn copy_handle(&self, handle: &Self::Handle) -> Self::Handle
fn copy_handle(&self, handle: &Self::Handle) -> Self::Handle
Another reference to the same placed note.
Sourcefn same_measure(&self, first: &Self::Measure, second: &Self::Measure) -> bool
fn same_measure(&self, first: &Self::Measure, second: &Self::Measure) -> bool
Whether two measures are the same one.
Sourcefn same_handle(&self, first: &Self::Handle, second: &Self::Handle) -> bool
fn same_handle(&self, first: &Self::Handle, second: &Self::Handle) -> bool
Whether two placed notes are the same one.
Sourcefn handle(&self, element: &Self::Element) -> Result<Self::Handle, Self::Error>
fn handle(&self, element: &Self::Element) -> Result<Self::Handle, Self::Error>
What element will be remembered by.
Sourcefn highest_time(
&self,
measure: &Self::Measure,
) -> Result<FloatType, Self::Error>
fn highest_time( &self, measure: &Self::Measure, ) -> Result<FloatType, Self::Error>
Where the last thing in the measure ends: music21’s highestTime.
Sourcefn length(&self, element: &Self::Element) -> Result<FloatType, Self::Error>
fn length(&self, element: &Self::Element) -> Result<FloatType, Self::Error>
How long an element lasts.
Sourcefn voices(
&self,
measure: &Self::Measure,
) -> Result<Vec<Self::Voice>, Self::Error>
fn voices( &self, measure: &Self::Measure, ) -> Result<Vec<Self::Voice>, Self::Error>
The measure’s voices, in order.
Sourcefn voice_end(&self, voice: &Self::Voice) -> Result<FloatType, Self::Error>
fn voice_end(&self, voice: &Self::Voice) -> Result<FloatType, Self::Error>
Where the last thing in a voice ends.
Sourcefn gather_voice(
&mut self,
measure: &Self::Measure,
) -> Result<Self::Voice, Self::Error>
fn gather_voice( &mut self, measure: &Self::Measure, ) -> Result<Self::Voice, Self::Error>
The notes, chords and rests the measure holds moved into a voice numbered nought, each where it stood, and the voice put at the start of the measure.
Sourcefn new_voice(
&mut self,
measure: &Self::Measure,
id: usize,
) -> Result<Self::Voice, Self::Error>
fn new_voice( &mut self, measure: &Self::Measure, id: usize, ) -> Result<Self::Voice, Self::Error>
A new empty voice numbered id at the start of the measure.
Sourcefn insert(
&mut self,
measure: &Self::Measure,
offset: FloatType,
element: Self::Element,
) -> Result<(), Self::Error>
fn insert( &mut self, measure: &Self::Measure, offset: FloatType, element: Self::Element, ) -> Result<(), Self::Error>
An element put in the measure at an offset.
Sourcefn insert_in(
&mut self,
voice: &Self::Voice,
offset: FloatType,
element: Self::Element,
) -> Result<(), Self::Error>
fn insert_in( &mut self, voice: &Self::Voice, offset: FloatType, element: Self::Element, ) -> Result<(), Self::Error>
An element put in a voice at an offset.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".