

# tl = Timeloop()
#
#
#
# # @tl.job(interval=timedelta(seconds=1))
# def update_progress(player, talk_at, silent_at):
#    elapsed_time = player.get_time()
#    total_time = player.get_length()
#    remaining_time = total_time - elapsed_time
#    talk_time = remaining_time - (total_time - talk_at)
#    silent_time = remaining_time - (total_time - silent_at)
#    end_time = (datetime.now() + timedelta(
#        milliseconds=remaining_time)).strftime("%H:%M:%S")
#    print(
#        f"\t{ms_to_mmss(elapsed_time)}/"
#        f"{ms_to_mmss(total_time)}\t\t"
#        f"Talk in: {ms_to_mmss(talk_time)} "
#        f"Silent in: {ms_to_mmss(silent_time)} "
#        f"Ends at: {end_time} [{ms_to_mmss(remaining_time)}]"
#        , end="\r")
#
#
# # Print name of current song, print name of next song. Play current when
# # return pressed, Pri--current-song-output-lengthnt remaining time every
# # second. When it ends, print name of new current and next song.
#
#
# def test():
#    track = "wibg.mp3"
#    segment = AudioSegment.from_mp3(trm.ack)
#    print(f"Track: {track}")
#    print(f"Leading silence: {ms_to_mmss(leading_silence(segment),
#                       decimals=1)}")
#    talk_at = significant_fade(segment)
#    silent_at = trailing_silence(segment)
#    print(f"Talkover fade: {ms_to_mmss(talk_at)}")
#    print(f"Track silent from: {ms_to_mmss(silent_at)}")
#    p = vlc.MediaPlayer("wibg.mp3")
#    _ = input("")
#    p.play()
#    print()
#    rt = RepeatedTimer(0.5, update_progress, p, talk_at, silent_at)
#    sleep(1)
#    while p.is_playing():
#        sleep(1)
#    rt.stop()  # better in a try/finally block to make sure the program ends!
#    print("End")

    #def kae2(self, index):
    #    print(f"table header click, index={index}")

    #def kae(self, a, b, c):
    #    self.data.append(f"a={a}, b={b}, c={c}")

    #def mousePressEvent(self, QMouseEvent):
    #    print("mouse press")

    #def mouseReleaseEvent(self, QMouseEvent):
    #    print("mouse release")
    #    # QMessageBox.about(
    #    #     self,
    #    #     "About Sample Editor",
    #    #     "\n".join(self.data)
    #    # )
    #def eventFilter(self, obj, event):
    #    # you could be doing different groups of actions
    #    # for different types of widgets and either filtering
    #    # the event or not.
    #    # Here we just check if its one of the layout widgets
    #    # if self.layout.indexOf(obj) != -1:
    #    # print(f"event received: {event.type()}")
    #    if event.type() == QEvent.MouseButtonPress:
    #        print("Widget click")
    #            # if I returned True right here, the event
    #            # would be filtered and not reach the obj,
    #            # meaning that I decided to handle it myself

    #    # regardless, just do the default
    #    return super().eventFilter(obj, event)
