Browse Source

Misc

tags/1.9.4
falkTX 11 years ago
parent
commit
a1f6cb08d2
7 changed files with 144 additions and 114 deletions
  1. +2
    -2
      source/carla
  2. +99
    -65
      source/carla_host.py
  3. +1
    -1
      source/carla_patchbay.py
  4. +29
    -33
      source/carla_rack.py
  5. +6
    -6
      source/carla_shared.py
  6. +3
    -3
      source/carla_widgets.py
  7. +4
    -4
      source/widgets/canvaspreviewframe.py

+ 2
- 2
source/carla View File

@@ -76,7 +76,7 @@ class CarlaMultiW(QTabWidget):
parent.MidiProgramChangedCallback.connect(self.fRack.slot_handleMidiProgramChangedCallback) parent.MidiProgramChangedCallback.connect(self.fRack.slot_handleMidiProgramChangedCallback)
parent.NoteOnCallback.connect(self.fRack.slot_handleNoteOnCallback) parent.NoteOnCallback.connect(self.fRack.slot_handleNoteOnCallback)
parent.NoteOffCallback.connect(self.fRack.slot_handleNoteOffCallback) parent.NoteOffCallback.connect(self.fRack.slot_handleNoteOffCallback)
parent.ShowGuiCallback.connect(self.fRack.slot_handleShowGuiCallback)
parent.UiStateChangedCallback.connect(self.fRack.slot_handleUiStateChangedCallback)
parent.UpdateCallback.connect(self.fRack.slot_handleUpdateCallback) parent.UpdateCallback.connect(self.fRack.slot_handleUpdateCallback)
parent.ReloadInfoCallback.connect(self.fRack.slot_handleReloadInfoCallback) parent.ReloadInfoCallback.connect(self.fRack.slot_handleReloadInfoCallback)
parent.ReloadParametersCallback.connect(self.fRack.slot_handleReloadParametersCallback) parent.ReloadParametersCallback.connect(self.fRack.slot_handleReloadParametersCallback)
@@ -90,7 +90,7 @@ class CarlaMultiW(QTabWidget):
parent.PatchbayPortRenamedCallback.connect(self.fPatchbay.slot_handlePatchbayPortRenamedCallback) parent.PatchbayPortRenamedCallback.connect(self.fPatchbay.slot_handlePatchbayPortRenamedCallback)
parent.PatchbayConnectionAddedCallback.connect(self.fPatchbay.slot_handlePatchbayConnectionAddedCallback) parent.PatchbayConnectionAddedCallback.connect(self.fPatchbay.slot_handlePatchbayConnectionAddedCallback)
parent.PatchbayConnectionRemovedCallback.connect(self.fPatchbay.slot_handlePatchbayConnectionRemovedCallback) parent.PatchbayConnectionRemovedCallback.connect(self.fPatchbay.slot_handlePatchbayConnectionRemovedCallback)
parent.PatchbayIconChangedCallback.connect(self.fPatchbay.slot_handlePatchbayIconChangedCallback)
#parent.PatchbayIconChangedCallback.connect(self.fPatchbay.slot_handlePatchbayIconChangedCallback)


# ----------------------------------------------------------------- # -----------------------------------------------------------------




+ 99
- 65
source/carla_host.py View File

@@ -149,16 +149,13 @@ class HostWindow(QMainWindow):
self.fContainer = CarlaDummyW(self) self.fContainer = CarlaDummyW(self)


# ------------------------------------------------------------- # -------------------------------------------------------------
# Set callback
# Set callback, TODO put somewhere else


Carla.host.set_engine_callback(EngineCallback)
Carla.host.set_engine_callback(engineCallback)


# ------------------------------------------------------------- # -------------------------------------------------------------
# Internal stuff # Internal stuff


self.fBufferSize = 0
self.fSampleRate = 0.0

self.fIdleTimerFast = 0 self.fIdleTimerFast = 0
self.fIdleTimerSlow = 0 self.fIdleTimerSlow = 0


@@ -172,6 +169,9 @@ class HostWindow(QMainWindow):
self.fLastTransportState = False self.fLastTransportState = False
self.fTransportText = "" self.fTransportText = ""


# when true, call engineChanged() asap
self.fEngineChanged = False

self.fSavedSettings = {} self.fSavedSettings = {}


