def _put_x_in_bounds(self, x): return Utils.put_in_bounds(x, 0, self.width())
def get_frame_number_from_ratio(self, ratio): ratio = Utils.put_in_bounds(ratio, 0, 1) return int(self.start_frame + len(self) * ratio)
def _get_scaled_len(self, scale_factor): return Utils.put_in_bounds(self.MINIMAL_LEN, len(self.wave_state), scale_factor * len(self))