Browse Source

Misc changes

tags/1.9.5
falkTX 11 years ago
parent
commit
e333ed33c0
7 changed files with 119 additions and 53 deletions
  1. +4
    -2
      Makefile
  2. +2
    -0
      source/carla_backend.py
  3. +2
    -2
      source/carla_patchbay.py
  4. +0
    -27
      source/carla_shared.py
  5. +22
    -19
      source/carla_skin.py
  6. +85
    -0
      source/carla_utils.py
  7. +4
    -3
      source/carla_widgets.py

+ 4
- 2
Makefile View File

@@ -249,6 +249,7 @@ wine64:
# Resources # Resources


RES = \ RES = \
bin/resources/carla_app.py \
bin/resources/carla_backend.py \ bin/resources/carla_backend.py \
bin/resources/carla_config.py \ bin/resources/carla_config.py \
bin/resources/carla_database.py \ bin/resources/carla_database.py \
@@ -258,7 +259,7 @@ RES = \
bin/resources/carla_settings.py \ bin/resources/carla_settings.py \
bin/resources/carla_skin.py \ bin/resources/carla_skin.py \
bin/resources/carla_shared.py \ bin/resources/carla_shared.py \
bin/resources/carla_style.py \
bin/resources/carla_utils.py \
bin/resources/carla_widgets.py \ bin/resources/carla_widgets.py \
bin/resources/canvaspreviewframe.py \ bin/resources/canvaspreviewframe.py \
bin/resources/digitalpeakmeter.py \ bin/resources/digitalpeakmeter.py \
@@ -503,6 +504,7 @@ install:
$(DESTDIR)$(PREFIX)/share/carla/resources/zynaddsubfx/ $(DESTDIR)$(PREFIX)/share/carla/resources/zynaddsubfx/


# Install resources (re-use python files) # Install resources (re-use python files)
$(LINK) $(PREFIX)/share/carla/carla_app.py $(DESTDIR)$(PREFIX)/share/carla/resources/
$(LINK) $(PREFIX)/share/carla/carla_backend.py $(DESTDIR)$(PREFIX)/share/carla/resources/ $(LINK) $(PREFIX)/share/carla/carla_backend.py $(DESTDIR)$(PREFIX)/share/carla/resources/
$(LINK) $(PREFIX)/share/carla/carla_config.py $(DESTDIR)$(PREFIX)/share/carla/resources/ $(LINK) $(PREFIX)/share/carla/carla_config.py $(DESTDIR)$(PREFIX)/share/carla/resources/
$(LINK) $(PREFIX)/share/carla/carla_database.py $(DESTDIR)$(PREFIX)/share/carla/resources/ $(LINK) $(PREFIX)/share/carla/carla_database.py $(DESTDIR)$(PREFIX)/share/carla/resources/
@@ -512,7 +514,7 @@ install:
$(LINK) $(PREFIX)/share/carla/carla_settings.py $(DESTDIR)$(PREFIX)/share/carla/resources/ $(LINK) $(PREFIX)/share/carla/carla_settings.py $(DESTDIR)$(PREFIX)/share/carla/resources/
$(LINK) $(PREFIX)/share/carla/carla_skin.py $(DESTDIR)$(PREFIX)/share/carla/resources/ $(LINK) $(PREFIX)/share/carla/carla_skin.py $(DESTDIR)$(PREFIX)/share/carla/resources/
$(LINK) $(PREFIX)/share/carla/carla_shared.py $(DESTDIR)$(PREFIX)/share/carla/resources/ $(LINK) $(PREFIX)/share/carla/carla_shared.py $(DESTDIR)$(PREFIX)/share/carla/resources/
$(LINK) $(PREFIX)/share/carla/carla_style.py $(DESTDIR)$(PREFIX)/share/carla/resources/
$(LINK) $(PREFIX)/share/carla/carla_utils.py $(DESTDIR)$(PREFIX)/share/carla/resources/
$(LINK) $(PREFIX)/share/carla/carla_widgets.py $(DESTDIR)$(PREFIX)/share/carla/resources/ $(LINK) $(PREFIX)/share/carla/carla_widgets.py $(DESTDIR)$(PREFIX)/share/carla/resources/
$(LINK) $(PREFIX)/share/carla/canvaspreviewframe.py $(DESTDIR)$(PREFIX)/share/carla/resources/ $(LINK) $(PREFIX)/share/carla/canvaspreviewframe.py $(DESTDIR)$(PREFIX)/share/carla/resources/
$(LINK) $(PREFIX)/share/carla/digitalpeakmeter.py $(DESTDIR)$(PREFIX)/share/carla/resources/ $(LINK) $(PREFIX)/share/carla/digitalpeakmeter.py $(DESTDIR)$(PREFIX)/share/carla/resources/


