
    ^j                     f   d dl mZmZ d dlmZmZ d dlmZmZ d dl	m
Z
  G d de          Z G d de          Z G d	 d
          Z G d de
j        e          Ze                    d           e                    d           e                    d           e                    d           dS )    )ABCMetaabstractmethod)Enumauto)DictOptional)eventc                   ^    e Zd Z e            Z e            Z e            Z e            ZdS )DeviceStateN)__name__
__module____qualname__r   ACTIVEDISABLEDMISSING	UNPLUGGED     T/home/agentuser/manim-venv/lib/python3.11/site-packages/pyglet/media/devices/base.pyr   r      s:        TVVFtvvHdffGIIIr   r   c                   J    e Zd Z e            Z e            Z e            ZdS )
DeviceFlowN)r   r   r   r   OUTPUTINPUTINPUT_OUTPUTr   r   r   r   r      s/        TVVFDFFE466LLLr   r   c            
       r    e Zd ZU dZi Zeeef         ed<   i Z	eee
f         ed<   dededededef
d	Zd
 ZdS )AudioDevicezBase class for a platform independent audio device.
       _platform_state and _platform_flow is used to make device state numbers.platform_stateplatform_flowdev_idnamedescriptionflowstatec                 L    || _         || _        || _        || _        || _        d S )N)idr"   r#   r    r!   )selfr   r    r!   r"   r#   s         r   __init__zAudioDevice.__init__   s,    	
	&r   c                     d                     | j        j        | j        | j        | j                 j        | j        | j                 j                  S )Nz {}(name='{}', state={}, flow={}))format	__class__r   r    r   r#   r   r"   r&   s    r   __repr__zAudioDevice.__repr__"   sJ    188N#TY0CDJ0O0TVZVhimirVsVxz z 	zr   N)r   r   r   __doc__r   r   intr   __annotations__r   r   strr'   r,   r   r   r   r   r      s         S S-/NDk)*///+-M4Z(---'s '# 'C 's 'SV ' ' ' 'z z z z zr   r   c                       e Zd Zd Zed             Zed             Zed             Zed             Zed             Z	de
ded	efd
Zde
fdZde
fdZdee
         defdZdS )AbstractAudioDeviceManagerc                 0    |                      |            dS )zcRequired to remove handlers before exit, as it can cause problems with the event system's weakrefs.N)remove_handlersr+   s    r   __del__z"AbstractAudioDeviceManager.__del__)   s    T"""""r   c                     dS )zAReturns a default active output device or None if none available.Nr   r+   s    r   get_default_outputz-AbstractAudioDeviceManager.get_default_output-   	     	r   c                     dS )z@Returns a default active input device or None if none available.Nr   r+   s    r   get_default_inputz,AbstractAudioDeviceManager.get_default_input2   r8   r   c                     dS )z,Returns a list of all active output devices.Nr   r+   s    r   get_output_devicesz-AbstractAudioDeviceManager.get_output_devices7   r8   r   c                     dS )z+Returns a list of all active input devices.Nr   r+   s    r   get_input_devicesz,AbstractAudioDeviceManager.get_input_devices<   r8   r   c                     dS )zFReturns a list of all audio devices, no matter what state they are in.Nr   r+   s    r   get_all_devicesz*AbstractAudioDeviceManager.get_all_devicesA   r8   r   device	old_state	new_statec                     dS )zWEvent, occurs when the state of a device changes, provides the old state and new state.Nr   )r&   rA   rB   rC   s       r   on_device_state_changedz2AbstractAudioDeviceManager.on_device_state_changedF       r   c                     dS )z7Event, occurs when a new device is added to the system.Nr   r&   rA   s     r   on_device_addedz*AbstractAudioDeviceManager.on_device_addedJ   rF   r   c                     dS )zAEvent, occurs when an existing device is removed from the system.Nr   rH   s     r   on_device_removedz,AbstractAudioDeviceManager.on_device_removedN   rF   r   r"   c                     dS )zEvent, occurs when the default audio device changes.
           If there is no device that can be the default on the system, can be None.
           The flow determines whether an input or output device became it's respective default.
        Nr   )r&   rA   r"   s      r   on_default_changedz-AbstractAudioDeviceManager.on_default_changedR   s	    
 	r   N)r   r   r   r5   r   r7   r:   r<   r>   r@   r   r   rE   rI   rK   r   r   rM   r   r   r   r2   r2   '   s1       # # #   ^   ^   ^   ^   ^k k ^i    k        +)> j      r   r2   )	metaclassrE   rI   rK   rM   N)abcr   r   enumr   r   typingr   r   pygletr	   r   r   r   EventDispatcherr2   register_event_typer   r   r   <module>rU      st   ' ' ' ' ' ' ' '         ! ! ! ! ! ! ! !          $          z z z z z z z z$0 0 0 0 0!6' 0 0 0 0f  . ./H I I I  . ./@ A A A  . ./B C C C  . ./C D D D D Dr   