if LADISH_APP_NAME: if LADISH_APP_NAME:
@@ -258,13 +258,16 @@ class HostWindow(QMainWindow):
self.PluginAddedCallback.connect(self.slot_handlePluginAddedCallback) self.PluginAddedCallback.connect(self.slot_handlePluginAddedCallback)
self.PluginRemovedCallback.connect(self.slot_handlePluginRemovedCallback) self.PluginRemovedCallback.connect(self.slot_handlePluginRemovedCallback)
self.PluginRenamedCallback.connect(self.slot_handlePluginRenamedCallback) self.PluginRenamedCallback.connect(self.slot_handlePluginRenamedCallback)

self.EngineStartedCallback.connect(self.slot_handleEngineStartedCallback)
self.EngineStoppedCallback.connect(self.slot_handleEngineStoppedCallback)

self.ProcessModeChangedCallback.connect(self.slot_handleProcessModeChangedCallback)
self.TransportModeChangedCallback.connect(self.slot_handleTransportModeChangedCallback)
self.BufferSizeChangedCallback.connect(self.slot_handleBufferSizeChangedCallback) self.BufferSizeChangedCallback.connect(self.slot_handleBufferSizeChangedCallback)
self.SampleRateChangedCallback.connect(self.slot_handleSampleRateChangedCallback) self.SampleRateChangedCallback.connect(self.slot_handleSampleRateChangedCallback)
self.EngineStartedCallback.connect(self.slot_handleEngineStartedCallback)
self.EngineStoppedChangedCallback.connect(self.slot_handleEngineStoppedCallback)
#self.NSM_AnnounceCallback.connect(self.slot_handleNSM_AnnounceCallback)
#self.NSM_OpenCallback.connect(self.slot_handleNSM_OpenCallback)
#self.NSM_SaveCallback.connect(self.slot_handleNSM_SaveCallback)

#self.InfoCallback.connect(self.slot_handleInfoCallback)
#self.ErrorCallback.connect(self.slot_handleErrorCallback) #self.ErrorCallback.connect(self.slot_handleErrorCallback)
#self.QuitCallback.connect(self.slot_handleQuitCallback) #self.QuitCallback.connect(self.slot_handleQuitCallback)


@@ -276,8 +279,6 @@ class HostWindow(QMainWindow):


if Carla.isPlugin: if Carla.isPlugin:
QTimer.singleShot(0, self.slot_engineStart) QTimer.singleShot(0, self.slot_engineStart)
#elif NSM_URL:
#Carla.host.nsm_ready()


# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Called by containers # Called by containers
@@ -397,8 +398,8 @@ class HostWindow(QMainWindow):
QMessageBox.critical(self, self.tr("Error"), self.tr("Could not connect to Audio backend '%s'" % audioDriver)) QMessageBox.critical(self, self.tr("Error"), self.tr("Could not connect to Audio backend '%s'" % audioDriver))
return return


self.fBufferSize = Carla.host.get_buffer_size()
self.fSampleRate = Carla.host.get_sample_rate()
#self.fBufferSize = Carla.host.get_buffer_size()
#self.fSampleRate = Carla.host.get_sample_rate()


#self.fFirstEngineInit = False #self.fFirstEngineInit = False


@@ -421,8 +422,8 @@ class HostWindow(QMainWindow):
if Carla.host.is_engine_running() and not Carla.host.engine_close(): if Carla.host.is_engine_running() and not Carla.host.engine_close():
print(Carla.host.get_last_error()) print(Carla.host.get_last_error())


self.fBufferSize = 0
self.fSampleRate = 0.0
#self.fBufferSize = 0
#self.fSampleRate = 0.0


if self.fIdleTimerFast != 0: if self.fIdleTimerFast != 0:
self.killTimer(self.fIdleTimerFast) self.killTimer(self.fIdleTimerFast)
@@ -898,6 +899,8 @@ class HostWindow(QMainWindow):
print("DEBUG:", pluginId, value1, value2, value3, valueStr) print("DEBUG:", pluginId, value1, value2, value3, valueStr)
#self.ui.pte_log.appendPlainText(valueStr.replace("", "DEBUG: ").replace("", "ERROR: ").replace("", "").replace("\n", "")) #self.ui.pte_log.appendPlainText(valueStr.replace("", "DEBUG: ").replace("", "ERROR: ").replace("", "").replace("\n", ""))


# -----------------------------------------------------------------

@pyqtSlot(int) @pyqtSlot(int)
def slot_handlePluginAddedCallback(self, pluginId): def slot_handlePluginAddedCallback(self, pluginId):
self.fContainer.addPlugin(pluginId, self.fIsProjectLoading) self.fContainer.addPlugin(pluginId, self.fIsProjectLoading)
@@ -916,22 +919,12 @@ class HostWindow(QMainWindow):
def slot_handlePluginRenamedCallback(self, pluginId, newName): def slot_handlePluginRenamedCallback(self, pluginId, newName):
self.fContainer.renamePlugin(pluginId, newName) self.fContainer.renamePlugin(pluginId, newName)


