Browse Source

Add menu to add multi measure rest with a number

master
Nils 3 years ago
parent
commit
e6555caa33
  1. 1
      CHANGELOG
  2. 5
      qtgui/designer/mainwindow.py
  3. 9
      qtgui/designer/mainwindow.ui
  4. 3
      qtgui/menu.py
  5. 22
      qtgui/submenus.py

1
CHANGELOG

@ -14,6 +14,7 @@ Add functions to move block to start or end of track.
Scroll view when dragging blocks and tracks with the mouse.
Block name font color is now always readable, no matter the background color
Add 3/2 to metrical instruction.
Add custom Multimeasure-Rest submenu and menu command.
Autosave when exporting Lilypond .ly or PDF.
Command to quickly add text below or above a staff.
Allow menu commands in CC and Block view: PDF, .ly export, metadata edit, zoom.

5
qtgui/designer/mainwindow.py

@ -683,12 +683,15 @@ class Ui_MainWindow(object):
self.actionPaste_modal_transposed.setObjectName("actionPaste_modal_transposed")
self.actionPaste_real_transposed = QtWidgets.QAction(MainWindow)
self.actionPaste_real_transposed.setObjectName("actionPaste_real_transposed")
self.actionCustom_Multi_Measure_Rest = QtWidgets.QAction(MainWindow)
self.actionCustom_Multi_Measure_Rest.setObjectName("actionCustom_Multi_Measure_Rest")
self.menuObjects.addAction(self.actionMetrical_Instruction)
self.menuObjects.addAction(self.actionClef)
self.menuObjects.addAction(self.actionKey_Signature)
self.menuObjects.addSeparator()
self.menuObjects.addAction(self.actionDynamics)
self.menuObjects.addAction(self.actionMulti_Measure_Rest)
self.menuObjects.addAction(self.actionCustom_Multi_Measure_Rest)
self.menuObjects.addAction(self.actionLegatoSlur)
self.menuObjects.addSeparator()
self.menuObjects.addAction(self.actionTempo_Change)
@ -1036,3 +1039,5 @@ class Ui_MainWindow(object):
self.actionPaste_modal_transposed.setText(_translate("MainWindow", "Paste modal transposed"))
self.actionPaste_modal_transposed.setShortcut(_translate("MainWindow", "Ctrl+Shift+V"))
self.actionPaste_real_transposed.setText(_translate("MainWindow", "Paste real transposed"))
self.actionCustom_Multi_Measure_Rest.setText(_translate("MainWindow", "Custom Multi Measure Rest"))
self.actionCustom_Multi_Measure_Rest.setShortcut(_translate("MainWindow", "Alt+R"))

9
qtgui/designer/mainwindow.ui

@ -62,6 +62,7 @@
<addaction name="separator"/>
<addaction name="actionDynamics"/>
<addaction name="actionMulti_Measure_Rest"/>
<addaction name="actionCustom_Multi_Measure_Rest"/>
<addaction name="actionLegatoSlur"/>
<addaction name="separator"/>
<addaction name="actionTempo_Change"/>
@ -1823,6 +1824,14 @@
<string>Paste real transposed</string>
</property>
</action>
<action name="actionCustom_Multi_Measure_Rest">
<property name="text">
<string>Custom Multi Measure Rest</string>
</property>
<property name="shortcut">
<string>Alt+R</string>
</property>
</action>
</widget>
<resources/>
<connections/>

3
qtgui/menu.py

@ -37,7 +37,7 @@ from template.qtgui.midiinquickwidget import QuickMidiInputComboController
import engine.api as api
from engine.midiinput.stepmidiinput import stepMidiInput #singleton instance
from .constantsAndConfigs import constantsAndConfigs
from .submenus import SecondaryClefMenu, SecondaryKeySignatureMenu, SecondaryDynamicsMenu, SecondaryMetricalInstructionMenu, SecondaryTempoChangeMenu, SecondaryTemporaryTempoChangeMenu, SecondarySplitMenu, TransposeMenu, pedalNoteChooser, SecondaryProperties, SecondaryProgramChangeMenu, SecondaryChannelChangeMenu, ChooseOne, forwardText
from .submenus import SecondaryClefMenu, SecondaryKeySignatureMenu, SecondaryDynamicsMenu, SecondaryMetricalInstructionMenu, SecondaryTempoChangeMenu, SecondaryTemporaryTempoChangeMenu, SecondarySplitMenu, TransposeMenu, pedalNoteChooser, SecondaryProperties, SecondaryProgramChangeMenu, SecondaryChannelChangeMenu, ChooseOne, forwardText, SecondaryMultimeasureRestMenu
class ModalKeys(object):
def __init__(self):
@ -223,6 +223,7 @@ class MenuActionDatabase(object):
self.mainWindow.ui.actionKey_Signature : SecondaryKeySignatureMenu(self.mainWindow),
self.mainWindow.ui.actionDynamics : SecondaryDynamicsMenu(self.mainWindow),
self.mainWindow.ui.actionMulti_Measure_Rest : lambda: api.insertMultiMeasureRest(1),
self.mainWindow.ui.actionCustom_Multi_Measure_Rest : SecondaryMultimeasureRestMenu(self.mainWindow),
self.mainWindow.ui.actionMetrical_Instruction : SecondaryMetricalInstructionMenu(self.mainWindow),

22
qtgui/submenus.py

@ -539,6 +539,28 @@ class GridRhytmEdit(Submenu):
def abortHandler(self):
self.mainWindow.scoreView.scoreScene.grid.setOpacity(constantsAndConfigs.gridOpacity) #reset to initial value and undo the live preview
class SecondaryMultimeasureRestMenu(Submenu):
lastCustomValue = 0
def __init__(self, mainWindow):
super().__init__(mainWindow, translate("submenus", "Rest for how many measures?\n\n(Only works if there is a metrical instruction.)"), hasOkCancelButtons=True)
self.spinbox = QtWidgets.QSpinBox()
self.spinbox.setValue(type(self).lastCustomValue)
self.spinbox.setMinimum(1)
self.spinbox.setMaximum(9999)
self.spinbox.setSingleStep(1)
self.layout.addRow(translate("submenus", "Measures"), self.spinbox)
#self.name = QtWidgets.QLineEdit()
#self.layout.addRow(translate("submenus", "Text"), self.name)
def process(self):
v = self.spinbox.value()
type(self).lastCustomValue = v
api.insertMultiMeasureRest(v)
self.done(True)
#Normal Functions
############

Loading…
Cancel
Save