Skip to content

Commit

Permalink
feat(player): expose Player.paused (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
ooliver1 committed Feb 16, 2023
1 parent 00d547c commit 6e25025
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mafic/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def __init__(
self._filters: OrderedDict[str, Filter] = OrderedDict()
# Used to get the last track for TrackEndEvent.
self._last_track: Track | None = None
self._paused: bool = False

def __repr__(self) -> str:
attrs = (
Expand Down Expand Up @@ -155,6 +156,12 @@ def current(self) -> Track | None:

return self._current

@property
def paused(self) -> bool:
"""Whether the player is paused."""

return self._paused

def update_state(self, state: PlayerUpdateState) -> None:
"""Update the player state.
Expand Down Expand Up @@ -512,6 +519,9 @@ async def update(
no_replace=not replace,
)

if pause is not None:
self._paused = pause

async def play(
self,
track: Track,
Expand Down

0 comments on commit 6e25025

Please sign in to comment.