@ -36,7 +36,7 @@ import engine.api as api #Session is already loaded and created, no duplication.
SIZE_UNIT = 25 #this is in manual sync with timeline.py SIZE_UNIT
SIZE_UNIT = 30 #this is in manual sync with timeline.py SIZE_UNIT
SIZE_TOP_OFFSET = 0
_zValuesRelativeToScene = { #Only use for objects added directly to the scene, not children.
@ -93,7 +93,7 @@ class SongEditor(QtWidgets.QGraphicsScene):
def wheelEvent ( self , event ) :
""" zoom, otherwise ignore event """
if QtWidgets . QApplication . keyboardModifiers ( ) == QtCore . Qt . ControlModifier :
self . parentView . parentMainWindow . zoomUpperHalf ( event . delta ( ) )
self . parentView . parentMainWindow . zoomUpperHalf ( event )
event . accept ( )
else :
event . ignore ( )
@ -598,32 +598,32 @@ class Switch(QtWidgets.QGraphicsRectItem):
self . scaleTransposeGlyph = QtWidgets . QGraphicsSimpleTextItem ( " " )
self . scaleTransposeGlyph . setParentItem ( self )
self . scaleTransposeGlyph . setScale ( 0.80 )
self . scaleTransposeGlyph . setPos ( 2 , 1 )
self . scaleTransposeGlyph . setScale ( 0.75 )
self . scaleTransposeGlyph . setPos ( 2 , 0 )
self . scaleTransposeGlyph . setBrush ( self . parentTrackStructure . labelColor )
self . scaleTransposeGlyph . hide ( )
self . scaleTranspose = 0 #default engine value, safe to assume that it will never change as default.
self . halftoneTransposeGlyph = QtWidgets . QGraphicsSimpleTextItem ( " " )
self . halftoneTransposeGlyph . setParentItem ( self )
self . halftoneTransposeGlyph . setScale ( 0.80 )
self . halftoneTransposeGlyph . setPos ( 1 , 13 )
self . halftoneTransposeGlyph . setScale ( 0.75 )
self . halftoneTransposeGlyph . setPos ( 2 , 0 ) #We expect that only one of the transpose variants will be used. Therefore we place them on the same coordinates, because there is not enough space for 4 mods.
self . halftoneTransposeGlyph . setBrush ( self . parentTrackStructure . labelColor )
self . halftoneTransposeGlyph . hide ( )
self . halftoneTranspose = 0 #default engine value, safe to assume that it will never change as default.
self . stepDelayGlyph = QtWidgets . QGraphicsSimpleTextItem ( " " )
self . stepDelayGlyph . setParentItem ( self )
self . stepDelayGlyph . setScale ( 0.80 )
self . stepDelayGlyph . setPos ( 1 , 13 )
self . stepDelayGlyph . setScale ( 0.75 )
self . stepDelayGlyph . setPos ( 1 , 10 )
self . stepDelayGlyph . setBrush ( self . parentTrackStructure . labelColor )
self . stepDelayGlyph . hide ( )
self . stepDelay = 0 #default engine value, safe to assume that it will never change as default.
self . augmentationFactorGlyph = QtWidgets . QGraphicsSimpleTextItem ( " " )
self . augmentationFactorGlyph . setParentItem ( self )
self . augmentationFactorGlyph . setScale ( 0.80 )
self . augmentationFactorGlyph . setPos ( 1 , 13 )
self . augmentationFactorGlyph . setScale ( 0.75 )
self . augmentationFactorGlyph . setPos ( 1 , 20 )
self . augmentationFactorGlyph . setBrush ( self . parentTrackStructure . labelColor )
self . augmentationFactorGlyph . hide ( )
self . augmentationFactor = 0 #default engine value, safe to assume that it will never change as default.
@ -745,7 +745,7 @@ class Switch(QtWidgets.QGraphicsRectItem):
self . _setAugmentationFactorLabel ( Fraction ( value ) )
def _setAugmentationFactorLabel ( self , value ) :
text = " a " + str ( value )
text = " × " + str ( value )
self . augmentationFactorGlyph . setText ( text )
self . augmentationFactorGlyph . show ( )
@ -777,7 +777,7 @@ class Switch(QtWidgets.QGraphicsRectItem):
def hoverEnterEvent ( self , event ) :
""" Only active switches """
#self.statusMessage(QtCore.QCoreApplication.translate("Statusbar", "Measure: Left click to deactivate. Middle click to show as shadows in current pattern. Shift+MouseWheel for half tone transposition. Alt+MouseWheel for in-scale transposition. Right click for measure group options."))
self . statusMessage ( QtCore . QCoreApplication . translate ( " Statusbar " , " Measure: Left click to deactivate. Middle click to show as shadows in current pattern. Right click for measure group options. Read Edit menu for advanced modifications while hovering. " ) )
self . statusMessage ( QtCore . QCoreApplication . translate ( " Statusbar " , " Measure: Left click to deactivate. Middle click to show as shadows in current pattern. Right click for measure group options. Read the Edit menu for advanced modifications while hovering. " ) )
self . _bufferScaleTranspose = self . scaleTranspose
self . _bufferHalftoneTranspose = self . halftoneTranspose
self . _bufferStepDelay = self . stepDelay
@ -1089,18 +1089,18 @@ class TrackLabel(QtWidgets.QGraphicsRectItem):
self . lengthMultiplicatorSpinBox = TrackLabel . lengthMultiplicatorSpinBox ( parentTrackLabel = self )
self . lengthMultiplicatorSpinBox . setParentItem ( self )
self . lengthMultiplicatorSpinBox . setPos ( SIZE_UNIT , 0 )
self . lengthMultiplicatorSpinBox . setPos ( SIZE_UNIT , 2 )
self . colorButton = TrackLabel . ColorPicker ( parentTrackLabel = self )
self . colorButton . setParentItem ( self )
self . colorButton . setPos ( 4 * SIZE_UNIT , 3 )
self . colorButton . setPos ( 3 * SIZE_UNIT , 3 )
self . lineEdit = TrackLabel . NameLineEdit ( parentTrackLabel = self )
self . label = QtWidgets . QGraphicsProxyWidget ( )
self . label . setWidget ( self . lineEdit )
self . label . setParentItem ( self )
self . label . setPos ( 5 * SIZE_UNIT + 3 , 0 )
self . label . setPos ( 4 * SIZE_UNIT + 3 , 0 )
class lengthMultiplicatorSpinBox ( QtWidgets . QGraphicsProxyWidget ) :
def __init__ ( self , parentTrackLabel ) :
@ -1167,8 +1167,8 @@ class TrackLabel(QtWidgets.QGraphicsRectItem):
self . arrowLabel = QtWidgets . QGraphicsSimpleTextItem ( " ↕ " )
self . arrowLabel . setFlag ( QtWidgets . QGraphicsItem . ItemIgnoresParentOpacity )
self . arrowLabel . setParentItem ( self )
self . arrowLabel . setScale ( 1.6 )
self . arrowLabel . setPos ( 2 , 1 )
self . arrowLabel . setScale ( 1.5 )
self . arrowLabel . setPos ( 5 , 2 ) #try to get the center
role = QtGui . QPalette . Text
self . arrowLabel . setBrush ( self . parentTrackLabel . parentScene . parentView . parentMainWindow . fPalBlue . color ( role ) )
@ -1323,7 +1323,7 @@ class GroupLabel(QtWidgets.QGraphicsRectItem):
self . label = QtWidgets . QGraphicsProxyWidget ( )
self . label . setWidget ( self . qLabel )
self . label . setParentItem ( self )
self . label . setPos ( 4 * SIZE_UNIT + 3 , 0 )
self . label . setPos ( 3 * SIZE_UNIT + 3 , 0 )
self . qLabel . setMinimumSize ( QtCore . QSize ( 0 , SIZE_UNIT ) )
self . qLabel . setStyleSheet ( " background-color: rgba(0,0,0,0) " ) #transparent so we see the RectItem color
@ -1360,8 +1360,8 @@ class GroupLabel(QtWidgets.QGraphicsRectItem):
self . arrowLabel = QtWidgets . QGraphicsSimpleTextItem ( " ↕ " )
self . arrowLabel . setFlag ( QtWidgets . QGraphicsItem . ItemIgnoresParentOpacity )
self . arrowLabel . setParentItem ( self )
self . arrowLabel . setScale ( 1.6 )
self . arrowLabel . setPos ( 2 , 1 )
self . arrowLabel . setScale ( 1.5 )
self . arrowLabel . setPos ( 5 , 2 ) #try to get the center
role = QtGui . QPalette . Text
self . arrowLabel . setBrush ( self . parentGroupLabel . parentScene . parentView . parentMainWindow . fPalBlue . color ( role ) )