jdxi_editor.midi.sysex.names ============================ .. py:module:: jdxi_editor.midi.sysex.names .. autoapi-nested-parse:: Names of SysEx bytes from the JD-Xi address and parameter enums. .. rubric:: Example >>> from jdxi_editor.midi.data.address.address import CommandID >>> parse_sysex_byte(0x12, CommandID) 'DT1' Attributes ---------- .. autoapisummary:: jdxi_editor.midi.sysex.names.T Classes ------- .. autoapisummary:: jdxi_editor.midi.sysex.names.SysExEnumProtocol jdxi_editor.midi.sysex.names.EnumWithAddress Functions --------- .. autoapisummary:: jdxi_editor.midi.sysex.names.parse_sysex_byte Module Contents --------------- .. py:data:: T .. py:class:: SysExEnumProtocol Bases: :py:obj:`Protocol` Base class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto(Protocol[T]): def meth(self) -> T: ... .. py:method:: message_position() -> int :classmethod: .. py:method:: __call__(value: int) .. py:class:: EnumWithAddress Bases: :py:obj:`Protocol` Base class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto(Protocol[T]): def meth(self) -> T: ... .. py:method:: message_position() -> int :classmethod: Get the position of the message in the SysEx message. :return: int - the position of the message .. py:method:: get_parameter_by_address(address: int) -> Optional[T] :classmethod: Get the enum member by address. :param address: int :return: Optional[T] - the enum member or None if not found .. py:function:: parse_sysex_byte(byte_value: int, enum_cls: Type[SysExEnumProtocol]) -> str Get the name of a SysEx byte value using a given enum class. Supports both: - address-aware enums (get_parameter_by_address) - value-based enums (IntEnum / Enum) :param byte_value: SysEx byte value :param enum_cls: Enum class :return: name or "COMMON (0x??)" if not found