MCPcopy Create free account
hub / github.com/dialect-app/dialect / _gst_progress_timeout

Method _gst_progress_timeout

dialect/window.py:935–955  ·  view source on GitHub ↗
(self, _widget, _clock)

Source from the content-addressed store, hash-verified

933 self._speech_reset()
934
935 def _gst_progress_timeout(self, _widget, _clock):
936 if not self.player:
937 return False
938
939 if self.current_speech and self.player.get_state(Gst.CLOCK_TIME_NONE) != Gst.State.NULL:
940 have_pos, pos = self.player.query_position(Gst.Format.TIME)
941 have_dur, dur = self.player.query_duration(Gst.Format.TIME)
942
943 if have_pos and have_dur:
944 if self.current_speech["called_from"] == "src":
945 self.src_speech_btn.progress(pos / dur)
946 else:
947 self.dest_speech_btn.progress(pos / dur)
948
949 if self.speech_loading:
950 self.speech_loading = False
951 self._check_speech_enabled()
952
953 return True
954
955 return False
956
957 def _on_src_text_changed(self, buffer: Gtk.TextBuffer):
958 if not self.provider["trans"]:

Callers

nothing calls this directly

Calls 2

_check_speech_enabledMethod · 0.95
progressMethod · 0.80

Tested by

no test coverage detected