@ -53,7 +53,10 @@ class EventLoop(object):
def __init__ ( self ) :
""" The loop for all things GUI and controlling the GUI (e.g. by a control midi in port)
By default use fastConnect .
directConnect is 0 ms ( see below )
fastConnect 20 ms
slowConnect 100 ms
verySlowConnect 200 ms
0 ms means " if there is time " . 10 ms - 20 ms is smooth . 100 ms is still ok .
Influences everything . Control Midi In Latency , playback cursor scrolling smoothnes etc .
@ -69,10 +72,14 @@ class EventLoop(object):
We init the event loop outside of main but call start from the mainWindow .
"""
self . directLoop = QtCore . QTimer ( )
self . fastLoop = QtCore . QTimer ( )
self . slowLoop = QtCore . QTimer ( )
self . verySlowLoop = QtCore . QTimer ( )
def directConnect ( self , function ) :
self . directLoop . timeout . connect ( function )
def fastConnect ( self , function ) :
self . fastLoop . timeout . connect ( function )
@ -97,6 +104,8 @@ class EventLoop(object):
def start ( self ) :
""" The event loop MUST be started after the Qt Application instance creation """
logger . info ( " Starting direct qt event loop " )
self . directLoop . start ( 0 )
logger . info ( " Starting fast qt event loop " )
self . fastLoop . start ( 20 )
logger . info ( " Starting slow qt event loop " )
@ -105,6 +114,8 @@ class EventLoop(object):
self . verySlowLoop . start ( 200 )
def stop ( self ) :
logger . info ( " Stopping direct qt event loop " )
self . directLoop . stop ( )
logger . info ( " Stopping fast qt event loop " )
self . fastLoop . stop ( )
logger . info ( " Stopping slow qt event loop " )
@ -143,9 +154,9 @@ class MainWindow(QtWidgets.QMainWindow):
super ( ) . __init__ ( )
self . qtApp = qtApp
self . qtApp . setWindowIcon ( QtGui . QIcon ( " :icon.png " ) ) #non-template part of the program
QtGui . QIcon . setThemeName ( " hicolor " ) #audio applications can be found here. We have no need for other icons.
QtGui . QIcon . setThemeName ( " hicolor " ) #audio applications can be found here. We have no need for other icons.
logger . info ( " Init MainWindow " )
#Callbacks. Must be registered before startEngine.
api . callbacks . message . append ( self . callback_message )
@ -172,9 +183,9 @@ class MainWindow(QtWidgets.QMainWindow):
self . setWindowTitle ( self . nsmClient . ourClientNameUnderNSM )
self . qtApp . setApplicationName ( self . nsmClient . ourClientNameUnderNSM )
self . qtApp . setApplicationDisplayName ( self . nsmClient . ourClientNameUnderNSM )
self . qtApp . setOrganizationName ( " Laborejo Software Suite " )
self . qtApp . setOrganizationDomain ( " laborejo.org " )
self . qtApp . setApplicationVersion ( METADATA [ " version " ] )
self . qtApp . setOrganizationName ( " Laborejo Software Suite " )
self . qtApp . setOrganizationDomain ( " laborejo.org " )
self . qtApp . setApplicationVersion ( METADATA [ " version " ] )
self . setAcceptDrops ( True )
self . debugScriptRunner = DebugScriptRunner ( apilocals = locals ( ) ) #needs to have trueInit called after the session and nsm was set up. Which happens in startEngine.