from __future__ import annotations
from typing import TYPE_CHECKING, Any, Callable, Iterable

if TYPE_CHECKING:
    from Live.Base import StringVector
    from Live.Device import ATimeableValueVector, Device



class PluginDevice(Device):
    """This class represents a plugin device."""

    def add_presets_listener(self, callback: Callable[[], None], /) -> None:
        """
        Add a listener function or method, which will be called as soon as the
        property "presets" has changed.
        """
        ...

    def add_selected_preset_index_listener(self, callback: Callable[[], None], /) -> None:
        """
        Add a listener function or method, which will be called as soon as the
        property "selected_preset_index" has changed.
        """
        ...

    def get_parameter_names(self, begin: int = 0, end: int = -1, /) -> StringVector:
        """
        Get the range of plugin parameter names, bound by begin and end.
        If end is smaller than 0 it is interpreted as the parameter count.
        """
        ...

    @property
    def is_active(self) -> bool:
        """Return const access to whether this device is active. This will be false bothwhen the device is off and when it's inside a rack device which is off."""
        ...

    @property
    def latency_in_ms(self) -> float:
        """Returns the latency of the device in ms."""
        ...

    @property
    def latency_in_samples(self) -> int:
        """Returns the latency of the device in samples."""
        ...

    @property
    def name(self) -> str:
        """Return access to the name of the device."""
        ...

    @name.setter
    def name(self, value: str) -> None: ...

    @property
    def parameters(self) -> ATimeableValueVector:
        """Const access to the list of available automatable parameters for this device."""
        ...

    @property
    def presets(self) -> StringVector:
        """Get the list of presets the plugin offers."""
        ...

    def presets_has_listener(self, callback: Callable[[], None], /) -> bool:
        """
        Returns true, if the given listener function or method is connected
        to the property "presets".
        """
        ...

    def remove_presets_listener(self, callback: Callable[[], None], /) -> None:
        """
        Remove a previously set listener function or method from
        property "presets".
        """
        ...

    def remove_selected_preset_index_listener(self, callback: Callable[[], None], /) -> None:
        """
        Remove a previously set listener function or method from
        property "selected_preset_index".
        """
        ...

    @property
    def selected_preset_index(self) -> int:
        """Access to the index of the currently selected preset."""
        ...

    @selected_preset_index.setter
    def selected_preset_index(self, value: int) -> None: ...

    def selected_preset_index_has_listener(self, callback: Callable[[], None], /) -> bool:
        """
        Returns true, if the given listener function or method is connected
        to the property "selected_preset_index".
        """
        ...

__all__ = ['PluginDevice']
