Browse Source

More cleanup

tags/1.9.5
falkTX 11 years ago
parent
commit
64b8803025
5 changed files with 42 additions and 52 deletions
  1. +14
    -22
      source/carla
  2. +0
    -4
      source/carla_host.py
  3. +11
    -16
      source/carla_patchbay.py
  4. +6
    -10
      source/carla_rack.py
  5. +11
    -0
      source/patchcanvas.py

+ 14
- 22
source/carla View File

@@ -56,7 +56,7 @@ class CarlaMultiW(QTabWidget):
self.fPatchbay = CarlaPatchbayW(parent, host, False, False)
self.fParent = parent

self.fUseCustomPaint = False
self.fUseCustomPaint = parent.getSavedSettings()[CARLA_KEY_CUSTOM_PAINTING]

self.addTab(self.fRack, "Plugins")
self.addTab(self.fPatchbay, "Patchbay")
@@ -64,6 +64,7 @@ class CarlaMultiW(QTabWidget):
#self.fPatchbay.hide()
#self.removeTab(1)
#self.fPatchbay.setParent(None)
#self.fPatchbay.setWindowTitle(parent.windowTitle())
#self.fPatchbay.show()

self.scene = self.fPatchbay.scene
@@ -94,24 +95,12 @@ class CarlaMultiW(QTabWidget):
parent.ui.act_settings_configure.triggered.connect(self.fPatchbay.slot_configureCarla)

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

def fixCanvasPreviewSize(self):
self.fPatchbay.resize(self.fRack.size())
self.fPatchbay.slot_miniCanvasCheckSize()

def setUseCustomPaint(self, useCustomPaint):
if self.fUseCustomPaint != useCustomPaint:
self.fUseCustomPaint = useCustomPaint
self.update()

# -----------------------------------------------------------------
# HostWidgetMeta methods

def removeAllPlugins(self):
self.fRack.removeAllPlugins()
self.fPatchbay.removeAllPlugins()

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

def engineStarted(self):
self.fRack.engineStarted()
self.fPatchbay.engineStarted()
@@ -122,8 +111,6 @@ class CarlaMultiW(QTabWidget):
self.fPatchbay.engineStopped()
self.fParent.engineStopped()

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

def idleFast(self):
self.fRack.idleFast()
self.fPatchbay.idleFast()
@@ -132,8 +119,6 @@ class CarlaMultiW(QTabWidget):
self.fRack.idleSlow()
self.fPatchbay.idleSlow()

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

def projectLoadingStarted(self):
self.fRack.projectLoadingStarted()
self.fPatchbay.projectLoadingStarted()
@@ -142,8 +127,6 @@ class CarlaMultiW(QTabWidget):
self.fRack.projectLoadingFinished()
self.fPatchbay.projectLoadingFinished()

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

def saveSettings(self, settings):
self.fRack.saveSettings(settings)
self.fPatchbay.saveSettings(settings)
@@ -153,6 +136,12 @@ class CarlaMultiW(QTabWidget):

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

def fixCanvasPreviewSize(self):
self.fPatchbay.resize(self.fRack.size())
self.fPatchbay.slot_miniCanvasCheckSize()

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

def paintEvent(self, event):
QTabWidget.paintEvent(self, event)

@@ -183,8 +172,6 @@ class CarlaHostW(HostWindow):
self.fContainer = CarlaMultiW(self, host)
self.setupContainer(True, self.fContainer.fPatchbay.themeData)

self.fContainer.setUseCustomPaint(self.fSavedSettings[CARLA_KEY_CUSTOM_PAINTING])

# -------------------------------------------------------------
# Set-up GUI stuff

@@ -288,6 +275,11 @@ class CarlaHostW(HostWindow):
self.updateInfoLabelXandSize()
return HostWindow.eventFilter(self, obj, event)

#def closeEvent(self, event):
#HostWindow.closeEvent(self, event)
## needed if using separate patchbay window
#QApplication.instance().quit()

def resizeEvent(self, event):
HostWindow.resizeEvent(self, event)
self.updateInfoLabelXandSize()


+ 0
- 4
source/carla_host.py View File

@@ -284,10 +284,6 @@ class HostWindow(QMainWindow):
def setLoadRDFsNeeded(self):
self.fLadspaRdfNeedsUpdate = True

def openSettingsWindow(self, hasCanvas, hasCanvasGL):
dialog = CarlaSettingsW(self, self.host, hasCanvas, hasCanvasGL)
return dialog.exec_()

def setupContainer(self, showCanvas, canvasThemeData = []):
if showCanvas:
canvasWidth, canvasHeight, canvasBg, canvasBrush, canvasPen = canvasThemeData


+ 11
- 16
source/carla_patchbay.py View File

@@ -38,7 +38,7 @@ else:

import patchcanvas

from carla_widgets import *
from carla_host import *
from digitalpeakmeter import DigitalPeakMeter
from pixmapkeyboard import PixmapKeyboardHArea

@@ -61,7 +61,7 @@ CARLA_DEFAULT_CANVAS_SIZE_WIDTH = 3100
CARLA_DEFAULT_CANVAS_SIZE_HEIGHT = 2400