@pyqtSlot(int)
def slot_handleBufferSizeChangedCallback(self, newBufferSize):
self.fBufferSize = newBufferSize
self.fContainer.engineChanged()

@pyqtSlot(float)
def slot_handleSampleRateChangedCallback(self, newSampleRate):
self.fSampleRate = newSampleRate
self.fContainer.engineChanged()

# ----------------------------------------------------------------- # -----------------------------------------------------------------


@pyqtSlot(str) @pyqtSlot(str)
def slot_handleEngineStartedCallback(self, driverName): def slot_handleEngineStartedCallback(self, driverName):
self.fBufferSize = Carla.host.get_buffer_size()
self.fSampleRate = Carla.host.get_sample_rate()
#self.fBufferSize = Carla.host.get_buffer_size()
#self.fSampleRate = Carla.host.get_sample_rate()


if self.fIdleTimerFast == 0: if self.fIdleTimerFast == 0:
self.fIdleTimerFast = self.startTimer(30) #self.fSavedSettings["Main/RefreshInterval"]) self.fIdleTimerFast = self.startTimer(30) #self.fSavedSettings["Main/RefreshInterval"])
@@ -942,8 +935,8 @@ class HostWindow(QMainWindow):


@pyqtSlot() @pyqtSlot()
def slot_handleEngineStoppedCallback(self): def slot_handleEngineStoppedCallback(self):
self.fBufferSize = 0
self.fSampleRate = 0.0
#self.fBufferSize = 0
#self.fSampleRate = 0.0


if self.fIdleTimerFast != 0: if self.fIdleTimerFast != 0:
self.killTimer(self.fIdleTimerFast) self.killTimer(self.fIdleTimerFast)
@@ -961,10 +954,28 @@ class HostWindow(QMainWindow):


# ----------------------------------------------------------------- # -----------------------------------------------------------------


@pyqtSlot(int)
def slot_handleProcessModeChangedCallback(self, newProcessMode):
self.fEngineChanged = True

@pyqtSlot(int)
def slot_handleTransportModeChangedCallback(self, newTransportMode):
self.fEngineChanged = True

@pyqtSlot(int)
def slot_handleBufferSizeChangedCallback(self, newBufferSize):
self.fEngineChanged = True

@pyqtSlot(float)
def slot_handleSampleRateChangedCallback(self, newSampleRate):
self.fEngineChanged = True

# -----------------------------------------------------------------

@pyqtSlot() @pyqtSlot()
def slot_handleSIGUSR1(self): def slot_handleSIGUSR1(self):
print("Got SIGUSR1 -> Saving project now") print("Got SIGUSR1 -> Saving project now")
#QTimer.singleShot(0, self, SLOT("slot_fileSave)
QTimer.singleShot(0, self.slot_fileSave)


@pyqtSlot() @pyqtSlot()
def slot_handleSIGTERM(self): def slot_handleSIGTERM(self):
@@ -982,6 +993,10 @@ class HostWindow(QMainWindow):
self.fContainer.idleFast() self.fContainer.idleFast()


elif event.timerId() == self.fIdleTimerSlow: elif event.timerId() == self.fIdleTimerSlow:
if self.fEngineChanged:
self.fContainer.engineChanged()
self.fEngineChanged = False

self.fContainer.idleSlow() self.fContainer.idleSlow()


QMainWindow.timerEvent(self, event) QMainWindow.timerEvent(self, event)
@@ -1008,36 +1023,65 @@ class HostWindow(QMainWindow):
# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Engine callback # Engine callback


def EngineCallback(ptr, action, pluginId, value1, value2, value3, valueStr):
if pluginId < 0 or not Carla.gui:
def engineCallback(ptr, action, pluginId, value1, value2, value3, valueStr):
if action == ENGINE_CALLBACK_PROCESS_MODE_CHANGED:
Carla.processMode = value1
if Carla.gui is not None:
Carla.gui.ProcessModeChangedCallback.emit(value1)
return return


if action == ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED:
Carla.transportMode = value1
if Carla.gui is not None:
Carla.gui.TransportModeChangedCallback.emit(value1)
return

if action == ENGINE_CALLBACK_BUFFER_SIZE_CHANGED:
Carla.bufferSize = value1
if Carla.gui is not None:
Carla.gui.BufferSizeChangedCallback.emit(value1)
return

