Source code for jdxi_editor.ui.windows.jdxi.containers.wheels

from PySide6.QtWidgets import QHBoxLayout, QLabel

from jdxi_editor.core.jdxi import JDXi
from jdxi_editor.ui.widgets.wheel.mod import ModWheel
from jdxi_editor.ui.widgets.wheel.pitch import PitchWheel
from jdxi_editor.ui.style.editor_style import panel_rules


[docs] def build_wheel_label_row(): label_layout = QHBoxLayout() label_layout.setContentsMargins(0, 0, 0, 0) label_layout.addStretch() for text in ["Pitch", "Mod"]: label = QLabel(text) label.setStyleSheet(panel_rules()) label_layout.addWidget(label) label_layout.addStretch() return label_layout
[docs] def build_wheel_row(midi_helper, owner=None): """The pitch and mod wheels; *owner* (the main window) keeps them as pitch_wheel and mod_wheel, for the follower to mirror the JD-Xi's.""" wheel_layout = QHBoxLayout() wheel_layout.addStretch() pitch_wheel = PitchWheel(midi_helper=midi_helper, bidirectional=True) pitch_wheel.setMinimumWidth(20) wheel_layout.addWidget(pitch_wheel) wheel_layout.addStretch() mod_wheel = ModWheel(midi_helper=midi_helper, bidirectional=False) mod_wheel.setMinimumWidth(20) wheel_layout.addWidget(mod_wheel) wheel_layout.addStretch() if owner is not None: owner.pitch_wheel = pitch_wheel owner.mod_wheel = mod_wheel return wheel_layout