MKtlLookup:
Filter:
Modality-toolkit/Classes (extension) | Libraries/Modality

MKtlLookup
ExtensionExtension

unify lookup for MKtl devices

Description

MKtlLookup provides a single dictionary with unique lookup names for all hardware/network devices found or declared, so they can be used with MKtls. MKtlLookup works in the background when doing MKtl.find;, so you will rarely encounter it, except when you debug device finding mechanisms.

The names are intentionally long to be both unique and descriptive of the source. short nicknames can and should be given in the MKtl creation:

NOTE: Currently, all endpoints found for the same device name are registered as one info dict. For most single-in, single-out devices this works perfectly. When multiple devices of the same kind are present (e.g. 2 midifader boxes), they are identified by a multiIndex. See Connecting_multiple_identical_devices.

Class Methods

.all

the lookup dictionary of all device infos found

.names

the lookup names of all device infos found

.postInfo

post info on all devices found

.allFor

the lookup names of all device infos using that protocol

.addHID

add a HIDInfo by as found by index in HID.available

.addAllHID

add all HIDINfos currently found in HID.available

.addMIDI

add a MIDIEndpoint as found by index in MIDIClient.sources or .destinations. type (\src or \dest) tells MKtlLookup whether it is in sources or .destinations.

.addAllMIDI

add all MIDIEndpoints currently found in MIDIClient sources or destinations. Happens automatically in MIDIMktlDevice.find.

.midiAll

a separate dict for sorting and matching all midi ports

.addOSC

add an OSC source or dest. As these are not globally represented, one makes them by hand, with sendAddr, replyAddr, and (given) name.

.findByIDInfo

Instance Methods

None, MKtlLookup is a Singleton.