pub fn bar_number(&self) -> Option<i32> {
        if self.bar_number.is_some() {
            return self.bar_number;
        }

        match (
            self.time_sig_numerator,
            self.time_sig_denominator,
            self.pos_beats(),
        ) {
            (Some(time_sig_numerator), Some(time_sig_denominator), Some(pos_beats)) => {
                let quarter_note_bar_length =
                    time_sig_numerator as f64 / time_sig_denominator as f64 * 4.0;
                Some((pos_beats / quarter_note_bar_length).floor() as i32)
            }
            (_, _, _) => None,
        }
    }
/// The number of the bar at `bar_start_pos_beats`. This starts at 0 for the very first bar at
/// the start of the song. Will be calculated from other information if needed.
The number of the bar at `bar_start_pos_beats`. This starts at 0 for the very first bar at
the start of the song. Will be calculated from other information if needed.
The number of the bar at ` bar_start_pos_beats ` . This starts at 0 for the very first bar at the start of the song . Will be calculated from other information if needed .
pub fn bar_number(&self) -> Option<i32> {
        if self.bar_number.is_some() {
            return self.bar_number;
        }
        match (
            self.time_sig_numerator,
            self.time_sig_denominator,
            self.pos_beats(),
        ) {
            (Some(time_sig_numerator), Some(time_sig_denominator), Some(pos_beats)) => {
                let quarter_note_bar_length =
                    time_sig_numerator as f64 / time_sig_denominator as f64 * 4.0;
                Some((pos_beats / quarter_note_bar_length).floor() as i32)
            }
            (_, _, _) => None,
        }
    }
pub fn bar_number ( & self ) -> Option < i32 > { if self . bar_number . is_some ( ) { return self . bar_number ; } match ( self . time_sig_numerator , self . time_sig_denominator , self . pos_beats ( ) , ) { ( Some ( time_sig_numerator ) , Some ( time_sig_denominator ) , Some ( pos_beats ) ) => { let quarter_note_bar_length = time_sig_numerator as f64 / time_sig_denominator as f64 * 4.0 ; Some ( ( pos_beats / quarter_note_bar_length ) . floor ( ) as i32 ) } ( _ , _ , _ ) => None , } }
The number of the bar at `bar_start_pos_beats`.
The number of the bar at ` bar_start_pos_beats ` .
&self
&self