Browse Source

changes

master
Nils 5 years ago
parent
commit
570c22c307
  1. 20
      engine/api.py
  2. 2
      engine/cursor.py
  3. 20
      engine/graphtracks.py
  4. 22
      engine/main.py
  5. 2
      engine/track.py
  6. 21
      qtgui/conductor.py
  7. 7
      qtgui/constantsAndConfigs.py
  8. 9
      qtgui/cursor.py
  9. 8
      qtgui/graphs.py
  10. 8
      qtgui/items.py
  11. 5
      qtgui/mainwindow.py
  12. 29
      qtgui/menu.py
  13. 5
      qtgui/scoreview.py
  14. 9
      qtgui/structures.py
  15. 7
      qtgui/submenus.py
  16. 13
      qtgui/timeline.py.delete
  17. 9
      qtgui/trackEditor.py

20
engine/api.py

@ -1,12 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2018, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
The Template Base Application is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -122,7 +122,7 @@ class ClientCallbacks(Callbacks): #inherits from the templates api callbacks
can be used by a GUI to draw notes.
track.staticRepresentation also creates the internal midi representation for cbox. """
if self.updateTrack:
ex = session.data.trackById(trId).staticRepresentation()
ex = session.data.trackById(trId).staticRepresentation() #Includes cbox.updatePlayback
for func in self.updateTrack:
func(trId, ex)
self._updateBlockTrack(trId)
@ -193,6 +193,8 @@ class ClientCallbacks(Callbacks): #inherits from the templates api callbacks
for func in reversed(self.tracksChangedIncludingHidden):
func(ex + exHidden)
self._dataChanged()
session.data.metronome.label = session.data.currentMetronomeTrack.name #not the expensive redundant data generation
self._metronomeChanged() #because the track name is sent here.
def _updateTempoTrack(self):
@ -292,9 +294,8 @@ def startEngine(nsmClient):
for track in session.data.hiddenTracks: #After loading a file some tracks could be hidden. We want midi for them as well.
track.staticRepresentation() #that generates the calfbox data as a side effect. discard the other data.
useCurrentTrackAsMetronome()
setMetronome(session.data.currentMetronomeTrack.asMetronomeData, label=session.data.currentMetronomeTrack.name) #track.asMetronomeData is generated in staticRepresentation #template api. has callbacks
callbacks._setCursor()
global laborejoEngineStarted #makes for a convenient check. stepMidiInput uses it, which needs to know that the gui already started the api.
@ -666,6 +667,7 @@ def resetDynamicSettingsSignature(trId):
session.history.register(lambda trId=trId, previousSettings=previousSettings: setTrackSettings(trId, previousSettings), descriptionString = "reset track dynamic settings")
callbacks._tracksChanged()
#We only need this for midi changes. callbacks._updateSingleTrackAllCC(trId)
callbacks._updateTrack(trId)
def resetDuationSettingsSignature(trId):
@ -2068,8 +2070,8 @@ def _setTempoBlockData(tempoBlock, newData, newDuration):
#no callbacks needed.
def splitTempoBlock(tempoBlockId, positionInTicksRelativeToBlock):
"""tick position is relative to block start"""
def splitTempoBlock(tempoBlockId, positionInTicksRelativeToBlock:int):
"""tick position is relative to block start"""
success = session.data.tempoTrack.splitTempoBlock(tempoBlockId, positionInTicksRelativeToBlock)
if success:
session.history.clear()
@ -2093,6 +2095,10 @@ def insertTempoItemAtAbsolutePosition(tickPositionAbsolute, unitsPerMinute, refe
positionInTicksRelativeToBlock = tickPositionAbsolute - blockPosition
addTempoItem(blockId, positionInTicksRelativeToBlock, unitsPerMinute, referenceTicks, graphType)
def tempoAtTickPosition(tick):
tempoItem = session.data.tempoTrack.tempoAtTickPosition(tick)
return tempoItem.unitsPerMinute, tempoItem.referenceTicks
def insertTempoChangeDuringDuration(percentageUnitsPerMinuteAsFloat):
"""Instead of a fermata this sets a tempo change which start- and end-point are derived
from the current items duration

2
engine/cursor.py

@ -6,7 +6,7 @@ Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
The Template Base Application is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

