def _get_timespan(self, in_seconds=False): if in_seconds: self._update_now(offsets_in_seconds=True) if self._start_offset_in_seconds is None: raise exceptions.MissingMetronomeMarkError return Timespan( start_offset=self._start_offset_in_seconds, stop_offset=self._stop_offset_in_seconds, ) else: self._update_now(offsets=True) return self._timespan
def _get_timespan(self, in_seconds=False): if len(self): timespan_ = self[0]._get_timespan(in_seconds=in_seconds) start_offset = timespan_.start_offset timespan_ = self[-1]._get_timespan(in_seconds=in_seconds) stop_offset = timespan_.stop_offset else: start_offset = Duration(0) stop_offset = Duration(0) return Timespan( start_offset=start_offset, stop_offset=stop_offset, )
def __init__(self, name: str = None, tag: Tag = None) -> None: self._indicators_are_current = False self._is_forbidden_to_update = False self._measure_number = None self._offsets_are_current = False self._offsets_in_seconds_are_current = False self._overrides = None self._parent = None self._lilypond_setting_name_manager = None self._start_offset = None self._start_offset_in_seconds = None self._stop_offset = None self._stop_offset_in_seconds = None if tag is not None: assert isinstance(tag, Tag), repr(tag) self._tag = tag self._timespan = Timespan() self._wrappers: typing.List[Wrapper] = []