if action == ENGINE_CALLBACK_SAMPLE_RATE_CHANGED:
Carla.sampleRate = value1
if Carla.gui is not None:
Carla.gui.SampleRateChangedCallback.emit(value3)
return

if Carla.gui is None:
print("WARNING: Got engine callback but UI is not ready : ", pluginId, value1, value2, value3, valueStr)
return

valueStr = charPtrToString(valueStr)

if action == ENGINE_CALLBACK_DEBUG: if action == ENGINE_CALLBACK_DEBUG:
Carla.gui.DebugCallback.emit(pluginId, value1, value2, value3, charPtrToString(valueStr))
Carla.gui.DebugCallback.emit(pluginId, value1, value2, value3, valueStr)
elif action == ENGINE_CALLBACK_PLUGIN_ADDED: elif action == ENGINE_CALLBACK_PLUGIN_ADDED:
Carla.gui.PluginAddedCallback.emit(pluginId)
Carla.gui.PluginAddedCallback.emit(pluginId, valueStr)
elif action == ENGINE_CALLBACK_PLUGIN_REMOVED: elif action == ENGINE_CALLBACK_PLUGIN_REMOVED:
Carla.gui.PluginRemovedCallback.emit(pluginId) Carla.gui.PluginRemovedCallback.emit(pluginId)
elif action == ENGINE_CALLBACK_PLUGIN_RENAMED: elif action == ENGINE_CALLBACK_PLUGIN_RENAMED:
Carla.gui.PluginRenamedCallback.emit(pluginId, valueStr) Carla.gui.PluginRenamedCallback.emit(pluginId, valueStr)
elif action == ENGINE_CALLBACK_PLUGIN_UNAVAILABLE:
Carla.gui.PluginUnavailableCallback.emit(pluginId, valueStr)
elif action == ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED: elif action == ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED:
Carla.gui.ParameterValueChangedCallback.emit(pluginId, value1, value3) Carla.gui.ParameterValueChangedCallback.emit(pluginId, value1, value3)
elif action == ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED: elif action == ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED:
Carla.gui.ParameterDefaultChangedCallback.emit(pluginId, value1, value3) Carla.gui.ParameterDefaultChangedCallback.emit(pluginId, value1, value3)
elif action == ENGINE_CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED:
Carla.gui.ParameterMidiChannelChangedCallback.emit(pluginId, value1, value2)
elif action == ENGINE_CALLBACK_PARAMETER_MIDI_CC_CHANGED: elif action == ENGINE_CALLBACK_PARAMETER_MIDI_CC_CHANGED:
Carla.gui.ParameterMidiCcChangedCallback.emit(pluginId, value1, value2) Carla.gui.ParameterMidiCcChangedCallback.emit(pluginId, value1, value2)
elif action == ENGINE_CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED:
Carla.gui.ParameterMidiChannelChangedCallback.emit(pluginId, value1, value2)
elif action == ENGINE_CALLBACK_PROGRAM_CHANGED: elif action == ENGINE_CALLBACK_PROGRAM_CHANGED:
Carla.gui.ProgramChangedCallback.emit(pluginId, value1) Carla.gui.ProgramChangedCallback.emit(pluginId, value1)
elif action == ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED: elif action == ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED:
Carla.gui.MidiProgramChangedCallback.emit(pluginId, value1) Carla.gui.MidiProgramChangedCallback.emit(pluginId, value1)
elif action == ENGINE_CALLBACK_UI_STATE_CHANGED:
Carla.gui.UiStateChangedCallback.emit(pluginId, value1)
elif action == ENGINE_CALLBACK_NOTE_ON: elif action == ENGINE_CALLBACK_NOTE_ON:
Carla.gui.NoteOnCallback.emit(pluginId, value1, value2, value3)
Carla.gui.NoteOnCallback.emit(pluginId, value1, value2, int(value3))
elif action == ENGINE_CALLBACK_NOTE_OFF: elif action == ENGINE_CALLBACK_NOTE_OFF:
Carla.gui.NoteOffCallback.emit(pluginId, value1, value2) Carla.gui.NoteOffCallback.emit(pluginId, value1, value2)
elif action == ENGINE_CALLBACK_UI_STATE_CHANGED:
Carla.gui.ShowGuiCallback.emit(pluginId, value1)
elif action == ENGINE_CALLBACK_UPDATE: elif action == ENGINE_CALLBACK_UPDATE:
Carla.gui.UpdateCallback.emit(pluginId) Carla.gui.UpdateCallback.emit(pluginId)
elif action == ENGINE_CALLBACK_RELOAD_INFO: elif action == ENGINE_CALLBACK_RELOAD_INFO:
@@ -1049,40 +1093,30 @@ def EngineCallback(ptr, action, pluginId, value1, value2, value3, valueStr):
elif action == ENGINE_CALLBACK_RELOAD_ALL: elif action == ENGINE_CALLBACK_RELOAD_ALL:
Carla.gui.ReloadAllCallback.emit(pluginId) Carla.gui.ReloadAllCallback.emit(pluginId)
elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED: elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED:
Carla.gui.PatchbayClientAddedCallback.emit(value1, charPtrToString(valueStr))
Carla.gui.PatchbayClientAddedCallback.emit(pluginId, valueStr)
elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED: elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED:
Carla.gui.PatchbayClientRemovedCallback.emit(value1, charPtrToString(valueStr))
Carla.gui.PatchbayClientRemovedCallback.emit(pluginId)
elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED: elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED:
Carla.gui.PatchbayClientRenamedCallback.emit(value1, charPtrToString(valueStr))
Carla.gui.PatchbayClientRenamedCallback.emit(pluginId, valueStr)
elif action == ENGINE_CALLBACK_PATCHBAY_CLIENT_ICON_CHANGED:
Carla.gui.PatchbayClientIconChangedCallback.emit(value1, valueStr)
elif action == ENGINE_CALLBACK_PATCHBAY_PORT_ADDED: elif action == ENGINE_CALLBACK_PATCHBAY_PORT_ADDED:
Carla.gui.PatchbayPortAddedCallback.emit(value1, value2, int(value3), charPtrToString(valueStr))
Carla.gui.PatchbayPortAddedCallback.emit(pluginId, value1, value2, valueStr)
elif action == ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED: elif action == ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED:
Carla.gui.PatchbayPortRemovedCallback.emit(value1, value2, charPtrToString(valueStr))
Carla.gui.PatchbayPortRemovedCallback.emit(pluginId, value1)
elif action == ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED: elif action == ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED:
Carla.gui.PatchbayPortRenamedCallback.emit(value1, value2, charPtrToString(valueStr))
Carla.gui.PatchbayPortRenamedCallback.emit(pluginId, value1, valueStr)
elif action == ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED: elif action == ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED:
Carla.gui.PatchbayConnectionAddedCallback.emit(value1, value2, value3)
Carla.gui.PatchbayConnectionAddedCallback.emit(pluginId, value1, value2)
elif action == ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED: elif action == ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED:
Carla.gui.PatchbayConnectionRemovedCallback.emit(value1)
#elif action == ENGINE_CALLBACK_PATCHBAY_ICON_CHANGED:
#Carla.gui.PatchbayIconChangedCallback.emit(value1, charPtrToString(valueStr))
elif action == ENGINE_CALLBACK_BUFFER_SIZE_CHANGED:
Carla.gui.BufferSizeChangedCallback.emit(value1)
elif action == ENGINE_CALLBACK_SAMPLE_RATE_CHANGED:
Carla.gui.SampleRateChangedCallback.emit(value3)
elif action == ENGINE_CALLBACK_PROCESS_MODE_CHANGED:
Carla.gui.ProcessModeChangedCallback.emit(value1)
Carla.gui.PatchbayConnectionRemovedCallback.emit(pluginId, value1, value2)
elif action == ENGINE_CALLBACK_ENGINE_STARTED: elif action == ENGINE_CALLBACK_ENGINE_STARTED:
Carla.gui.EngineStartedCallback.emit(charPtrToString(valueStr))
Carla.gui.EngineStartedCallback.emit(value1, value2, valueStr)
elif action == ENGINE_CALLBACK_ENGINE_STOPPED: elif action == ENGINE_CALLBACK_ENGINE_STOPPED:
Carla.gui.EngineStoppedChangedCallback.emit()
#elif action == CALLBACK_NSM_ANNOUNCE:
#Carla.gui.NSM_AnnounceCallback.emit(charPtrToString(valueStr))
#elif action == CALLBACK_NSM_OPEN:
#Carla.gui.NSM_OpenCallback.emit(charPtrToString(valueStr))
#elif action == CALLBACK_NSM_SAVE:
#Carla.gui.NSM_SaveCallback.emit()
Carla.gui.EngineStoppedCallback.emit()
elif action == ENGINE_CALLBACK_INFO:
Carla.gui.InfoCallback.emit(valueStr)
elif action == ENGINE_CALLBACK_ERROR: elif action == ENGINE_CALLBACK_ERROR:
Carla.gui.ErrorCallback.emit(charPtrToString(valueStr))
Carla.gui.ErrorCallback.emit(valueStr)
elif action == ENGINE_CALLBACK_QUIT: elif action == ENGINE_CALLBACK_QUIT:
Carla.gui.QuitCallback.emit() Carla.gui.QuitCallback.emit()

