"""Abstract player interface."""

from __future__ import annotations

from abc import ABC, abstractmethod
from typing import Callable


class PlayerBackend(ABC):
    """Minimal playback interface used by the application."""

    @abstractmethod
    def attach_window(self, window: object) -> None: ...

    @abstractmethod
    def set_event_callback(self, callback: Callable[..., None] | None) -> None: ...

    @abstractmethod
    def set_viewport(self, width: int, height: int, top: int, bottom: int, left: int, right: int) -> None: ...

    @abstractmethod
    def has_new_frame(self) -> bool: ...

    @abstractmethod
    def render(self, renderer: object) -> bool: ...

    @abstractmethod
    def play(self, url: str) -> None: ...

    @abstractmethod
    def stop(self) -> None: ...

    @abstractmethod
    def toggle_pause(self) -> bool: ...

    @abstractmethod
    def seek(self, seconds: int) -> None: ...

    @abstractmethod
    def change_volume(self, delta: int) -> int: ...

    @abstractmethod
    def shutdown(self) -> None: ...

    @abstractmethod
    def is_playing(self) -> bool: ...