20
engine/graphtracks.py

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -141,7 +142,7 @@ class GraphBlock(object):
self.data = {0:GraphItem(0)} #content linked, mutable.
self.name = str(id(self))
self._duration = [D1*4] #len is always 1. Value is always >= D1*4. Duration is content linked, thats why it is a mutable list of len==1.
self._duration = [D1*4] #len is always 1. Duration is content linked, thats why it is a mutable list of len==1.
#self.duration = 0 #triggers the setter. in reality this is set to a standard minimum value in def duration
self.linkedContentBlocks = WeakSet() #only new standalone blocks use this empty WeakSet. once you contentLink a block it will be overwritten.
self._secondInit(parentGraphTrack)
@ -159,8 +160,9 @@ class GraphBlock(object):
@duration.setter
def duration(self, newValue):
"""Keep the mutable list at all cost"""
if newValue > 0 and newValue < D1*4:
newValue = D1*4
if newValue <= 0:
raise ValueError("duration must be > 1")
listId = id(self._duration)
self._duration.pop()
self._duration.append(newValue)
@ -833,10 +835,10 @@ class TempoBlock(GraphBlock):
firstBlockWithNewContentDuringDeserializeToObject = dict() #this is not resetted anywhere since each load is a program start.
#tempoTrack = the only tempo track. set by tempo track init, which happens only once in the program.
def __init__(self, parentGraphTrack):
def __init__(self, parentGraphTrack, defaultQuarterTempo:int= 120):
super().__init__(self)
#self.parentGraphTrack = parentGraphTrack
self.data = {0:TempoItem(120, D4)} #default is quarter = 120 bmp.
self.data = {0:TempoItem(defaultQuarterTempo, D4)} #default is quarter = 120 bmp.
self.name = str(id(self))
self._secondInit(parentGraphTrack)
@ -956,7 +958,7 @@ class TempoTrack(GraphTrackCC):
def splitTempoBlock(self, tempoBlockId, positionInTicksRelativeToBlock):
"""The new block will be right of the original content. If the new block will be empty
or has no real start value the last prevailing tempo will be used
as the blocks start-point"""
as the blocks start-point"""
block = self.tempoBlockById(tempoBlockId)
if not block.duration > positionInTicksRelativeToBlock:
return False

22
engine/main.py

@ -1,12 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2018, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
The Template Base Application is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -47,7 +47,7 @@ class Data(template.engine.sequencer.Score):
#Metadata has only strings as keys, even the numbers.
self.metaData = {key:"" for key in ("title", "subtitle", "dedication","composer","subsubtitle","instrument","meter","arranger", "poet","piece","opus","copyright","tagline", "subtext")}
self.currentMetronomeTrack = self.tracks[0] #A Laborejo Track, indepedent of currentTrack. The metronome is in self.metronome, set by the template Score.
self._processAfterInit()
def _processAfterInit(self):
@ -56,7 +56,8 @@ class Data(template.engine.sequencer.Score):
self.cursorWhenSelectionStarted = None #A cursor dict, from self.cursorExport(). Is None when there is no selection. Can be used for "if selection:" questions. Gets changed quite often.
self.copyObjectsBuffer = [] #for copy and paste. obviously empty after load file. Also not saved.
self.cachedTrackDurations = {} #updated after every track export
self.currentMetronomeTrack = None #A Laborejo Track, indepedent of currentTrack. The metronome is in self.metronome, set by the template Score.
#track.asMetronomeData is a generated value from staticExport. Not available yet. needs to be done in api.startEngine #self.metronome.generate(data=self.currentMetronomeTrack.asMetronomeData, label=self.currentMetronomeTrack.name)
def duration(self):
"""Return the duration of the whole score, in ticks"""
@ -1029,17 +1030,6 @@ class Data(template.engine.sequencer.Score):
#Save / Load / Export
@classmethod
def instanceFromSerializedData(cls, serializedObject, parentObject):
"""This does not call init. We need to construct it
from a blank slate."""
assert cls.__name__ == serializedObject["class"]
self = cls.__new__(cls)
self._secondInit()
return self
def serialize(self)->dict:
dictionary = super().serialize()
dictionary["class"] = self.__class__.__name__
@ -1048,6 +1038,7 @@ class Data(template.engine.sequencer.Score):
dictionary["hiddenTracks"] = [[track.serialize(), originalIndex] for track, originalIndex in self.hiddenTracks.items()]
dictionary["tempoTrack"] = self.tempoTrack.serialize()
dictionary["metaData"] = self.metaData
dictionary["currentMetronomeTrackIndex"] = self.tracks.index(self.currentMetronomeTrack)
return dictionary
@classmethod
@ -1059,6 +1050,7 @@ class Data(template.engine.sequencer.Score):
self.hiddenTracks = {Track.instanceFromSerializedData(track, parentData = self):originalIndex for track, originalIndex in serializedData["hiddenTracks"]}
self.tempoTrack = TempoTrack.instanceFromSerializedData(serializedData["tempoTrack"], parentData = self)
self.metaData = serializedData["metaData"]
self.currentMetronomeTrack = self.tracks[serializedData["currentMetronomeTrackIndex"]]
self._processAfterInit()
return self

2
engine/track.py

@ -6,7 +6,7 @@ Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
The Template Base Application is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

21
qtgui/conductor.py

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -55,9 +56,6 @@ class Conductor(QtWidgets.QGraphicsItem):
self.staffLine.setParentItem(self)
self.staffLine.setPos(0,0)
self.timeLine = TimeLine(self) #registers its own callbacks
self.timeLine.setParentItem(self)
api.callbacks.updateTempoTrackBlocks.append(self.updateBlocks)
api.callbacks.updateTempoTrack.append(self.createGraphicItemsFromData)
api.callbacks.updateTempoTrackMeta.append(self.updateMetaData)
@ -160,14 +158,16 @@ class Conductor(QtWidgets.QGraphicsItem):
def add(self, scenePos):
"""Use a scenePos (from self.mousePressEvent) to instruct the backend
to create a new tempo point."""
unitsPerMinute = 120
referenceTicks = api.D4
to create a new tempo point.
Uses the values from the item left of it
"""
sp = scenePos.x() * constantsAndConfigs.ticksToPixelRatio
if constantsAndConfigs.snapToGrid:
sp = round(sp / constantsAndConfigs.gridRhythm) * constantsAndConfigs.gridRhythm
unitsPerMinute, referenceTicks = api.tempoAtTickPosition(sp)
api.insertTempoItemAtAbsolutePosition(sp, unitsPerMinute, referenceTicks, graphType = "standalone")
class ConductorTransparentBlock(QtWidgets.QGraphicsRectItem):
@ -306,6 +306,7 @@ class ConductorTransparentBlock(QtWidgets.QGraphicsRectItem):
posRelativeToBlockStart = round(posRelativeToBlockStart / constantsAndConfigs.gridRhythm) * constantsAndConfigs.gridRhythm
if posRelativeToBlockStart > 0:
print (self.staticExportItem["id"], posRelativeToBlockStart, posRelativeToBlockStart/api.D1)
api.splitTempoBlock(self.staticExportItem["id"], int(posRelativeToBlockStart))
def contextMenuEvent(self, event):

