Skip to content

Commit

Permalink
Update audio_player.py
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Mar 20, 2024
1 parent 130e1e0 commit f6a5b1c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Tools/HolocronToolset/src/toolset/gui/windows/audio_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,9 @@ def changePosition(self):
position: int = self.ui.timeSlider.value()
self.player.setPosition(position)

def hideEvent(self, event):
# closeEvent doesn't get called for whatever reason.
super().hideEvent(event)
def closeEvent(self, e: QCloseEvent | None = None):
self.player.stop()

def closeEvent(self, e: QCloseEvent | None = None): # FIXME(th3w1zard1): this event never gets called.
print("Closing window and stopping player") # Debugging line to confirm this method is called
self.player.stop() # Stop the player

if e is not None:
e.accept() # Notify the event system that the event has been handled
super().closeEvent(e) # Call the parent class's closeEvent method
e.accept()
super().closeEvent(e)

0 comments on commit f6a5b1c

Please sign in to comment.