+ 1
- 1
source/carla_patchbay.py View File

@@ -157,7 +157,7 @@ class CarlaPatchbayW(QGraphicsView):
parent.PatchbayPortRenamedCallback.connect(self.slot_handlePatchbayPortRenamedCallback) parent.PatchbayPortRenamedCallback.connect(self.slot_handlePatchbayPortRenamedCallback)
parent.PatchbayConnectionAddedCallback.connect(self.slot_handlePatchbayConnectionAddedCallback) parent.PatchbayConnectionAddedCallback.connect(self.slot_handlePatchbayConnectionAddedCallback)
parent.PatchbayConnectionRemovedCallback.connect(self.slot_handlePatchbayConnectionRemovedCallback) parent.PatchbayConnectionRemovedCallback.connect(self.slot_handlePatchbayConnectionRemovedCallback)
parent.PatchbayIconChangedCallback.connect(self.slot_handlePatchbayIconChangedCallback)
#parent.PatchbayIconChangedCallback.connect(self.slot_handlePatchbayIconChangedCallback)


# ----------------------------------------------------------------- # -----------------------------------------------------------------




+ 29
- 33
source/carla_rack.py View File

@@ -19,10 +19,6 @@
# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Imports (Global) # Imports (Global)


#try:
#from PyQt5.QtCore import QSize, QTimer
#from PyQt5.QtWidgets import QApplication, QListWidget, QListWidgetItem
#except:
from PyQt4.QtCore import QSize, QTimer from PyQt4.QtCore import QSize, QTimer
from PyQt4.QtGui import QApplication, QListWidget, QListWidgetItem from PyQt4.QtGui import QApplication, QListWidget, QListWidgetItem


