Browse Source

fix playback cursor regression

master
Nils 4 years ago
parent
commit
4fc9fc7bcf
  1. 16
      engine/api.py
  2. 1
      template/engine/api.py

16
engine/api.py

@ -73,8 +73,8 @@ class ClientCallbacks(Callbacks): #inherits from the templates api callbacks
func(export)
callbacks._dataChanged()
def _setPlaybackTicks(self): #Differs from the template because it has subdivisions.
ppqn = cbox.Transport.status().pos_ppqn * session.data.subdivisions
def _setPlaybackTicks(self): #Differs from the template because it has subdivisions and offset
ppqn = cbox.Transport.status().pos_ppqn * session.data.subdivisions - session.data.cachedOffsetInTicks
status = playbackStatus()
for func in self.setPlaybackTicks:
func(ppqn, status)
@ -219,18 +219,6 @@ class ClientCallbacks(Callbacks): #inherits from the templates api callbacks
func(_swingToPercent_Table[export])
callbacks._dataChanged()
#Override template one
def _setPlaybackTicks(self):
"""This gets called very very often (~60 times per second).
Any connected function needs to watch closely
for performance issues"""
ppqn = cbox.Transport.status().pos_ppqn - session.data.cachedOffsetInTicks
status = playbackStatus()
for func in self.setPlaybackTicks:
func(ppqn, status)
self._dataChanged() #includes _historyChanged
#Inject our derived Callbacks into the parent module
template.engine.api.callbacks = ClientCallbacks()
from template.engine.api import callbacks

1
template/engine/api.py

@ -137,7 +137,6 @@ class Callbacks(object):
status = playbackStatus()
for func in self.setPlaybackTicks:
func(ppqn, status)
self._dataChanged() #includes _historyChanged
def _playbackStatusChanged(self):
"""Returns a bool if the playback is running.

Loading…
Cancel
Save