+ 2
- 0
source/carla_backend.py View File

@@ -2032,3 +2032,5 @@ class Host(object):
self.msvcrt._putenv.restype = None self.msvcrt._putenv.restype = None
else: else:
self.msvcrt = None self.msvcrt = None

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

+ 2
- 2
source/carla_patchbay.py View File

@@ -391,10 +391,10 @@ class CarlaPatchbayW(QFrame, PluginEditParentMeta, metaclass=PyQtMetaClass):
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# called by PluginEdit to plugin skin parent, ignored here # called by PluginEdit to plugin skin parent, ignored here


def recheckPluginHints(self, hints):
def editDialogChanged(self, visible):
pass pass


def editDialogChanged(self, visible):
def pluginHintsChanged(self, hints):
pass pass


def parameterValueChanged(self, parameterId, value): def parameterValueChanged(self, parameterId, value):


+ 0
- 27
source/carla_shared.py View File

@@ -603,33 +603,6 @@ def getAndSetPath(parent, currentPath, lineEdit):
lineEdit.setText(newPath) lineEdit.setText(newPath)
return newPath return newPath


# ------------------------------------------------------------------------------------------------------------
# Get plugin type as string
# TODO - move into new carla_utils.py

def getPluginTypeAsString(ptype):
if ptype == PLUGIN_INTERNAL:
return "Internal"
if ptype == PLUGIN_LADSPA:
return "LADSPA"
if ptype == PLUGIN_DSSI:
return "DSSI"
if ptype == PLUGIN_LV2:
return "LV2"
if ptype == PLUGIN_VST:
return "VST"
if ptype == PLUGIN_VST3:
return "VST3"
if ptype == PLUGIN_AU:
return "AU"
if ptype == PLUGIN_GIG:
return "GIG"
if ptype == PLUGIN_SF2:
return "SF2"
if ptype == PLUGIN_SFZ:
return "SFZ"
return "Unknown"

# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Custom MessageBox # Custom MessageBox




+ 22
- 19
source/carla_skin.py View File

@@ -189,12 +189,6 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta, metaclass=PyQtMetaClass):


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


def recheckPluginHints(self, hints):
self.fPluginInfo['hints'] = hints

if self.b_gui is not None:
self.b_gui.setEnabled(bool(hints & PLUGIN_HAS_CUSTOM_UI))

def setId(self, idx): def setId(self, idx):
self.fPluginId = idx self.fPluginId = idx
self.fEditDialog.setId(idx) self.fEditDialog.setId(idx)
@@ -322,14 +316,6 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta, metaclass=PyQtMetaClass):
self.b_enable.setChecked(onOff) self.b_enable.setChecked(onOff)
self.b_enable.blockSignals(False) self.b_enable.blockSignals(False)


def editDialogChanged(self, visible):
if self.b_edit is None:
return

self.b_edit.blockSignals(True)
self.b_edit.setChecked(visible)
self.b_edit.blockSignals(False)

def customUiStateChanged(self, state): def customUiStateChanged(self, state):
if self.b_gui is None: if self.b_gui is None:
return return
@@ -358,6 +344,26 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta, metaclass=PyQtMetaClass):


self.led_midi.setChecked(onOff) self.led_midi.setChecked(onOff)


def optionChanged(self, option, yesNo):
pass

# -----------------------------------------------------------------
# PluginEdit callbacks

def editDialogChanged(self, visible):
if self.b_edit is None:
return

self.b_edit.blockSignals(True)
self.b_edit.setChecked(visible)
self.b_edit.blockSignals(False)

def pluginHintsChanged(self, hints):
self.fPluginInfo['hints'] = hints

if self.b_gui is not None:
self.b_gui.setEnabled(bool(hints & PLUGIN_HAS_CUSTOM_UI))