@@ -35,16 +31,16 @@ from carla_widgets import *
# Rack widget item # Rack widget item


class CarlaRackItem(QListWidgetItem): class CarlaRackItem(QListWidgetItem):
RackItemType = QListWidgetItem.UserType + 1
StaticHeight = 32
kRackItemType = QListWidgetItem.UserType + 1
kStaticHeight = 32


def __init__(self, parent, pluginId): def __init__(self, parent, pluginId):
QListWidgetItem.__init__(self, parent, self.RackItemType)
QListWidgetItem.__init__(self, parent, self.kRackItemType)


self.fWidget = PluginWidget(parent, pluginId) self.fWidget = PluginWidget(parent, pluginId)
self.fWidget.setFixedHeight(self.StaticHeight)
self.fWidget.setFixedHeight(self.kStaticHeight)


self.setSizeHint(QSize(300, self.StaticHeight))
self.setSizeHint(QSize(300, self.kStaticHeight))


parent.setItemWidget(self, self.fWidget) parent.setItemWidget(self, self.fWidget)


@@ -117,9 +113,9 @@ class CarlaRackW(QListWidget):
parent.ParameterMidiCcChangedCallback.connect(self.slot_handleParameterMidiCcChangedCallback) parent.ParameterMidiCcChangedCallback.connect(self.slot_handleParameterMidiCcChangedCallback)
parent.ProgramChangedCallback.connect(self.slot_handleProgramChangedCallback) parent.ProgramChangedCallback.connect(self.slot_handleProgramChangedCallback)
parent.MidiProgramChangedCallback.connect(self.slot_handleMidiProgramChangedCallback) parent.MidiProgramChangedCallback.connect(self.slot_handleMidiProgramChangedCallback)
parent.UiStateChangedCallback.connect(self.slot_handleUiStateChangedCallback)
parent.NoteOnCallback.connect(self.slot_handleNoteOnCallback) parent.NoteOnCallback.connect(self.slot_handleNoteOnCallback)
parent.NoteOffCallback.connect(self.slot_handleNoteOffCallback) parent.NoteOffCallback.connect(self.slot_handleNoteOffCallback)
parent.ShowGuiCallback.connect(self.slot_handleShowGuiCallback)
parent.UpdateCallback.connect(self.slot_handleUpdateCallback) parent.UpdateCallback.connect(self.slot_handleUpdateCallback)
parent.ReloadInfoCallback.connect(self.slot_handleReloadInfoCallback) parent.ReloadInfoCallback.connect(self.slot_handleReloadInfoCallback)
parent.ReloadParametersCallback.connect(self.slot_handleReloadParametersCallback) parent.ReloadParametersCallback.connect(self.slot_handleReloadParametersCallback)
@@ -361,7 +357,7 @@ class CarlaRackW(QListWidget):
pitem.fWidget.setParameterDefault(index, value) pitem.fWidget.setParameterDefault(index, value)


