pub trait ChartProcessor {
// Required methods
fn audio_files(&self) -> HashMap<WavId, &Path>;
fn bmp_files(&self) -> HashMap<BmpId, &Path>;
fn default_visible_y_length(&self) -> YCoordinate;
fn current_bpm(&self) -> Decimal;
fn current_speed(&self) -> Decimal;
fn current_scroll(&self) -> Decimal;
fn start_play(&mut self, now: SystemTime);
fn update(
&mut self,
now: SystemTime,
) -> impl Iterator<Item = ChartEventWithPosition>;
fn post_events(&mut self, events: &[ControlEvent]);
fn visible_events(
&mut self,
now: SystemTime,
) -> impl Iterator<Item = VisibleEvent>;
}Expand description
Unified y unit description: In default 4/4 time, one measure equals 1; BMS uses #SECLEN for linear conversion, BMSON normalizes via pulses / (4*resolution).
Required Methods§
Sourcefn audio_files(&self) -> HashMap<WavId, &Path>
fn audio_files(&self) -> HashMap<WavId, &Path>
Read: audio file resources (id to path mapping).
Sourcefn bmp_files(&self) -> HashMap<BmpId, &Path>
fn bmp_files(&self) -> HashMap<BmpId, &Path>
Read: BGA/BMP image resources (id to path mapping).
Sourcefn default_visible_y_length(&self) -> YCoordinate
fn default_visible_y_length(&self) -> YCoordinate
Read: default visible Y range length (distance from when note appears in visible area to judgment line, unit: y coordinate).
Sourcefn current_bpm(&self) -> Decimal
fn current_bpm(&self) -> Decimal
Read: current BPM (changes with events).
Sourcefn current_speed(&self) -> Decimal
fn current_speed(&self) -> Decimal
Read: current Speed factor (changes with events).
Sourcefn current_scroll(&self) -> Decimal
fn current_scroll(&self) -> Decimal
Read: current Scroll factor (changes with events).
Sourcefn start_play(&mut self, now: SystemTime)
fn start_play(&mut self, now: SystemTime)
Notify: start playback, record starting absolute time.
Sourcefn update(
&mut self,
now: SystemTime,
) -> impl Iterator<Item = ChartEventWithPosition>
fn update( &mut self, now: SystemTime, ) -> impl Iterator<Item = ChartEventWithPosition>
Update: advance internal timeline, return timeline events generated since last call (Elm style).
Sourcefn post_events(&mut self, events: &[ControlEvent])
fn post_events(&mut self, events: &[ControlEvent])
Post external control events (such as setting default reaction time/default BPM), will be consumed before next update.
These events are used to dynamically adjust player configuration parameters. Chart playback related events (such as notes, BGM, etc.)
are returned by the [update] method, not posted through this method.
Sourcefn visible_events(
&mut self,
now: SystemTime,
) -> impl Iterator<Item = VisibleEvent>
fn visible_events( &mut self, now: SystemTime, ) -> impl Iterator<Item = VisibleEvent>
Query: all events in current visible area (preload logic).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl ChartProcessor for BmsProcessor
impl<'a> ChartProcessor for BmsonProcessor<'a>
bmson only.