jvconnected.ui.models.midi
- class jvconnected.ui.models.midi.MidiPortModel(*args, **kwargs)[source]
Bases:
GenericQObject
Qt Bridge to
jvconnected.interfaces.midi.BasePort
- parent_model
The parent
MidiPortsModel
container
- class jvconnected.ui.models.midi.MidiPortsModel(*args)[source]
Bases:
GenericQObject
Base container for
MidiPortModel
instances- 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
EngineModel
in use
- class jvconnected.ui.models.midi.InportsModel(*args)[source]
Bases:
MidiPortsModel
Container for input ports as
MidiPortModel
instances
- class jvconnected.ui.models.midi.OutportsModel(*args)[source]
Bases:
MidiPortsModel
Container for input ports as
MidiPortModel
instances
- class jvconnected.ui.models.midi.DeviceMapModel(*args, **kwargs)[source]
Bases:
GenericQObject
Representation of a single device/channel map within
DeviceMapsModel
- Signal dataChanged(deviceId: str, attr: str)
Emitted on property changes
- Parameters
deviceId – The
deviceId
of the instance emitting the signalattr – The property name that changed
- Property deviceName: str
The
display_name
of the device
- Property channel: int
If
edited
is True, the midi channel to assign to the device. Otherwise the channel currently assignedAllowed values are from 0 to 15 and
-1
is used to indicate no assignment (whereisMapped
is False)
- Property deviceIndex: int
The
device_index
- class jvconnected.ui.models.midi.SortFilterProxyModel[source]
Bases:
QSortFilterProxyModel
Sortable proxy model for
DeviceMapsModel
- class jvconnected.ui.models.midi.DeviceMapsModel(*args)[source]
Bases:
QAbstractTableModel
A table model used to interface with
MidiIO
device mappingDeviceMapsModel
instances are created for each device withinjvconnected.config.Config.devices
and theirchannel
values are read fromMidiIO
.Changes to the channel assignments are stored temporarily until
applied
orreset
- role_attrs
DeviceMapModel
property names used to populate the table columns
- role_names
PySide2.QtCore.Qt.UserRole
mapped to each property defined inrole_attrs
This is convoluted, weird, cumbersome and many other adjectives, but it seems to be the only way to make
PySide2.QtCore.QAbstractTableModel
act 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
EngineModel
in use
- Property proxyModel: jvconnected.ui.models.midi.SortFilterProxyModel
An attached
SortFilterProxyModel
instance
- Slot setSorting(role_name: str, order: <class 'PySide2.QtCore.Qt.SortOrder'>)[source]
Sort the
proxyModel
by the givenrole_name
- Slot incrementChannel(device_id: str) int [source]
Increment the
channel
for 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
channel
for 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.channel
mappingsRemaps 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]