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):
fortrackinsession.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()
globallaborejoEngineStarted#makes for a convenient check. stepMidiInput uses it, which needs to know that the gui already started the api.
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)
defduration(self):
"""Return the duration of the whole score, in ticks"""
@ -1029,17 +1030,6 @@ class Data(template.engine.sequencer.Score):