mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
Add a destroy method to Playables
This commit is contained in:
parent
49c1b39a53
commit
542c5897a6
2 changed files with 8 additions and 0 deletions
|
@ -59,3 +59,7 @@ class Playable:
|
||||||
should ``yield`` once before doing anything else."""
|
should ``yield`` once before doing anything else."""
|
||||||
yield
|
yield
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
async def destroy(self):
|
||||||
|
"""Clean up the Playable, as it is about to be replaced or deleted."""
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
|
@ -110,3 +110,7 @@ class VoicePlayer:
|
||||||
log.error(error)
|
log.error(error)
|
||||||
return
|
return
|
||||||
self._playback_ended_event.set()
|
self._playback_ended_event.set()
|
||||||
|
|
||||||
|
async def change_playing(self, value: Playable):
|
||||||
|
await self.playing.destroy()
|
||||||
|
self.playing = value
|
||||||
|
|
Loading…
Reference in a new issue