7
qtgui/constantsAndConfigs.py

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

9
qtgui/cursor.py

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -19,6 +20,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
from PyQt5 import QtCore, QtGui, QtWidgets, QtWidgets
from .constantsAndConfigs import constantsAndConfigs
import engine.api as api

8
qtgui/graphs.py

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -19,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
from PyQt5 import QtCore, QtGui, QtSvg, QtWidgets
from .constantsAndConfigs import constantsAndConfigs
from template.qtgui.helper import stringToColor, removeInstancesFromScene, callContextMenu, stretchLine, stretchRect

8
qtgui/items.py

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -19,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
from PyQt5 import QtCore, QtGui, QtSvg, QtWidgets
from itertools import groupby
from engine.items import Chord, KeySignature

5
qtgui/mainwindow.py

@ -1,12 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2018, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
The Template Base Application is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -19,6 +19,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
#Standard Library Modules

29
qtgui/menu.py

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -559,12 +560,30 @@ class ToolBarPlaybackSpeed(QtWidgets.QDoubleSpinBox):
self.setSingleStep(0.1)
self.setPrefix("Tempo ×") #yes, this is the unicode multiplication sign × and not an x
api.callbacks.tempoScalingChanged.append(self.updateFromCallback)
self.valueChanged.connect(self.changed)
self.valueChanged.connect(self.changed)
self.setLineEdit(ToolBarPlaybackSpeed.CustomLineEdit())
class CustomLineEdit(QtWidgets.QLineEdit):
def mousePressEvent(self, event):
if event.button() == 4:
self.parentWidget().setValue(1.0)
self.parentWidget().changed()
else:
event.ignore()
super().mousePressEvent(event)
def mousePressEvent(self, event):
if event.button() == 4:
self.setValue(1.0)
self.changed()
else:
event.ignore()
super().mousePressEvent(event)
def updateFromCallback(self, newValue):
self.blockSignals(True)
self.setValue(newValue)
self.blockSignals(False)
def changed(self):
def changed(self):
api.changeTempoScaling(self.value())

5
qtgui/scoreview.py

@ -1,12 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2018, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
The Template Base Application is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
#Third Party

9
qtgui/structures.py

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -19,6 +20,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
from math import log
from PyQt5 import QtCore, QtGui, QtWidgets

7
qtgui/submenus.py

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

13
qtgui/timeline.py → qtgui/timeline.py.delete

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -19,6 +20,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
from PyQt5 import QtCore, QtGui, QtSvg, QtWidgets
from .constantsAndConfigs import constantsAndConfigs
from template.qtgui.helper import stringToColor
@ -125,6 +129,7 @@ class TimeLine(QtWidgets.QGraphicsRectItem):
backend.
The tempo value, has its default 0-line on the middle line, which is the track root.
"""
print ("call")
for item in self.items:
item.setParentItem(None)
self.scene().removeWhenIdle(item)
@ -181,6 +186,8 @@ class TimeLine(QtWidgets.QGraphicsRectItem):
#unitsPerMinute, referenceTicks = self.getYAsBackendValue(y)
unitsPerMinute = 120
referenceTicks = api.D4
print ("timeline")
#x
sp = scenePos.x() * constantsAndConfigs.ticksToPixelRatio

9
qtgui/trackEditor.py

@ -1,11 +1,12 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright 2017, Nils Hilbricht, Germany ( https://www.hilbricht.net )
Copyright 2019, Nils Hilbricht, Germany ( https://www.hilbricht.net )
This file is part of Laborejo ( https://www.laborejo.org )
This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
more specifically its template base application.
Laborejo is free software: you can redistribute it and/or modify
Laborejo2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@ -19,6 +20,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging; logging.info("import {}".format(__file__))
from PyQt5 import QtWidgets, QtCore, QtGui
from .designer.trackWidget import Ui_trackGroupWidget
from .constantsAndConfigs import constantsAndConfigs

Loading…
Cancel
Save