from .port import TSIPort, MemoryManager, PortIO, Capturer
from .modules.ag.ag import AudioGenerator


class TX(TSIPort):
    """
    Class describe base capabilities of Source (TX - transmitter).
    This functionality is used by child classes `DPTX` and `HDTX`.
    You cannot use a class `TX` object directly.
    """
    def __init__(self, port_io: PortIO, memory_manager: MemoryManager, capturer: Capturer):
        super().__init__(port_io, memory_manager, capturer)

        self.__ag = AudioGenerator(port_io, memory_manager)

    @property
    def ag(self) -> AudioGenerator:
        """

        Should be used to control `AudioGenerator` on Source (TX - transmitter) role.

        Returns:
            object of `AudioGenerator` type.
        """
        return self.__ag
