Browse Source

Adapt playhead in pattern view to the new, much longer, patterns. Option to follow playhead, better follow-scrolling.

master
Nils 3 years ago
parent
commit
181225e7c7
  1. 9
      qtgui/mainwindow.py
  2. 26
      qtgui/pattern_grid.py
  3. 2631
      qtgui/resources.py
  4. BIN
      qtgui/resources/translations/de.qm
  5. 71
      qtgui/resources/translations/de.ts
  6. 1
      template/qtgui/mainwindow.py

9
qtgui/mainwindow.py

@ -561,6 +561,12 @@ class MainWindow(TemplateMainWindow):
def equalizeSongPatternAreas(self):
self.ui.splitter.setSizes([1,1])
def toggleFollowPlayheadInPattern(self):
"""We do not need to do anything here at the moment. Pattern.playhead will just check
the menu checkbox"""
pass
#now = self.ui.actionPatternFollowPlayhead.isChecked()
#self.ui.actionPatternFollowPlayhead.setChecked(not now)
def createMenu(self):
#We have undo/redo since v2.1. Template menu entries were hidden before.
@ -574,7 +580,10 @@ class MainWindow(TemplateMainWindow):
self.menu.addMenuEntry("menuView", "actionMaximizeSongArea", QtCore.QCoreApplication.translate("menu", "Maximize Song Area"), self.maximizeSongArea)
self.menu.addMenuEntry("menuView", "actionMaximizePatternArea", QtCore.QCoreApplication.translate("menu", "Maximize Pattern Area"), self.maximizePatternArea)
self.menu.addMenuEntry("menuView", "actionEqualSizeSongPatternArea", QtCore.QCoreApplication.translate("menu", "Equal space for Pattern/Song Area"), self.equalizeSongPatternAreas)
self.menu.addMenuEntry("menuView", "actionPatternFollowPlayhead", QtCore.QCoreApplication.translate("menu", "Follow playhead in pattern-view by scrolling."), self.toggleFollowPlayheadInPattern, checkable=True, shortcut="f")
#self.menu.addSeparator("menuEdit")
self.menu.orderSubmenus(["menuFile", "menuEdit", "menuView", "menuHelp", "menuDebug"])
if not self.nsmClient.sessionName == "NOT-A-SESSION": #standalone mode
self.ui.actionQuit.setShortcut("")

26
qtgui/pattern_grid.py

@ -980,19 +980,23 @@ class Playhead(QtWidgets.QGraphicsLineItem):
factor = self.parentScene._tracks[self.parentScene.parentView.parentMainWindow.currentTrackId]["patternLengthMultiplicator"]
x = (tickindex % (self.parentScene.oneMeasureInTicks * factor)) / self.parentScene.ticksToPixelRatio
x += SIZE_RIGHT_OFFSET
numberOfSteps = self.parentScene._tracks[self.parentScene.parentView.parentMainWindow.currentTrackId]["numberOfSteps"]
self.setLine(0, 0, 0, numberOfSteps * SIZE_UNIT)
self.setX(x)
#scenePos = self.parentScene.parentView.mapFromScene(self.pos())
#cursorViewPosX = scenePos.x() #the cursor position in View coordinates
#width = self.parentScene.parentView.geometry().width()
if playbackStatus: # api.duringPlayback:
numberOfSteps = self.parentScene._tracks[self.parentScene.parentView.parentMainWindow.currentTrackId]["numberOfSteps"]
self.setLine(0, 0, 0, numberOfSteps * SIZE_UNIT)
self.show()
self.setX(x)
scenePos = self.parentScene.parentView.mapFromScene(self.pos())
cursorViewPosX = scenePos.x() #the cursor position in View coordinates
width = self.parentScene.parentView.geometry().width()
if cursorViewPosX <= 0 or cursorViewPosX >= width: #"pageflip"
self.parentScene.parentView.horizontalScrollBar().setValue(x)
self.setOpacity(1)
if self.parentScene.parentView.parentMainWindow.ui.actionPatternFollowPlayhead.isChecked():
self.parentScene.parentView.centerOn(x, 0)
else:
self.hide()
#self.hide() #This was before 2.0 when we only had short patterns. But now we need to see where we are. Lower opacity instead.:
self.setOpacity(0.5)
class VelocityControls(QtWidgets.QWidget):
def __init__(self, mainWindow, patternScene):

2631
qtgui/resources.py

File diff suppressed because it is too large

BIN
qtgui/resources/translations/de.qm

Binary file not shown.

71
qtgui/resources/translations/de.ts