@pyqtSlot(int, int, int) @pyqtSlot(int, int, int)
def slot_handleParameterMidiChannelChangedCallback(self, pluginId, index, channel):
def slot_handleParameterMidiCcChangedCallback(self, pluginId, index, cc):
if pluginId >= self.fPluginCount: if pluginId >= self.fPluginCount:
return return


@@ -369,10 +365,10 @@ class CarlaRackW(QListWidget):
if pitem is None: if pitem is None:
return return


pitem.fWidget.setParameterMidiChannel(index, channel)
pitem.fWidget.setParameterMidiControl(index, cc)


@pyqtSlot(int, int, int) @pyqtSlot(int, int, int)
def slot_handleParameterMidiCcChangedCallback(self, pluginId, index, cc):
def slot_handleParameterMidiChannelChangedCallback(self, pluginId, index, channel):
if pluginId >= self.fPluginCount: if pluginId >= self.fPluginCount:
return return


@@ -380,7 +376,7 @@ class CarlaRackW(QListWidget):
if pitem is None: if pitem is None:
return return


pitem.fWidget.setParameterMidiControl(index, cc)
pitem.fWidget.setParameterMidiChannel(index, channel)


# ----------------------------------------------------------------- # -----------------------------------------------------------------


@@ -408,8 +404,8 @@ class CarlaRackW(QListWidget):


# ----------------------------------------------------------------- # -----------------------------------------------------------------


@pyqtSlot(int, int, int, int)
def slot_handleNoteOnCallback(self, pluginId, channel, note, velo):
@pyqtSlot(int, int)
def slot_handleUiStateChangedCallback(self, pluginId, state):
if pluginId >= self.fPluginCount: if pluginId >= self.fPluginCount:
return return


@@ -417,10 +413,20 @@ class CarlaRackW(QListWidget):
if pitem is None: if pitem is None:
return return


pitem.fWidget.sendNoteOn(channel, note)
if state == 0:
pitem.fWidget.ui.b_gui.setChecked(False)
pitem.fWidget.ui.b_gui.setEnabled(True)
elif state == 1:
pitem.fWidget.ui.b_gui.setChecked(True)
pitem.fWidget.ui.b_gui.setEnabled(True)
elif state == -1:
pitem.fWidget.ui.b_gui.setChecked(False)
pitem.fWidget.ui.b_gui.setEnabled(False)


@pyqtSlot(int, int, int)
def slot_handleNoteOffCallback(self, pluginId, channel, note):
# -----------------------------------------------------------------

@pyqtSlot(int, int, int, int)
def slot_handleNoteOnCallback(self, pluginId, channel, note, velo):
if pluginId >= self.fPluginCount: if pluginId >= self.fPluginCount:
return return


@@ -428,12 +434,10 @@ class CarlaRackW(QListWidget):
if pitem is None: if pitem is None:
return return


pitem.fWidget.sendNoteOff(channel, note)

# -----------------------------------------------------------------
pitem.fWidget.sendNoteOn(channel, note)


@pyqtSlot(int, int)
def slot_handleShowGuiCallback(self, pluginId, state):
@pyqtSlot(int, int, int)
def slot_handleNoteOffCallback(self, pluginId, channel, note):
if pluginId >= self.fPluginCount: if pluginId >= self.fPluginCount:
return return


@@ -441,15 +445,7 @@ class CarlaRackW(QListWidget):
if pitem is None: if pitem is None:
return return


if state == 0:
pitem.fWidget.ui.b_gui.setChecked(False)
pitem.fWidget.ui.b_gui.setEnabled(True)
elif state == 1:
pitem.fWidget.ui.b_gui.setChecked(True)
pitem.fWidget.ui.b_gui.setEnabled(True)
elif state == -1:
pitem.fWidget.ui.b_gui.setChecked(False)
pitem.fWidget.ui.b_gui.setEnabled(False)
pitem.fWidget.sendNoteOff(channel, note)


# ----------------------------------------------------------------- # -----------------------------------------------------------------




+ 6
- 6
source/carla_shared.py View File

@@ -22,11 +22,6 @@
import os import os
import sys import sys


