Python Forum
QTimer with pause/resume functions?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTimer with pause/resume functions?
#1
Hey there, I'm making a music player so have to use a QTimer and set its interval to the length of the current song in order to know when to automatically play the next song in the playlist when the current one ends. This part works perfectly. But I have a problem if I pause the audio:

When I press the pause button and the audio file pauses, the timer does not! So this means that when I resume the song, the app will switch to the next one before the current one has ended as the QTimer has not been paused when I paused the song itself via the button. I found this code but am getting an OverflowError at the very last line where self.start is called in the resume function. Can anybody tell if it's even possible to pause/resume a QTimer (not natively I guess, but with some 3rd party script/override). Or if you have another idea about how to automatically know when the current song has ended - I'm open to that as well.
Reply


Messages In This Thread
QTimer with pause/resume functions? - by MegasXLR - May-17-2018, 12:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  saving progress, go to a new screen, then resume petomane 8 2,838 Jan-11-2021, 02:25 AM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020