@ -75,7 +75,7 @@
<context>
<name>GroupLabel</name>
<message>
<location filename="../../songeditor.py" line="1050"/>
<location filename="../../songeditor.py" line="1083"/>
<source>grab and move to reorder groups</source>
<translation>mit der maus halten und ziehen um Gruppen anzuordnen</translation>
</message>
@ -101,22 +101,22 @@
<context>
<name>Menu</name>
<message>
<location filename="../../mainwindow.py" line="570"/>
<location filename="../../mainwindow.py" line="576"/>
<source>Convert Grouping</source>
<translation>Gruppierung umwandeln</translation>
</message>
<message>
<location filename="../../mainwindow.py" line="570"/>
<location filename="../../mainwindow.py" line="576"/>
<source>Change step-grouping but keep your music the same</source>
<translation>Taktartaufspaltung durch Gruppierung umwandeln, versucht die Musik gleich klingen zu lassen</translation>
</message>
<message>
<location filename="../../mainwindow.py" line="571"/>
<location filename="../../mainwindow.py" line="577"/>
<source>Global Rhythm Offset</source>
<translation>Allgemeiner Rhythmusversatz</translation>
</message>
<message>
<location filename="../../mainwindow.py" line="571"/>
<location filename="../../mainwindow.py" line="577"/>
<source>Shift the whole piece further down the timeline</source>
<translation>Schiebt das gesamte Stück &quot;später&quot; auf die Timeline</translation>
</message>
@ -473,27 +473,27 @@
<translation type="obsolete">Lösche {} Takte von Takt {} beginnend</translation>
</message>
<message>
<location filename="../../songeditor.py" line="399"/>
<location filename="../../songeditor.py" line="412"/>
<source>Insert empty group before this one</source>
<translation>Leere Taktgruppe vor dieser einfügen</translation>
</message>
<message>
<location filename="../../songeditor.py" line="401"/>
<location filename="../../songeditor.py" line="414"/>
<source>Delete whole group</source>
<translation>Lösche diese Taktgruppe</translation>
</message>
<message>
<location filename="../../songeditor.py" line="402"/>
<location filename="../../songeditor.py" line="415"/>
<source>Duplicate whole group including measures</source>
<translation>Verdopple diese Taktgruppe inkl. Struktur</translation>
</message>
<message>
<location filename="../../songeditor.py" line="403"/>
<location filename="../../songeditor.py" line="416"/>
<source>Clear all group transpositions</source>
<translation>Setze alle Transpositionen dieser Taktgruppe zurück</translation>
</message>
<message>
<location filename="../../songeditor.py" line="400"/>
<location filename="../../songeditor.py" line="413"/>
<source>Exchange group with right neigbour</source>
<translation>Tausche Gruppe mit rechter Nachbargruppe</translation>
</message>
@ -625,12 +625,12 @@
<context>
<name>TrackLabel</name>
<message>
<location filename="../../songeditor.py" line="856"/>
<location filename="../../songeditor.py" line="883"/>
<source>grab and move to reorder tracks</source>
<translation>mit der maus halten und ziehen um Spuren anzuordnen</translation>
</message>
<message>
<location filename="../../songeditor.py" line="865"/>
<location filename="../../songeditor.py" line="892"/>
<source>change track color</source>
<translation>setze Farbe der Spur</translation>
</message>
@ -638,27 +638,27 @@
<context>
<name>TrackLabelContext</name>
<message>
<location filename="../../songeditor.py" line="760"/>
<location filename="../../songeditor.py" line="787"/>
<source>Invert Measures</source>
<translation>Taktauswahl umdrehen</translation>
</message>
<message>
<location filename="../../songeditor.py" line="761"/>
<location filename="../../songeditor.py" line="788"/>
<source>All Measures On</source>
<translation>Alle Takte anschalten</translation>
</message>
<message>
<location filename="../../songeditor.py" line="762"/>
<location filename="../../songeditor.py" line="789"/>
<source>All Measures Off</source>
<translation>Alle Takte ausschalten</translation>
</message>
<message>
<location filename="../../songeditor.py" line="763"/>
<location filename="../../songeditor.py" line="790"/>
<source>Clone this Track</source>
<translation>Spur klonen</translation>
</message>
<message>
<location filename="../../songeditor.py" line="764"/>
<location filename="../../songeditor.py" line="791"/>
<source>Delete Track</source>
<translation>Spur löschen</translation>
</message>
@ -668,42 +668,42 @@
<translation type="obsolete">Übernimm Struktur von</translation>
</message>
<message>
<location filename="../../songeditor.py" line="781"/>
<location filename="../../songeditor.py" line="808"/>
<source>Merge/Copy Measure-Structure from</source>
<translation>Übernimm und ergänze Struktur von</translation>
</message>
<message>
<location filename="../../songeditor.py" line="795"/>
<location filename="../../songeditor.py" line="822"/>
<source>Replace Pattern with</source>
<translation>Ersetze Noten des Taktes durch</translation>
</message>
<message>
<location filename="../../songeditor.py" line="809"/>
<location filename="../../songeditor.py" line="836"/>
<source>Send on MIDI Channel</source>
<translation>Sende auf MIDI Kanal</translation>
</message>
<message>
<location filename="../../songeditor.py" line="737"/>
<location filename="../../songeditor.py" line="758"/>
<source>Group Name</source>
<translation>Gruppenname</translation>
</message>
<message>
<location filename="../../songeditor.py" line="738"/>
<location filename="../../songeditor.py" line="759"/>
<source>Create a new group by name</source>
<translation>Neue Gruppe erstellen</translation>
</message>
<message>
<location filename="../../songeditor.py" line="819"/>
<location filename="../../songeditor.py" line="846"/>
<source>Group</source>
<translation>Gruppe</translation>
</message>
<message>
<location filename="../../songeditor.py" line="820"/>
<location filename="../../songeditor.py" line="847"/>
<source>New Group</source>
<translation>Neue Gruppe</translation>
</message>
<message>
<location filename="../../songeditor.py" line="825"/>
<location filename="../../songeditor.py" line="852"/>
<source>Remove from </source>
<translation>Aus Gruppe entfernen: </translation>
</message>
@ -784,22 +784,22 @@
<context>
<name>VelocityControls</name>
<message>
<location filename="../../pattern_grid.py" line="1009"/>
<location filename="../../pattern_grid.py" line="1013"/>
<source>+Velocity</source>
<translation>+Velocity</translation>
</message>
<message>
<location filename="../../pattern_grid.py" line="1012"/>
<location filename="../../pattern_grid.py" line="1016"/>
<source>Make everything louder. Hover and mousewheel up/down to go in steps of 10.</source>
<translation>Alle Töne lauter machen. Mit dem Mauszeiger über dem Knopf bleiben und das Mausrad auf oder ab bewegen für 10er Schritte.</translation>
</message>
<message>
<location filename="../../pattern_grid.py" line="1015"/>
<location filename="../../pattern_grid.py" line="1019"/>
<source>-Velocity</source>
<translation>-Velocity</translation>
</message>
<message>
<location filename="../../pattern_grid.py" line="1018"/>
<location filename="../../pattern_grid.py" line="1022"/>
<source>Make everything softer. Hover and mousewheel up/down to go in steps of 10.</source>
<translation>Alle Töne leiser machen. Mit dem Mauszeiger über dem Knopf bleiben und das Mausrad auf oder ab bewegen für 10er Schritte.</translation>
</message>
@ -835,24 +835,29 @@
<context>
<name>menu</name>
<message>
<location filename="../../mainwindow.py" line="573"/>
<location filename="../../mainwindow.py" line="579"/>
<source>View</source>
<translation>Ansicht</translation>
</message>
<message>
<location filename="../../mainwindow.py" line="574"/>
<location filename="../../mainwindow.py" line="580"/>
<source>Maximize Song Area</source>
<translation>Formeditor maximieren</translation>
</message>
<message>
<location filename="../../mainwindow.py" line="575"/>
<location filename="../../mainwindow.py" line="581"/>
<source>Maximize Pattern Area</source>
<translation>Takteditor maximieren</translation>
</message>
<message>
<location filename="../../mainwindow.py" line="576"/>
<location filename="../../mainwindow.py" line="582"/>
<source>Equal space for Pattern/Song Area</source>
<translation>Gleiche Größe für Form- und Takteditor</translation>
</message>
<message>
<location filename="../../mainwindow.py" line="583"/>
<source>Follow playhead in pattern-view by scrolling.</source>
<translation>Playhead in Musteransicht durch Scrollen verfolgen.</translation>
</message>
</context>
</TS>

1
template/qtgui/mainwindow.py

@ -145,7 +145,6 @@ class MainWindow(QtWidgets.QMainWindow):
if settings.contains("showAboutDialog") and settings.value("showAboutDialog", type=bool):
QtCore.QTimer.singleShot(100, self.about.show) #Qt Event loop is not ready at that point. We need to wait for the paint event. This is not to stall for time: Using the event loop guarantees that it exists
elif not self.nsmClient.sessionName == "NOT-A-SESSION": #standalone mode
self.ui.actionQuit.setShortcut("")
#TODO: this is a hack until we figure out how to cleanly handle hide vs quite from outside the application
self.hideGUI()

Loading…
Cancel
Save