def parameterValueChanged(self, parameterId, value): def parameterValueChanged(self, parameterId, value):
for paramIndex, paramWidget in self.fParameterList: for paramIndex, paramWidget in self.fParameterList:
if paramIndex != parameterId: if paramIndex != parameterId:
@@ -384,9 +390,6 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta, metaclass=PyQtMetaClass):
self.cb_presets.setCurrentIndex(index) self.cb_presets.setCurrentIndex(index)
self.cb_presets.blockSignals(False) self.cb_presets.blockSignals(False)


def optionChanged(self, option, yesNo):
pass

def notePressed(self, note): def notePressed(self, note):
pass pass


@@ -1100,13 +1103,13 @@ class PluginSlot_Calf(AbstractPluginSlot):


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


def recheckPluginHints(self, hints):
def pluginHintsChanged(self, hints):
if hints & PLUGIN_HAS_CUSTOM_UI: if hints & PLUGIN_HAS_CUSTOM_UI:
self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOn, self.fButtonFont) self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOn, self.fButtonFont)
else: else:
self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOff, self.fButtonFont) self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOff, self.fButtonFont)


AbstractPluginSlot.recheckPluginHints(self, hints)
AbstractPluginSlot.pluginHintsChanged(self, hints)


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




+ 85
- 0
source/carla_utils.py View File

@@ -0,0 +1,85 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla Backend utils
# Copyright (C) 2011-2014 Filipe Coelho <falktx@falktx.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the doc/GPL.txt file.

# ------------------------------------------------------------------------------------------------------------
# Imports (Custom)

from carla_backend import *

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

def getPluginTypeAsString(ptype):
if ptype == PLUGIN_NONE:
return "NONE"
if ptype == PLUGIN_INTERNAL:
return "Internal"
if ptype == PLUGIN_LADSPA:
return "LADSPA"
if ptype == PLUGIN_DSSI:
return "DSSI"
if ptype == PLUGIN_LV2:
return "LV2"
if ptype == PLUGIN_VST:
return "VST"
if ptype == PLUGIN_VST3:
return "VST3"
if ptype == PLUGIN_AU:
return "AU"
if ptype == PLUGIN_GIG:
return "GIG"
if ptype == PLUGIN_SF2:
return "SF2"
if ptype == PLUGIN_SFZ:
return "SFZ"

print("getPluginTypeAsString(%i) - invalid type" % ptype);
return "Unknown"

def getPluginTypeFromString(stype):
if not stype:
return PLUGIN_NONE

stype = stype.lower()

if stype == "none":
return PLUGIN_NONE
if stype == "internal":
return PLUGIN_INTERNAL
if stype == "ladspa":
return PLUGIN_LADSPA
if stype == "dssi":
return PLUGIN_DSSI
if stype == "lv2":
return PLUGIN_LV2
if stype == "vst":
return PLUGIN_VST
if stype == "vst3":
return PLUGIN_VST3
if stype == "au":
return PLUGIN_AU
if stype == "gig":
return PLUGIN_GIG
if stype == "sf2":
return PLUGIN_SF2
if stype == "sfz":
return PLUGIN_SFZ

print("getPluginTypeFromString(\"%s\") - invalid string type" % stype)
return PLUGIN_NONE

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

+ 4
- 3
source/carla_widgets.py View File

@@ -42,6 +42,7 @@ import ui_carla_edit
import ui_carla_parameter import ui_carla_parameter


from carla_shared import * from carla_shared import *
from carla_utils import *
from pixmapkeyboard import PixmapKeyboardHArea from pixmapkeyboard import PixmapKeyboardHArea


# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
@@ -399,11 +400,11 @@ class PluginParameter(QWidget):


class PluginEditParentMeta(metaclass=ABCMeta): class PluginEditParentMeta(metaclass=ABCMeta):
@abstractmethod @abstractmethod
def recheckPluginHints(self, hints):
def editDialogChanged(self, visible):
raise NotImplementedError raise NotImplementedError


@abstractmethod @abstractmethod
def editDialogChanged(self, visible):
def pluginHintsChanged(self, hints):
raise NotImplementedError raise NotImplementedError


@abstractmethod @abstractmethod
@@ -737,7 +738,7 @@ class PluginEdit(QDialog):


# Force-Update parent for new hints # Force-Update parent for new hints
if self.fRealParent and not self.fFirstInit: if self.fRealParent and not self.fFirstInit:
self.fRealParent.recheckPluginHints(pluginHints)
self.fRealParent.pluginHintsChanged(pluginHints)


def reloadParameters(self): def reloadParameters(self):
# Reset # Reset


Loading…
Cancel
Save