Add dealer support

This commit is contained in:
kokarare1212
2021-09-12 16:56:20 +09:00
parent af4f3c91b9
commit 1eca34a601
5 changed files with 275 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import typing
if typing.TYPE_CHECKING:
from librespot.audio import AbsChunkedInputStream
from librespot.audio.format import SuperAudioFormat
from librespot.core import DealerClient
from librespot.crypto import Packet
from librespot.mercury import MercuryClient
from librespot.proto import Metadata_pb2 as Metadata
@@ -55,6 +56,11 @@ class HaltListener:
raise NotImplementedError
class MessageListener:
def on_message(self, uri: str, headers: typing.Dict[str, str], payload: bytes):
raise NotImplementedError
class NoopAudioDecrypt(AudioDecrypt):
def decrypt_chunk(self, chunk_index: int, buffer: bytes):
raise NotImplementedError
@@ -68,6 +74,11 @@ class PacketsReceiver:
raise NotImplementedError
class RequestListener:
def on_request(self, mid: str, pid: int, sender: str, command: typing.Any) -> DealerClient.RequestResult:
raise NotImplementedError
class SubListener:
def event(self, resp: MercuryClient.Response) -> None:
raise NotImplementedError