from typing import Protocol


class MpdBackend(Protocol):
    def connect(self) -> None: ...
    def current_song(self) -> dict[str, str] | None: ...
    def add(self, uri: str) -> None: ...
    def play(self, pos: int = 0) -> None: ...
    def clear(self) -> None: ...
    def delete(self, pos: int) -> None: ...
    def load_playlist(self, name: str) -> None: ...
    def list_playlists(self) -> list[str]: ...
    def list_playlist_tracks(self, name: str) -> list[str]: ...
    def search(self, query: str) -> list[dict[str, str]]: ...
    def update(self) -> None: ...
    def current_position(self) -> int | None: ...
    def queue_count(self) -> int: ...


class BeetsBackend(Protocol):
    def query(self, query: str) -> list[dict[str, str]]: ...
    def get_field(self, query: str, field: str) -> str: ...
    def modify(self, query: str, **fields: str) -> None: ...
    def move(self, query: str) -> None: ...
    def remove(self, query: str, delete: bool = False) -> None: ...
    def import_tracks(self, *args: str) -> None: ...
    def all_folders(self) -> list[str]: ...
    def all_playlists(self) -> list[str]: ...


class FfmpegBackend(Protocol):
    def split_cue(self, audio_file: str, cue_file: str, output_dir: str) -> list[str]: ...


class DialogBackend(Protocol):
    def confirm(self, title: str, text: str) -> bool: ...
    def form(self, title: str, fields: list[str], values: list[str] | None = None) -> list[str] | None: ...
    def notify(self, title: str, text: str) -> None: ...