# ------------------------------------------------------------------------------------------------
# Dummt class used in main carla as replacement for PluginEdit
# Dummy class used in main carla as replacement for PluginEdit

class DummyPluginEdit(object):
def __init__(self, parent, pluginId):
@@ -94,8 +94,8 @@ class DummyPluginEdit(object):
# ------------------------------------------------------------------------------------------------
# Patchbay widget

class CarlaPatchbayW(QFrame, PluginEditParentMeta):
#class CarlaPatchbayW(QFrame, PluginEditParentMeta, metaclass=PyQtMetaClass):
class CarlaPatchbayW(QFrame, PluginEditParentMeta, HostWidgetMeta):
#class CarlaPatchbayW(QFrame, PluginEditParentMeta, HostWidgetMeta, metaclass=PyQtMetaClass):
def __init__(self, parent, host, doSetup = True, onlyPatchbay = True, is3D = False):
QFrame.__init__(self, parent)
self.host = host
@@ -294,8 +294,11 @@ class CarlaPatchbayW(QFrame, PluginEditParentMeta):
pedit.setPluginId(i)

# -----------------------------------------------------------------
# HostWidgetMeta methods

def removeAllPlugins(self):
patchcanvas.handleAllPluginsRemoved()

for pedit in self.fPluginList:
if pedit is None:
break
@@ -307,18 +310,12 @@ class CarlaPatchbayW(QFrame, PluginEditParentMeta):

self.clearSideStuff()

patchcanvas.handlePluginRemoved(0)

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

def engineStarted(self):
pass

def engineStopped(self):
patchcanvas.clear()

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

def idleFast(self):
if self.fPluginCount == 0:
return
@@ -348,16 +345,13 @@ class CarlaPatchbayW(QFrame, PluginEditParentMeta):
break
pedit.idleSlow()

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

def projectLoadingStarted(self):
pass
self.fView.setEnabled(False)

def projectLoadingFinished(self):
self.fView.setEnabled(True)
QTimer.singleShot(1000, self.slot_canvasRefresh)

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

def saveSettings(self, settings):
settings.setValue("ShowMeters", self.fParent.ui.act_settings_show_meters.isChecked())
settings.setValue("ShowKeyboard", self.fParent.ui.act_settings_show_keyboard.isChecked())
@@ -636,7 +630,8 @@ class CarlaPatchbayW(QFrame, PluginEditParentMeta):

@pyqtSlot()
def slot_configureCarla(self):
if self.fParent is None or not self.fParent.openSettingsWindow(True, hasGL):
dialog = CarlaSettingsW(self, self.host, True, hasGL)
if not dialog.exec_():
return

self.fParent.loadSettings(False)


+ 6
- 10
source/carla_rack.py View File

@@ -35,6 +35,7 @@ else:
# ------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)

from carla_host import *
from carla_skin import *

# ------------------------------------------------------------------------------------------------------------
@@ -226,7 +227,8 @@ class CarlaRackList(QListWidget):
# ------------------------------------------------------------------------------------------------------------
# Rack widget

class CarlaRackW(QFrame):
class CarlaRackW(QFrame, HostWidgetMeta):
#class CarlaRackW(QFrame, HostWidgetMeta, metaclass=PyQtMetaClass):
def __init__(self, parent, host, doSetup = True):
QFrame.__init__(self, parent)
self.host = host
@@ -364,6 +366,7 @@ class CarlaRackW(QFrame):
pitem.setPluginId(i)

# -----------------------------------------------------------------
# HostWidgetMeta methods

def removeAllPlugins(self):
while self.fRack.takeItem(0):
@@ -379,16 +382,12 @@ class CarlaRackW(QFrame):
self.fPluginCount = 0
self.fPluginList = []

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

def engineStarted(self):
pass

def engineStopped(self):
pass

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

def idleFast(self):
for pitem in self.fPluginList:
if pitem is None:
@@ -403,16 +402,12 @@ class CarlaRackW(QFrame):

pitem.getWidget().idleSlow()

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

def projectLoadingStarted(self):
self.fRack.setEnabled(False)

def projectLoadingFinished(self):
self.fRack.setEnabled(True)

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

def saveSettings(self, settings):
pass

@@ -509,7 +504,8 @@ class CarlaRackW(QFrame):

@pyqtSlot()
def slot_configureCarla(self):
if self.fParent is None or not self.fParent.openSettingsWindow(False, False):
dialog = CarlaSettingsW(self, self.host, False, False)
if not dialog.exec_():
return

self.fParent.loadSettings(False)


+ 11
- 0
source/patchcanvas.py View File

@@ -997,6 +997,17 @@ def handlePluginRemoved(plugin_id):
if group.split and group.widgets[1]:
group.widgets[1].m_plugin_id -= 1

def handleAllPluginsRemoved():
if canvas.debug:
qDebug("PatchCanvas::handleAllPluginsRemoved()")

for group in canvas.group_list:
group.plugin_id -= 1
group.widgets[0].m_plugin_id -= 1

if group.split and group.widgets[1]:
group.widgets[1].m_plugin_id -= 1

# Extra Internal functions

def CanvasGetNewGroupPos(horizontal):


Loading…
Cancel
Save