#try:
#from PyQt5.QtCore import qFatal, qWarning
#from PyQt5.QtGui import QIcon
#from PyQt5.QtWidgets import QFileDialog, QMessageBox
#except:
from PyQt4.QtCore import qFatal, qWarning from PyQt4.QtCore import qFatal, qWarning
from PyQt4.QtGui import QIcon from PyQt4.QtGui import QIcon
from PyQt4.QtGui import QFileDialog, QMessageBox from PyQt4.QtGui import QFileDialog, QMessageBox
@@ -352,6 +347,10 @@ class CarlaObject(object):
'isLocal', 'isLocal',
# bool, is plugin # bool, is plugin
'isPlugin', 'isPlugin',
# current buffer size
'bufferSize',
# current sample rate
'sampleRate',
# current process mode # current process mode
'processMode', 'processMode',
# current transport mode # current transport mode
@@ -382,10 +381,11 @@ Carla.gui = None
Carla.isControl = False Carla.isControl = False
Carla.isLocal = True Carla.isLocal = True
Carla.isPlugin = False Carla.isPlugin = False
Carla.bufferSize = 0
Carla.sampleRate = 0.0
Carla.processMode = ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS if LINUX else ENGINE_PROCESS_MODE_CONTINUOUS_RACK Carla.processMode = ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS if LINUX else ENGINE_PROCESS_MODE_CONTINUOUS_RACK
Carla.transportMode = ENGINE_TRANSPORT_MODE_JACK if LINUX else ENGINE_TRANSPORT_MODE_INTERNAL Carla.transportMode = ENGINE_TRANSPORT_MODE_JACK if LINUX else ENGINE_TRANSPORT_MODE_INTERNAL
Carla.maxParameters = MAX_DEFAULT_PARAMETERS Carla.maxParameters = MAX_DEFAULT_PARAMETERS

Carla.discovery_native = "" Carla.discovery_native = ""
Carla.discovery_posix32 = "" Carla.discovery_posix32 = ""
Carla.discovery_posix64 = "" Carla.discovery_posix64 = ""


+ 3
- 3
source/carla_widgets.py View File

@@ -349,7 +349,7 @@ class PluginParameter(QWidget):
# Plugin Editor (Built-in) # Plugin Editor (Built-in)


class PluginEdit(QDialog): class PluginEdit(QDialog):
ParamsPerPage = 8
kParamsPerPage = 8


def __init__(self, parent, pluginId): def __init__(self, parent, pluginId):
QDialog.__init__(self, Carla.gui) QDialog.__init__(self, Carla.gui)
@@ -702,7 +702,7 @@ class PluginEdit(QDialog):


paramInputList.append(parameter) paramInputList.append(parameter)


if len(paramInputList) == self.ParamsPerPage:
if len(paramInputList) == self.kParamsPerPage:
paramInputListFull.append((paramInputList, paramInputWidth)) paramInputListFull.append((paramInputList, paramInputWidth))
paramInputList = [] paramInputList = []
paramInputWidth = 0 paramInputWidth = 0
@@ -715,7 +715,7 @@ class PluginEdit(QDialog):


paramOutputList.append(parameter) paramOutputList.append(parameter)


if len(paramOutputList) == self.ParamsPerPage:
if len(paramOutputList) == self.kParamsPerPage:
paramOutputListFull.append((paramOutputList, paramOutputWidth)) paramOutputListFull.append((paramOutputList, paramOutputWidth))
paramOutputList = [] paramOutputList = []
paramOutputWidth = 0 paramOutputWidth = 0


+ 4
- 4
source/widgets/canvaspreviewframe.py View File

@@ -101,8 +101,8 @@ class CanvasPreviewFrame(QFrame):
def setViewScale(self, scale): def setViewScale(self, scale):
self.fScale = scale self.fScale = scale


if self.fRealParent is not None:
QTimer.singleShot(0, self.fRealParent.slot_miniCanvasCheckAll)
#if self.fRealParent is not None:
#QTimer.singleShot(0, self.fRealParent.slot_miniCanvasCheckAll)


def setViewSize(self, width, height): def setViewSize(self, width, height):
self.fViewRect[iWidth] = width * self.fFakeWidth self.fViewRect[iWidth] = width * self.fFakeWidth
@@ -205,7 +205,7 @@ class CanvasPreviewFrame(QFrame):
def resizeEvent(self, event): def resizeEvent(self, event):
self.fRenderSource = self.getRenderSource() self.fRenderSource = self.getRenderSource()


if self.fRealParent is not None:
QTimer.singleShot(0, self.fRealParent.slot_miniCanvasCheckAll)
#if self.fRealParent is not None:
#QTimer.singleShot(0, self.fRealParent.slot_miniCanvasCheckAll)


QFrame.resizeEvent(self, event) QFrame.resizeEvent(self, event)

Loading…
Cancel
Save