|
|
@ -35,9 +35,18 @@ from template.qtgui.submenus import * |
|
|
|
|
|
|
|
#Our own files |
|
|
|
import engine.api as api |
|
|
|
from midiinput.stepmidiinput import stepMidiInput #singleton instance. Don't allow midi input when submenus are open. |
|
|
|
from .constantsAndConfigs import constantsAndConfigs |
|
|
|
from .designer.tickWidget import Ui_tickWidget |
|
|
|
|
|
|
|
#Wrap Submenu call to deactivate midi input while showing the menu. |
|
|
|
orgCall = Submenu.__call__ |
|
|
|
def wrapCallDeactivateMidIn(self): |
|
|
|
remember = stepMidiInput.midiInIsActive |
|
|
|
stepMidiInput.setMidiInputActive(False) |
|
|
|
orgCall(self) |
|
|
|
stepMidiInput.setMidiInputActive(remember) |
|
|
|
Submenu.__call__ = wrapCallDeactivateMidIn |
|
|
|
|
|
|
|
class CombinedTickWidget(QtWidgets.QFrame): |
|
|
|
def __init__(self): |
|
|
@ -152,8 +161,6 @@ class TickWidget(QtWidgets.QDialog): |
|
|
|
|
|
|
|
self.ui.durationLabel.setText(" + ".join(text)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SecondaryClefMenu(Submenu): |
|
|
|
|
|
|
|
clefs = [(translate("submenus", "[1] Treble"), lambda: api.insertClef("treble")), |
|
|
@ -197,7 +204,6 @@ class SecondarySplitMenu(Submenu): |
|
|
|
button.clicked.connect(function) |
|
|
|
button.clicked.connect(self.done) |
|
|
|
|
|
|
|
|
|
|
|
class SecondaryKeySignatureMenu(Submenu): |
|
|
|
def __init__(self, mainWindow): |
|
|
|
super().__init__(mainWindow, translate("submenus", "root note is the cursor position"), hasOkCancelButtons=2) |
|
|
@ -314,7 +320,6 @@ class SecondaryTemporaryTempoChangeMenu(Submenu): |
|
|
|
api.insertTempoChangeDuringDuration(v) |
|
|
|
self.done(True) |
|
|
|
|
|
|
|
|
|
|
|
class BlockPropertiesEdit(Submenu): |
|
|
|
def __init__(self, mainWindow, staticExportItem, hasOkCancelButtons=True): |
|
|
|
super().__init__(mainWindow, "") |
|
|
@ -401,7 +406,6 @@ class TransposeMenu(Submenu): |
|
|
|
api.transposeScore(fromPitch, toPitch) |
|
|
|
self.done(True) |
|
|
|
|
|
|
|
|
|
|
|
class SecondaryProperties(Submenu): |
|
|
|
def __init__(self, mainWindow): |
|
|
|
"""Directly edits the backend score meta data. There is no api and no callbacks""" |
|
|
@ -457,7 +461,6 @@ class SecondaryProperties(Submenu): |
|
|
|
self.done(True) |
|
|
|
#Instance gets killed afterwards. No need to save the new values. |
|
|
|
|
|
|
|
|
|
|
|
class SecondaryProgramChangeMenu(Submenu): |
|
|
|
lastProgramValue = 0 |
|
|
|
lastMsbValue = 0 |
|
|
@ -493,7 +496,6 @@ class SecondaryProgramChangeMenu(Submenu): |
|
|
|
api.instrumentChange(program, msb, lsb, self.shortInstrumentName.text(), ) |
|
|
|
self.done(True) |
|
|
|
|
|
|
|
|
|
|
|
class SecondaryChannelChangeMenu(Submenu): |
|
|
|
lastCustomValue = 0 |
|
|
|
|
|
|
@ -515,7 +517,6 @@ class SecondaryChannelChangeMenu(Submenu): |
|
|
|
api.channelChange(v-1, self.name.text()) |
|
|
|
self.done(True) |
|
|
|
|
|
|
|
|
|
|
|
class GridRhytmEdit(Submenu): |
|
|
|
def __init__(self, mainWindow): |
|
|
|
super().__init__(mainWindow, "", hasOkCancelButtons=True) |
|
|
@ -549,8 +550,6 @@ class GridRhytmEdit(Submenu): |
|
|
|
self.mainWindow.scoreView.scoreScene.grid.setOpacity(constantsAndConfigs.gridOpacity) #reset to initial value and undo the live preview |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Normal Functions |
|
|
|
############ |
|
|
|
|
|
|
@ -571,11 +570,3 @@ def forwardText(mainWindow, title, function): |
|
|
|
text, status = QtWidgets.QInputDialog.getText(mainWindow, title, title) |
|
|
|
if status: |
|
|
|
function(text) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|