data=cbox.JackIO.jack_transport_position()#this includes a lot of everchanging data. If no jack-master client set /bar and the others they will simply not be in the list
t=(data.beats_per_bar,data.ticks_per_beat)
ifnotself._rememberBBT==t:#new situation, but not just frame position update
data=cbox.JackIO.jack_transport_position()#this includes a lot of everchanging data. If no jack-master client set /bar and the others they will simply not be in the list
t=(data.beats_per_bar,data.ticks_per_beat)
ifnotself._rememberBBT==t:#new situation, but not just frame position update
self._rememberBBT=t
export={}
ifdata.beats_per_bar:
offset=(data.beat-1)*data.ticks_per_beat+data.tick#if timing is good this is the same as data.tick because beat is 1.
export["denominator"]=jackBBTicksToDuration(data.beat_type,data.ticks_per_beat,data.ticks_per_beat)#the middle one is the changing one we are interested in
#export["tickposition"] = cbox.Transport.status().pos_ppqn #this is a different position than our current one because it takes a few cycles and ticks to calculate
#export["tickposition"] = cbox.Transport.status().pos_ppqn #this is a different position than our current one because it takes a few cycles and ticks to calculate
self.nsmClient=None#We get it from api.startEngine which gets it from the GUI. nsmClient.reactToMessage is added to the global event loop there.
self.history=History()#Undo and Redo. Works through the api but is saved in the session. Not saved in the save file.
self.guiSharedDataToSave={}#the gui can write its values here directly to get them saved and restored on startup. We opt not to use the Qt config save to keep everything in one file.
self.recordingEnabled=False#MidiInput callbacks can use this to prevent/allow data creation. Handled via api callback. Not saved.
self.eventLoop=None# added in api.startEngine
self.recordingEnabled=False#MidiInput callbacks can use this to prevent/allow data creation. Handled via api callback. Saved.
self.eventLoop=None# added in api.startEngine
self.data=None#nsm_openOrNewCallback
defaddSessionPrefix(self,jsonDataAsString:str):
"""During load the current session prefix gets added. Turning pseudo-relative paths into
@ -100,7 +100,7 @@ class Session(object):
atexit.register(self.stopSession)#this will handle all python exceptions, but not segfaults of C modules.
cbox.do_cmd("/master/set_ppqn_factor",None,[D4])#quarter note has how many ticks? needs to be in a list.
self.sessionPrefix=ourPath#if we want to save and load resources they need to be in the session dir. We never load from outside, the scheme is always "import first, load local file"