def get_host_jack_ports( host: ty.Optional[str] = None ) -> ty.Tuple[ty.List[_JMidiPort], ty.List[_JMidiPort]]: """Return all Jack midi ports of Reaper on the specified host. Note ---- reascript 'Levitanus: (session_management) get_system_jack_ports' has to be registered in action editor. Parameters ---------- host : ty.Optional[str], optional 'localhost' or IPV4 address No Longer Returned ------------------ jack_in_ports: _JMidiPort jack_out_ports _JMidiPort """ if host == 'localhost': host = None with rpr.connect(host): with rpr.inside_reaper(): a_id: int = RPR.NamedCommandLookup( '_RSc3a0868bee74abaf333ac661af9a4a27257c37c1') rpr.perform_action(a_id) ports = prs.loads('slave_ports') # print(ports) return ports
def get_command_id(command_name): """ Return ID of command with a given name. Parameters ---------- command_name : str Command name. Returns ------- command_id : int or None Command ID, or None if name can't be found. """ command_id = RPR.NamedCommandLookup(command_name) command_id = command_id if command_id else None return command_id