/// Figures out which timing point this hit sound inherits from, if any, and sets itself
/// accordingly.
Figures out which timing point this hit sound inherits from, if any, and sets itself
accordingly.
Figures out which timing point this hit sound inherits from if any and sets itself accordingly .
fn resolve_tp_inherit(&mut self, time: f64, timing_points: &[OsuTimingPoint]) {
        match &mut self.source {
            HitSoundSource::SampleSet(sample) => {
                let mut tp = None;
                if sample.index == 0 {
                    tp = find_tp_inherit_from(time, timing_points);
                    sample.index = tp.map(|t| t.sample_index).unwrap_or(1);
                }
                if sample.set == SampleSet::Auto {
                    tp = tp.or_else(|| find_tp_inherit_from(time, timing_points));
                    sample.set = tp.map(|t| t.sample_set).unwrap_or(SampleSet::Normal);
                }
            }
            HitSoundSource::File(_) => (),
        }
    }
fn resolve_tp_inherit ( & mut self , time : f64 , timing_points : & [ OsuTimingPoint ] ) { match & mut self . source { HitSoundSource :: SampleSet ( sample ) => { let mut tp = None ; if sample . index == 0 { tp = find_tp_inherit_from ( time , timing_points ) ; sample . index = tp . map ( | t | t . sample_index ) . unwrap_or ( 1 ) ; } if sample . set == SampleSet :: Auto { tp = tp . or_else ( | | find_tp_inherit_from ( time , timing_points ) ) ; sample . set = tp . map ( | t | t . sample_set ) . unwrap_or ( SampleSet :: Normal ) ; } } HitSoundSource :: File ( _ ) => ( ) , } }
Figures out which timing point this hit sound inherits from, if any, and sets itself
accordingly.
Figures out which timing point this hit sound inherits from if any and sets itself accordingly .
&mut self
time
f64
timing_points
&[OsuTimingPoint]