jvconnected.ui.models.midi
- class jvconnected.ui.models.midi.MidiPortModel(*args, **kwargs)[source]
Bases:
GenericQObjectQt Bridge to
jvconnected.interfaces.midi.BasePort- parent_model
The parent
MidiPortsModelcontainer
- class jvconnected.ui.models.midi.MidiPortsModel(*args)[source]
Bases:
GenericQObjectBase container for
MidiPortModelinstances- Signal portAdded(port: jvconnected.ui.models.midi.MidiPortModel)
Fired when a new port is added
- Signal portRemoved(port: jvconnected.ui.models.midi.MidiPortModel)
Fired when an existing port is removed
- Property engine: jvconnected.ui.models.engine.EngineModel
The
EngineModelin use
- class jvconnected.ui.models.midi.InportsModel(*args)[source]
Bases:
MidiPortsModelContainer for input ports as
MidiPortModelinstances
- class jvconnected.ui.models.midi.OutportsModel(*args)[source]
Bases:
MidiPortsModelContainer for input ports as
MidiPortModelinstances
- class jvconnected.ui.models.midi.DeviceMapModel(*args, **kwargs)[source]
Bases:
GenericQObjectRepresentation of a single device/channel map within
DeviceMapsModel- Signal dataChanged(deviceId: str, attr: str)
Emitted on property changes
- Parameters
deviceId – The
deviceIdof the instance emitting the signalattr – The property name that changed
- Property deviceName: str
The
display_nameof the device
- Property channel: int
If
editedis True, the midi channel to assign to the device. Otherwise the channel currently assignedAllowed values are from 0 to 15 and
-1is used to indicate no assignment (whereisMappedis False)
- Property deviceIndex: int
The
device_index
- class jvconnected.ui.models.midi.SortFilterProxyModel[source]
Bases:
QSortFilterProxyModelSortable proxy model for
DeviceMapsModel
- class jvconnected.ui.models.midi.DeviceMapsModel(*args)[source]
Bases:
QAbstractTableModelA table model used to interface with
MidiIOdevice mappingDeviceMapsModelinstances are created for each device withinjvconnected.config.Config.devicesand theirchannelvalues are read fromMidiIO.Changes to the channel assignments are stored temporarily until
appliedorreset- role_attrs
DeviceMapModelproperty names used to populate the table columns
- role_names
PySide2.QtCore.Qt.UserRolemapped to each property defined inrole_attrsThis is convoluted, weird, cumbersome and many other adjectives, but it seems to be the only way to make
PySide2.QtCore.QAbstractTableModelact like a table. No clue why “roles” are necessary to access columns since that’s all a table is supposed to be¯\_(ツ)_/¯
- Property engine: jvconnected.ui.models.engine.EngineModel
The
EngineModelin use
- Property proxyModel: jvconnected.ui.models.midi.SortFilterProxyModel
An attached
SortFilterProxyModelinstance
- Slot setSorting(role_name: str, order: <class 'PySide2.QtCore.Qt.SortOrder'>)[source]
Sort the
proxyModelby the givenrole_name
- Slot incrementChannel(device_id: str) int[source]
Increment the
channelfor the given device_id by at least one.Existing channel mappings are skipped and if the channel number would be out of range, no changes are made.
- Slot decrementChannel(device_id: str) int[source]
Decrease the
channelfor the given device_id by at least one.Existing channel mappings are skipped and if the channel number would be out of range, no changes are made.
This only affects the temporary value in the model.
- Slot unassignChannel(device_id: str)[source]
Unassign the channel for the given device
This only affects the temporary value in the model.
- Slot resetChannel(device_id: str)[source]
Reset the channel for the given device
This only affects the temporary value in the model.
- async Slot apply()[source]
Apply any changes made to the
DeviceMapModel.channelmappingsRemaps the necessary device/channel mappings in
midi_io
- roleNames(self) Dict[int, PySide2.QtCore.QByteArray][source]
- columnCount(self, parent: PySide2.QtCore.QModelIndex = Invalid(PySide2.QtCore.QModelIndex)) int[source]
- rowCount(self, parent: PySide2.QtCore.QModelIndex = Invalid(PySide2.QtCore.QModelIndex)) int[source]
- flags(self, index: PySide2.QtCore.QModelIndex) PySide2.QtCore.Qt.ItemFlags[source]
- data(self, index: PySide2.QtCore.QModelIndex, role: int = PySide2.QtCore.Qt.ItemDataRole.DisplayRole) Any[source]