Struct osu_file_parser::osu_file::timingpoints::TimingPoint
source · [−]pub struct TimingPoint { /* private fields */ }
Expand description
Struct representing a timing point.
Each timing point influences a specified portion of the map, commonly called a timing section
.
The .osu file format requires these to be sorted in chronological order.
Implementations
sourceimpl TimingPoint
impl TimingPoint
sourcepub fn beat_duration_ms_to_bpm(beat_duration_ms: Decimal) -> Decimal
pub fn beat_duration_ms_to_bpm(beat_duration_ms: Decimal) -> Decimal
Converts beat duration in milliseconds to BPM.
sourcepub fn bpm_to_beat_duration_ms(bpm: Decimal) -> Decimal
pub fn bpm_to_beat_duration_ms(bpm: Decimal) -> Decimal
Converts BPM to beat duration in milliseconds.
sourcepub fn new_inherited(
time: Integer,
slider_velocity_multiplier: Decimal,
meter: Integer,
sample_set: SampleSet,
sample_index: SampleIndex,
volume: Volume,
effects: Effects
) -> Self
pub fn new_inherited(
time: Integer,
slider_velocity_multiplier: Decimal,
meter: Integer,
sample_set: SampleSet,
sample_index: SampleIndex,
volume: Volume,
effects: Effects
) -> Self
New instance of TimingPoint
that is inherited.
sourcepub fn new_uninherited(
time: Integer,
beat_duration_ms: Decimal,
meter: Integer,
sample_set: SampleSet,
sample_index: SampleIndex,
volume: Volume,
effects: Effects
) -> Self
pub fn new_uninherited(
time: Integer,
beat_duration_ms: Decimal,
meter: Integer,
sample_set: SampleSet,
sample_index: SampleIndex,
volume: Volume,
effects: Effects
) -> Self
New instance of TimingPoint
that is uninherited.
sourcepub fn calc_bpm(&self) -> Option<Decimal>
pub fn calc_bpm(&self) -> Option<Decimal>
Calculates BPM using the beatLength
field when unherited.
- Returns
None
if the timing point is inherited orbeat_length
isn’t a valid decimal.
sourcepub fn calc_slider_velocity_multiplier(&self) -> Option<Decimal>
pub fn calc_slider_velocity_multiplier(&self) -> Option<Decimal>
Calculates the slider velocity multiplier when the timing point is inherited.
- Returns
None
if the timing point is uninherited orbeat_length
isn’t a valid decimal.
sourcepub fn time(&self) -> &Decimal
pub fn time(&self) -> &Decimal
Start time of the timing section, in milliseconds from the beginning of the beatmap’s audio. The end of the timing section is the next timing point’s time (or never, if this is the last timing point).
sourcepub fn meter(&self) -> i32
pub fn meter(&self) -> i32
Amount of beats in a measure. Inherited timing points ignore this property.
sourcepub fn sample_set(&self) -> SampleSet
pub fn sample_set(&self) -> SampleSet
Default sample set for hit objects
sourcepub fn set_sample_set(&mut self, sample_set: SampleSet)
pub fn set_sample_set(&mut self, sample_set: SampleSet)
Set the timing point’s sample set.
sourcepub fn sample_index(&self) -> SampleIndex
pub fn sample_index(&self) -> SampleIndex
Custom sample index for hit objects.
sourcepub fn sample_index_mut(&mut self) -> &mut SampleIndex
pub fn sample_index_mut(&mut self) -> &mut SampleIndex
Get a mutable reference to the timing point’s sample index.
sourcepub fn set_volume(&mut self, volume: Volume)
pub fn set_volume(&mut self, volume: Volume)
Set the timing point’s volume.
sourcepub fn uninherited(&self) -> bool
pub fn uninherited(&self) -> bool
Get the timing point’s uninherited.
sourcepub fn set_uninherited(&mut self, uninherited: bool)
pub fn set_uninherited(&mut self, uninherited: bool)
Set the timing point’s uninherited.
sourcepub fn effects_mut(&mut self) -> &mut Option<Effects>
pub fn effects_mut(&mut self) -> &mut Option<Effects>
Get a mutable reference to the timing point’s effects.
Trait Implementations
sourceimpl Clone for TimingPoint
impl Clone for TimingPoint
sourcefn clone(&self) -> TimingPoint
fn clone(&self) -> TimingPoint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TimingPoint
impl Debug for TimingPoint
sourceimpl Hash for TimingPoint
impl Hash for TimingPoint
sourceimpl PartialEq<TimingPoint> for TimingPoint
impl PartialEq<TimingPoint> for TimingPoint
sourcefn eq(&self, other: &TimingPoint) -> bool
fn eq(&self, other: &TimingPoint) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl VersionedFromStr for TimingPoint
impl VersionedFromStr for TimingPoint
sourceimpl VersionedToString for TimingPoint
impl VersionedToString for TimingPoint
impl Eq for TimingPoint
impl StructuralEq for TimingPoint
impl StructuralPartialEq for TimingPoint
Auto Trait Implementations
impl RefUnwindSafe for TimingPoint
impl Send for TimingPoint
impl Sync for TimingPoint
impl Unpin for TimingPoint
impl UnwindSafe for TimingPoint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more