Browse Source

Fix issues in engine stop/start in UI

tags/1.9.5
falkTX 10 years ago
parent
commit
02b838dde5
2 changed files with 25 additions and 31 deletions
  1. +2
    -2
      source/carla
  2. +23
    -29
      source/carla_host.py

+ 2
- 2
source/carla View File

@@ -201,7 +201,7 @@ class CarlaHostW(HostWindow):

def engineChanged(self):
self.fInfoText = "Engine running | SampleRate: %g | BufferSize: %i" % (self.host.get_sample_rate(), self.host.get_buffer_size())
self.fInfoLabel.setText("%s | %s" % (self.fInfoText, self.fTextTransport))
self.fInfoLabel.setText("%s | %s" % (self.fInfoText, self.fTransportText))

def engineStarted(self):
self.engineChanged()
@@ -288,7 +288,7 @@ class CarlaHostW(HostWindow):
HostWindow.timerEvent(self, event)

if event.timerId() == self.fIdleTimerFast:
self.fInfoLabel.setText("%s | %s" % (self.fInfoText, self.fTextTransport))
self.fInfoLabel.setText("%s | %s" % (self.fInfoText, self.fTransportText))

# ------------------------------------------------------------------------------------------------------------
# Main


+ 23
- 29
source/carla_host.py View File

@@ -549,27 +549,24 @@ class HostWindow(QMainWindow):
def slot_handleEngineStartedCallback(self, processMode, transportMode, driverName):
self.fSampleRate = self.host.get_sample_rate()

check = self.host.is_engine_running()
self.ui.menu_PluginMacros.setEnabled(check)
self.ui.menu_Canvas.setEnabled(check)
self.ui.menu_PluginMacros.setEnabled(True)
self.ui.menu_Canvas.setEnabled(True)

if not self.host.isPlugin:
self.ui.act_engine_start.setEnabled(not check)
self.ui.act_engine_stop.setEnabled(check)
self.ui.act_engine_start.setEnabled(False)
self.ui.act_engine_stop.setEnabled(True)

if not self.fSessionManagerName:
self.ui.act_file_open.setEnabled(check)
self.ui.act_file_save.setEnabled(check)
self.ui.act_file_save_as.setEnabled(check)

self.setTransportMenuEnabled(check)
self.ui.act_file_open.setEnabled(True)
self.ui.act_file_save.setEnabled(True)
self.ui.act_file_save_as.setEnabled(True)

if check:
self.fLastTransportFrame = 0
self.fLastTransportState = False
self.refreshTransport(True)
self.fContainer.engineStarted()
self.setTransportMenuEnabled(True)

self.fLastTransportFrame = 0
self.fLastTransportState = False
self.refreshTransport(True)
self.fContainer.engineStarted()
self.startTimers()

@pyqtSlot()
@@ -580,26 +577,23 @@ class HostWindow(QMainWindow):
self.ui.act_plugin_remove_all.setEnabled(False)
self.fContainer.removeAllPlugins()

check = self.host.is_engine_running()
self.ui.menu_PluginMacros.setEnabled(check)
self.ui.menu_Canvas.setEnabled(check)
self.ui.menu_PluginMacros.setEnabled(False)
self.ui.menu_Canvas.setEnabled(False)

if not self.host.isPlugin:
self.ui.act_engine_start.setEnabled(not check)
self.ui.act_engine_stop.setEnabled(check)
self.ui.act_engine_start.setEnabled(True)
self.ui.act_engine_stop.setEnabled(False)

if not self.fSessionManagerName:
self.ui.act_file_open.setEnabled(check)
self.ui.act_file_save.setEnabled(check)
self.ui.act_file_save_as.setEnabled(check)
self.ui.act_file_open.setEnabled(False)
self.ui.act_file_save.setEnabled(False)
self.ui.act_file_save_as.setEnabled(False)

self.setTransportMenuEnabled(check)

if not check:
self.fTextTransport = ""
self.fContainer.engineStopped()
self.setTransportMenuEnabled(False)

self.fSampleRate = 0.0
self.fTransportText = ""
self.fContainer.engineStopped()

@pyqtSlot(float)
def slot_handleSampleRateChangedCallback(self, newSampleRate):
@@ -776,7 +770,7 @@ class HostWindow(QMainWindow):
mins = (time / 60) % 60
hrs = (time / 3600) % 60

self.fTextTransport = "Transport %s, at %02i:%02i:%02i" % ("playing" if playing else "stopped", hrs, mins, secs)
self.fTransportText = "Transport %s, at %02i:%02i:%02i" % ("playing" if playing else "stopped", hrs, mins, secs)
self.fLastTransportFrame = frame

def setTransportMenuEnabled(self, enabled):


Loading…
Cancel
Save