Browse Source

Misc, and fixes

tags/1.9.4
falkTX 12 years ago
parent
commit
ef015a6b45
15 changed files with 305 additions and 182 deletions
  1. +64
    -21
      resources/ui/carla_edit.ui
  2. +20
    -7
      resources/ui/carla_parameter.ui
  3. +5
    -0
      source/backend/carla_plugin.hpp
  4. +4
    -2
      source/backend/carla_standalone.hpp
  5. +2
    -2
      source/backend/engine/jack.cpp
  6. +5
    -0
      source/backend/plugin/carla_plugin.cpp
  7. +1
    -5
      source/backend/plugin/fluidsynth.cpp
  8. +5
    -0
      source/backend/plugin/ladspa.cpp
  9. +1
    -5
      source/backend/plugin/linuxsampler.cpp
  10. +2
    -0
      source/backend/standalone/carla_standalone.cpp
  11. +9
    -7
      source/bridges/qtcreator/carla-bridge-plugin.pro
  12. +2
    -1
      source/carla_backend.py
  13. +175
    -120
      source/carla_shared.py
  14. +0
    -8
      source/utils/carla_backend_utils.hpp
  15. +10
    -4
      source/widgets/paramspinbox.py

+ 64
- 21
resources/ui/carla_edit.ui View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>720</width>
<height>550</height>
<width>697</width>
<height>518</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -294,6 +294,9 @@ Plugin Name
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QCheckBox" name="checkBox"> <widget class="QCheckBox" name="checkBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Fixed-size buffer</string> <string>Fixed-size buffer</string>
</property> </property>
@@ -301,6 +304,9 @@ Plugin Name
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_2"> <widget class="QCheckBox" name="checkBox_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Force Stereo</string> <string>Force Stereo</string>
</property> </property>
@@ -308,6 +314,9 @@ Plugin Name
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_3"> <widget class="QCheckBox" name="checkBox_3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Self-automation</string> <string>Self-automation</string>
</property> </property>
@@ -315,6 +324,9 @@ Plugin Name
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_4"> <widget class="QCheckBox" name="checkBox_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Use chunks</string> <string>Use chunks</string>
</property> </property>
@@ -322,6 +334,9 @@ Plugin Name
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_5"> <widget class="QCheckBox" name="checkBox_5">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Send All Sound/Notes Off</string> <string>Send All Sound/Notes Off</string>
</property> </property>
@@ -329,6 +344,9 @@ Plugin Name
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_6"> <widget class="QCheckBox" name="checkBox_6">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Send Note-Off Velocity</string> <string>Send Note-Off Velocity</string>
</property> </property>
@@ -336,6 +354,9 @@ Plugin Name
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_7"> <widget class="QCheckBox" name="checkBox_7">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Send Note Aftertouch</string> <string>Send Note Aftertouch</string>
</property> </property>
@@ -343,6 +364,9 @@ Plugin Name
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_8"> <widget class="QCheckBox" name="checkBox_8">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Send Pitchbend</string> <string>Send Pitchbend</string>
</property> </property>
@@ -358,28 +382,11 @@ Plugin Name
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="topMargin"> <property name="topMargin">
<number>0</number>
<number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>MIDI Control Channel:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>16</number>
</property>
</widget>
</item>
<item> <item>
<widget class="PixmapDial" name="dial_vol"> <widget class="PixmapDial" name="dial_vol">
<property name="minimumSize"> <property name="minimumSize">
@@ -498,6 +505,36 @@ Plugin Name
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>MIDI Control Channel:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>16</number>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@@ -525,6 +562,9 @@ Plugin Name
</item> </item>
<item> <item>
<widget class="QToolButton" name="b_reload_program"> <widget class="QToolButton" name="b_reload_program">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
@@ -546,6 +586,9 @@ Plugin Name
</item> </item>
<item> <item>
<widget class="QToolButton" name="b_reload_midi_program"> <widget class="QToolButton" name="b_reload_midi_program">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
@@ -608,7 +651,7 @@ Plugin Name
<widget class="QWidget" name="scrollAreaWidgetContents"> <widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x>
<x>-87</x>
<y>0</y> <y>0</y>
<width>864</width> <width>864</width>
<height>64</height> <height>64</height>


+ 20
- 7
resources/ui/carla_parameter.ui View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>452</width> <width>452</width>
<height>35</height>
<height>34</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -38,12 +38,25 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="combo">
<item>
<property name="text">
<string>(none)</string>
</property>
</item>
<widget class="QSpinBox" name="sb_control">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="specialValueText">
<string>(none)</string>
</property>
<property name="prefix">
<string>cc #</string>
</property>
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>127</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget> </widget>
</item> </item>
<item> <item>


+ 5
- 0
source/backend/carla_plugin.hpp View File

@@ -178,6 +178,11 @@ public:
return 0; return 0;
} }


/*!
* Get the plugin's latency, in samples.
*/
uint32_t latency();

// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (count) // Information (count)




+ 4
- 2
source/backend/carla_standalone.hpp View File

@@ -1,4 +1,4 @@
/*
/*
* Carla Standalone API * Carla Standalone API
* Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com> * Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com>
* *
@@ -47,6 +47,7 @@ struct CarlaPluginInfo {
const char* maker; const char* maker;
const char* copyright; const char* copyright;
long uniqueId; long uniqueId;
uint32_t latency;


CarlaPluginInfo() CarlaPluginInfo()
: type(CarlaBackend::PLUGIN_NONE), : type(CarlaBackend::PLUGIN_NONE),
@@ -57,7 +58,8 @@ struct CarlaPluginInfo {
label(nullptr), label(nullptr),
maker(nullptr), maker(nullptr),
copyright(nullptr), copyright(nullptr),
uniqueId(0) {}
uniqueId(0),
latency(0) {}


~CarlaPluginInfo() ~CarlaPluginInfo()
{ {


+ 2
- 2
source/backend/engine/jack.cpp View File

@@ -1,4 +1,4 @@
/*
/*
* Carla JACK Engine * Carla JACK Engine
* Copyright (C) 2012-2013 Filipe Coelho <falktx@falktx.com> * Copyright (C) 2012-2013 Filipe Coelho <falktx@falktx.com>
* *
@@ -631,7 +631,7 @@ public:
bool isRunning() const bool isRunning() const
{ {
#ifdef BUILD_BRIDGE #ifdef BUILD_BRIDGE
return (fClient != nullptr || ! m_hasQuit);
return (fClient != nullptr || ! fHasQuit);
#else #else
return (fClient != nullptr); return (fClient != nullptr);
#endif #endif


+ 5
- 0
source/backend/plugin/carla_plugin.cpp View File

@@ -122,6 +122,11 @@ const char* CarlaPlugin::filename() const
return (const char*)fData->filename; return (const char*)fData->filename;
} }


uint32_t CarlaPlugin::latency()
{
return 0;
}

// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (count) // Information (count)




+ 1
- 5
source/backend/plugin/fluidsynth.cpp View File

@@ -1,4 +1,4 @@
/*
/*
* Carla Backend * Carla Backend
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> * Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com>
* *
@@ -15,10 +15,6 @@
* For a full copy of the GNU General Public License see the COPYING file * For a full copy of the GNU General Public License see the COPYING file
*/ */


#ifdef BUILD_BRIDGE
# error Should not use fluidsynth for bridges!
#endif

#include "carla_plugin_internal.hpp" #include "carla_plugin_internal.hpp"


#ifdef WANT_FLUIDSYNTH #ifdef WANT_FLUIDSYNTH


+ 5
- 0
source/backend/plugin/ladspa.cpp View File

@@ -68,6 +68,11 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (base) // Information (base)


virtual PluginType type() const
{
return PLUGIN_LADSPA;
}

PluginCategory category() PluginCategory category()
{ {
if (fRdfDescriptor) if (fRdfDescriptor)


+ 1
- 5
source/backend/plugin/linuxsampler.cpp View File

@@ -1,4 +1,4 @@
/*
/*
* Carla LinuxSampler Plugin * Carla LinuxSampler Plugin
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> * Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com>
* *
@@ -17,10 +17,6 @@


// TODO - setMidiProgram() // TODO - setMidiProgram()


#ifdef BUILD_BRIDGE
# error Should not use linuxsampler for bridges!
#endif

#include "carla_plugin_internal.hpp" #include "carla_plugin_internal.hpp"


#ifdef WANT_LINUXSAMPLER #ifdef WANT_LINUXSAMPLER


+ 2
- 0
source/backend/standalone/carla_standalone.cpp View File

@@ -335,6 +335,7 @@ const CarlaPluginInfo* carla_get_plugin_info(unsigned int pluginId)
info.binary = nullptr; info.binary = nullptr;
info.name = nullptr; info.name = nullptr;
info.uniqueId = 0; info.uniqueId = 0;
info.latency = 0;


// cleanup // cleanup
if (info.label != nullptr) if (info.label != nullptr)
@@ -370,6 +371,7 @@ const CarlaPluginInfo* carla_get_plugin_info(unsigned int pluginId)
info.binary = plugin->filename(); info.binary = plugin->filename();
info.name = plugin->name(); info.name = plugin->name();
info.uniqueId = plugin->uniqueId(); info.uniqueId = plugin->uniqueId();
info.latency = plugin->latency();


plugin->getLabel(strBufLabel); plugin->getLabel(strBufLabel);
info.label = strdup(strBufLabel); info.label = strdup(strBufLabel);


+ 9
- 7
source/bridges/qtcreator/carla-bridge-plugin.pro View File

@@ -35,12 +35,13 @@ SOURCES += \
# carla-plugin # carla-plugin
SOURCES += \ SOURCES += \
../../backend/plugin/carla_plugin.cpp \ ../../backend/plugin/carla_plugin.cpp \
../../backend/plugin/ladspa.cpp

# ../../backend/plugin/carla_plugin_thread.cpp \
# ../../backend/plugin/dssi.cpp \
# ../../backend/plugin/lv2.cpp \
# ../../backend/plugin/vst.cpp
../../backend/plugin/carla_plugin_thread.cpp \
../../backend/plugin/ladspa.cpp \
../../backend/plugin/dssi.cpp \
../../backend/plugin/lv2.cpp \
../../backend/plugin/vst.cpp \
../../backend/plugin/fluidsynth.cpp \
../../backend/plugin/linuxsampler.cpp


# carla-utils # carla-utils
SOURCES += \ SOURCES += \
@@ -101,7 +102,8 @@ DEFINES += DEBUG
DEFINES += BUILD_BRIDGE BUILD_BRIDGE_PLUGIN BRIDGE_PLUGIN DEFINES += BUILD_BRIDGE BUILD_BRIDGE_PLUGIN BRIDGE_PLUGIN


DEFINES += WANT_JACK DEFINES += WANT_JACK
DEFINES += WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST
DEFINES += WANT_LADSPA
# WANT_DSSI WANT_LV2 WANT_VST


LIBS = -ldl \ LIBS = -ldl \
../../libs/lilv.a \ ../../libs/lilv.a \


+ 2
- 1
source/carla_backend.py View File

@@ -92,7 +92,8 @@ class CarlaPluginInfo(Structure):
("label", c_char_p), ("label", c_char_p),
("maker", c_char_p), ("maker", c_char_p),
("copyright", c_char_p), ("copyright", c_char_p),
("uniqueId", c_long)
("uniqueId", c_long),
("latency", c_uint32)
] ]


class CarlaNativePluginInfo(Structure): class CarlaNativePluginInfo(Structure):


+ 175
- 120
source/carla_shared.py View File

@@ -28,9 +28,9 @@ from copy import deepcopy
#from decimal import Decimal #from decimal import Decimal
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from PyQt4.QtCore import pyqtSlot, qWarning, Qt, QByteArray, QSettings, QThread, QTimer, SIGNAL, SLOT from PyQt4.QtCore import pyqtSlot, qWarning, Qt, QByteArray, QSettings, QThread, QTimer, SIGNAL, SLOT
from PyQt4.QtGui import QColor, QDialog, QIcon, QFontMetrics, QFrame, QMessageBox
from PyQt4.QtGui import QPainter, QPainterPath, QTableWidgetItem, QVBoxLayout, QWidget
#from PyQt4.QtGui import QCursor, QGraphicsScene, QInputDialog, QLinearGradient, QMenu,
from PyQt4.QtGui import QColor, QCursor, QDialog, QIcon, QFileDialog, QFontMetrics, QFrame, QMenu
from PyQt4.QtGui import QMessageBox, QPainter, QPainterPath, QTableWidgetItem, QVBoxLayout, QWidget
#from PyQt4.QtGui import QGraphicsScene, QInputDialog, QLinearGradient,
#from PyQt4.QtXml import QDomDocument #from PyQt4.QtXml import QDomDocument


# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
@@ -1257,16 +1257,14 @@ class PluginParameter(QWidget):
pType = pInfo['type'] pType = pInfo['type']
pHints = pInfo['hints'] pHints = pInfo['hints']


self.fMidiCC = -1
self.fMidiControl = -1
self.fMidiChannel = 1 self.fMidiChannel = 1
self.fParameterId = pInfo['index'] self.fParameterId = pInfo['index']
self.fPluginId = pluginId self.fPluginId = pluginId
self.fTabIndex = tabIndex self.fTabIndex = tabIndex


self.ui.label.setText(pInfo['name']) self.ui.label.setText(pInfo['name'])

for MIDI_CC in MIDI_CC_LIST:
self.ui.combo.addItem(MIDI_CC)
self.ui.widget.setName(pInfo['name'])


if pType == PARAMETER_INPUT: if pType == PARAMETER_INPUT:
self.ui.widget.setMinimum(pInfo['minimum']) self.ui.widget.setMinimum(pInfo['minimum'])
@@ -1281,11 +1279,11 @@ class PluginParameter(QWidget):


if not pHints & PARAMETER_IS_ENABLED: if not pHints & PARAMETER_IS_ENABLED:
self.ui.widget.setReadOnly(True) self.ui.widget.setReadOnly(True)
self.ui.combo.setEnabled(False)
self.ui.sb_control.setEnabled(False)
self.ui.sb_channel.setEnabled(False) self.ui.sb_channel.setEnabled(False)


elif not pHints & PARAMETER_IS_AUTOMABLE: elif not pHints & PARAMETER_IS_AUTOMABLE:
self.ui.combo.setEnabled(False)
self.ui.sb_control.setEnabled(False)
self.ui.sb_channel.setEnabled(False) self.ui.sb_channel.setEnabled(False)


elif pType == PARAMETER_OUTPUT: elif pType == PARAMETER_OUTPUT:
@@ -1296,26 +1294,24 @@ class PluginParameter(QWidget):
self.ui.widget.setReadOnly(True) self.ui.widget.setReadOnly(True)


if not pHints & PARAMETER_IS_AUTOMABLE: if not pHints & PARAMETER_IS_AUTOMABLE:
self.ui.combo.setEnabled(False)
self.ui.sb_control.setEnabled(False)
self.ui.sb_channel.setEnabled(False) self.ui.sb_channel.setEnabled(False)


else: else:
self.ui.widget.setVisible(False) self.ui.widget.setVisible(False)
self.ui.combo.setVisible(False)
self.ui.sb_control.setVisible(False)
self.ui.sb_channel.setVisible(False) self.ui.sb_channel.setVisible(False)


if pHints & PARAMETER_USES_CUSTOM_TEXT: if pHints & PARAMETER_USES_CUSTOM_TEXT:
self.ui.widget.setTextCallback(self._textCallBack) self.ui.widget.setTextCallback(self._textCallBack)


self.setMidiCC(pInfo['midiCC'])
self.setMidiControl(pInfo['midiCC'])
self.setMidiChannel(pInfo['midiChannel']) self.setMidiChannel(pInfo['midiChannel'])


self.connect(self.ui.widget, SIGNAL("valueChanged(double)"), SLOT("slot_valueChanged(double)"))
self.connect(self.ui.sb_channel, SIGNAL("valueChanged(int)"), SLOT("slot_midiChannelChanged(int)"))
self.connect(self.ui.combo, SIGNAL("currentIndexChanged(int)"), SLOT("slot_midiCcChanged(int)"))

#if force_parameters_style:
#self.widget.force_plastique_style()
self.connect(self.ui.sb_control, SIGNAL("customContextMenuRequested(QPoint)"), SLOT("slot_controlSpinboxCustomMenu()"))
self.connect(self.ui.sb_control, SIGNAL("valueChanged(int)"), SLOT("slot_controlSpinboxChanged(int)"))
self.connect(self.ui.sb_channel, SIGNAL("valueChanged(int)"), SLOT("slot_channelSpinboxChanged(int)"))
self.connect(self.ui.widget, SIGNAL("valueChanged(double)"), SLOT("slot_widgetValueChanged(double)"))


self.ui.widget.updateAll() self.ui.widget.updateAll()


@@ -1325,13 +1321,17 @@ class PluginParameter(QWidget):
def setValue(self, value, send=True): def setValue(self, value, send=True):
self.ui.widget.setValue(value, send) self.ui.widget.setValue(value, send)


def setMidiCC(self, cc):
self.fMidiCC = cc
self._setMidiCcInComboBox(cc)
def setMidiControl(self, control):
self.fMidiControl = control
self.ui.sb_control.blockSignals(True)
self.ui.sb_control.setValue(control)
self.ui.sb_control.blockSignals(False)


def setMidiChannel(self, channel): def setMidiChannel(self, channel):
self.fMidiChannel = channel self.fMidiChannel = channel
self.ui.sb_channel.blockSignals(True)
self.ui.sb_channel.setValue(channel) self.ui.sb_channel.setValue(channel)
self.ui.sb_channel.blockSignals(False)


def setLabelWidth(self, width): def setLabelWidth(self, width):
self.ui.label.setMinimumWidth(width) self.ui.label.setMinimumWidth(width)
@@ -1340,40 +1340,41 @@ class PluginParameter(QWidget):
def tabIndex(self): def tabIndex(self):
return self.fTabIndex return self.fTabIndex


@pyqtSlot(float)
def slot_valueChanged(self, value):
self.emit(SIGNAL("valueChanged(int, double)"), self.fParameterId, value)
@pyqtSlot()
def slot_controlSpinboxCustomMenu(self):
menu = QMenu(self)


@pyqtSlot(int)
def slot_midiCcChanged(self, ccIndex):
if ccIndex <= 0:
cc = -1
else:
ccStr = MIDI_CC_LIST[ccIndex - 1].split(" ")[0]
cc = int(ccStr, 16)
for cc in MIDI_CC_LIST:
action = menu.addAction(cc)

if int(cc.split(" ")[0], 16) == self.fMidiControl:
action.setCheckable(True)
action.setChecked(True)

actSel = menu.exec_(QCursor.pos())


if self.fMidiCC != cc:
self.emit(SIGNAL("midiCcChanged(int, int)"), self.fParameterId, cc)
if actSel:
selControlStr = actSel.text()
selControl = int(selControlStr.split(" ")[0], 16)
self.ui.sb_control.setValue(selControl)

@pyqtSlot(int)
def slot_controlSpinboxChanged(self, control):
if self.fMidiControl != control:
self.emit(SIGNAL("midiControlChanged(int, int)"), self.fParameterId, control)


self.fMidiCC = cc
self.fMidiControl = control


@pyqtSlot(int) @pyqtSlot(int)
def slot_midiChannelChanged(self, channel):
def slot_channelSpinboxChanged(self, channel):
if self.fMidiChannel != channel: if self.fMidiChannel != channel:
self.emit(SIGNAL("midiChannelChanged(int, int)"), self.fParameterId, channel) self.emit(SIGNAL("midiChannelChanged(int, int)"), self.fParameterId, channel)


self.fMidiChannel = channel self.fMidiChannel = channel


def _setMidiCcInComboBox(self, cc):
for i in range(len(MIDI_CC_LIST)):
ccStr = MIDI_CC_LIST[i].split(" ")[0]
if int(ccStr, 16) == cc:
ccIndex = i+1
break
else:
ccIndex = 0

self.ui.combo.setCurrentIndex(ccIndex)
@pyqtSlot(float)
def slot_widgetValueChanged(self, value):
self.emit(SIGNAL("valueChanged(int, double)"), self.fParameterId, value)


def _textCallBack(self): def _textCallBack(self):
return cString(Carla.host.get_parameter_text(self.fPluginId, self.fParameterId)) return cString(Carla.host.get_parameter_text(self.fPluginId, self.fParameterId))
@@ -1421,7 +1422,9 @@ class PluginEdit(QDialog):


self.ui.keyboard.setMode(self.ui.keyboard.HORIZONTAL) self.ui.keyboard.setMode(self.ui.keyboard.HORIZONTAL)
self.ui.keyboard.setOctaves(6) self.ui.keyboard.setOctaves(6)

self.ui.scrollArea.ensureVisible(self.ui.keyboard.width() / 5, 0) self.ui.scrollArea.ensureVisible(self.ui.keyboard.width() / 5, 0)
self.ui.scrollArea.setEnabled(False)
self.ui.scrollArea.setVisible(False) self.ui.scrollArea.setVisible(False)


# TODO - not implemented yet # TODO - not implemented yet
@@ -1454,38 +1457,6 @@ class PluginEdit(QDialog):
self.connect(self, SIGNAL("finished(int)"), SLOT("slot_finished()")) self.connect(self, SIGNAL("finished(int)"), SLOT("slot_finished()"))


self.reloadAll() self.reloadAll()
self.resize(self.width(), self.height()-self.ui.keyboard.height())

def animateTab(self, index):
if self.fTabIconTimers[index-1] == ICON_STATE_NULL:
self.ui.tabWidget.setTabIcon(index, self.fTabIconOn)

self.fTabIconTimers[index-1] = ICON_STATE_ON

def idleSlow(self):
# Check Tab icons
for i in range(len(self.fTabIconTimers)):
if self.fTabIconTimers[i] == ICON_STATE_ON:
self.fTabIconTimers[i] = ICON_STATE_WAIT
elif self.fTabIconTimers[i] == ICON_STATE_WAIT:
self.fTabIconTimers[i] = ICON_STATE_OFF
elif self.fTabIconTimers[i] == ICON_STATE_OFF:
self.fTabIconTimers[i] = ICON_STATE_NULL
self.ui.tabWidget.setTabIcon(i+1, self.fTabIconOff)

# Check parameters needing update
for index, value in self.fParameterToUpdate:
for paramType, paramId, paramWidget in self.fParameterList:
if paramId == index:
paramWidget.setValue(value, False)

if paramType == PARAMETER_INPUT:
self.animateTab(paramWidget.tabIndex())

break

# Clear all parameters
self.fParameterToUpdate = []


def reloadAll(self): def reloadAll(self):
self.fPluginInfo = Carla.host.get_plugin_info(self.fPluginId) self.fPluginInfo = Carla.host.get_plugin_info(self.fPluginId)
@@ -1499,16 +1470,18 @@ class PluginEdit(QDialog):
self.reloadParameters() self.reloadParameters()
self.reloadPrograms() self.reloadPrograms()


if not self.ui.scrollArea.isEnabled():
self.resize(self.width(), self.height()-self.ui.keyboard.height())

def reloadInfo(self): def reloadInfo(self):
pluginName = cString(Carla.host.get_real_plugin_name(self.fPluginId)) pluginName = cString(Carla.host.get_real_plugin_name(self.fPluginId))
pluginType = self.fPluginInfo['type'] pluginType = self.fPluginInfo['type']
pluginHints = self.fPluginInfo['hints'] pluginHints = self.fPluginInfo['hints']


# Automatically change to MidiProgram tab
if pluginType != PLUGIN_VST and not self.ui.le_name.text():
self.ui.tab_programs.setCurrentIndex(1)
audioCountInfo = Carla.host.get_audio_port_count_info(self.fPluginId)
midiCountInfo = Carla.host.get_midi_port_count_info(self.fPluginId)
paramCountInfo = Carla.host.get_parameter_count_info(self.fPluginId)


# Set Meta-Data
if pluginType == PLUGIN_INTERNAL: if pluginType == PLUGIN_INTERNAL:
self.ui.le_type.setText(self.tr("Internal")) self.ui.le_type.setText(self.tr("Internal"))
elif pluginType == PLUGIN_LADSPA: elif pluginType == PLUGIN_LADSPA:
@@ -1538,17 +1511,16 @@ class PluginEdit(QDialog):
self.ui.le_copyright.setToolTip(self.fPluginInfo['copyright']) self.ui.le_copyright.setToolTip(self.fPluginInfo['copyright'])
self.ui.le_unique_id.setText(str(self.fPluginInfo['uniqueId'])) self.ui.le_unique_id.setText(str(self.fPluginInfo['uniqueId']))
self.ui.le_unique_id.setToolTip(str(self.fPluginInfo['uniqueId'])) self.ui.le_unique_id.setToolTip(str(self.fPluginInfo['uniqueId']))
self.ui.label_plugin.setText("\n%s\n" % self.fPluginInfo['name'])
self.setWindowTitle(self.fPluginInfo['name'])

# Set Processing Data
audioCountInfo = Carla.host.get_audio_port_count_info(self.fPluginId)
midiCountInfo = Carla.host.get_midi_port_count_info(self.fPluginId)
paramCountInfo = Carla.host.get_parameter_count_info(self.fPluginId)

self.ui.le_ains.setText(str(audioCountInfo['ins'])) self.ui.le_ains.setText(str(audioCountInfo['ins']))
self.ui.le_aouts.setText(str(audioCountInfo['outs'])) self.ui.le_aouts.setText(str(audioCountInfo['outs']))
self.ui.le_params.setText(str(paramCountInfo['ins'])) self.ui.le_params.setText(str(paramCountInfo['ins']))
self.ui.label_plugin.setText("\n%s\n" % self.fPluginInfo['name'])
self.setWindowTitle(self.fPluginInfo['name'])

if self.fPluginInfo['latency'] > 0:
self.ui.le_latency.setText("%i samples" % self.fPluginInfo['latency'])
else:
self.ui.le_latency.setText(self.tr("None"))


self.ui.dial_drywet.setEnabled(pluginHints & PLUGIN_CAN_DRYWET) self.ui.dial_drywet.setEnabled(pluginHints & PLUGIN_CAN_DRYWET)
self.ui.dial_vol.setEnabled(pluginHints & PLUGIN_CAN_VOLUME) self.ui.dial_vol.setEnabled(pluginHints & PLUGIN_CAN_VOLUME)
@@ -1556,7 +1528,9 @@ class PluginEdit(QDialog):
self.ui.dial_b_right.setEnabled(pluginHints & PLUGIN_CAN_BALANCE) self.ui.dial_b_right.setEnabled(pluginHints & PLUGIN_CAN_BALANCE)


# Show/hide keyboard # Show/hide keyboard
self.ui.scrollArea.setVisible((pluginHints & PLUGIN_IS_SYNTH) != 0 or (midiCountInfo['ins'] > 0 < midiCountInfo['outs']))
showKeyboard = (pluginHints & PLUGIN_IS_SYNTH) != 0 or (midiCountInfo['ins'] > 0 < midiCountInfo['outs'])
self.ui.scrollArea.setEnabled(showKeyboard)
self.ui.scrollArea.setVisible(showKeyboard)


# Force-Update parent for new hints (knobs) # Force-Update parent for new hints (knobs)
if self.fRealParent: if self.fRealParent:
@@ -1680,7 +1654,7 @@ class PluginEdit(QDialog):
'hints': 0, 'hints': 0,
'name': fakeName, 'name': fakeName,
'unit': "", 'unit': "",
'scalepoints': [],
'scalePoints': [],


'index': 0, 'index': 0,
'default': 0, 'default': 0,
@@ -1748,21 +1722,32 @@ class PluginEdit(QDialog):


self.ui.cb_midi_programs.blockSignals(False) self.ui.cb_midi_programs.blockSignals(False)


# Automatically change to Midi Programs tab
if midiProgramCount > 0 and programCount == 0:
self.ui.tab_programs.setCurrentIndex(1)

def updateInfo(self):
# Update current program text
if self.ui.cb_programs.count() > 0:
pIndex = self.ui.cb_programs.currentIndex()
pName = cString(Carla.host.get_program_name(self.fPluginId, pIndex))
self.ui.cb_programs.setItemText(pIndex, pName)

# Update current midi program text
if self.ui.cb_midi_programs.count() > 0:
mpIndex = self.ui.cb_midi_programs.currentIndex()
mpData = Carla.host.get_midi_program_data(self.fPluginId, mpIndex)
mpBank = int(mpData['bank'])
mpProg = int(mpData['program'])
mpLabel = cString(mpData['label'])
self.ui.cb_midi_programs.setItemText(mpIndex, "%03i:%03i - %s" % (mpBank, mpProg, mpLabel))

# Update all parameter values
for paramType, paramId, paramWidget in self.fParameterList:
paramWidget.setValue(Carla.host.get_current_parameter_value(self.fPluginId, paramId), False)
paramWidget.update()

def setParameterValue(self, parameterId, value): def setParameterValue(self, parameterId, value):
#if parameterId == PARAMETER_ACTIVE:
#pass
#elif parameterId == PARAMETER_DRYWET:
#self.ui.dial_drywet.setValue(value * 1000, True, False)
#elif parameterId == PARAMETER_VOLUME:
#self.ui.dial_vol.setValue(value * 1000, True, False)
#elif parameterId == PARAMETER_BALANCE_LEFT:
#self.ui.dial_b_left.setValue(value * 1000, True, False)
#elif parameterId == PARAMETER_BALANCE_RIGHT:
#self.ui.dial_b_right.setValue(value * 1000, True, False)
#elif parameterId == PARAMETER_PANNING:
##self.ui.dial_pan.setValue(value * 1000, True, False)
#pass
#elif parameterId >= 0:
for paramItem in self.fParameterToUpdate: for paramItem in self.fParameterToUpdate:
if paramItem[0] == parameterId: if paramItem[0] == parameterId:
paramItem[1] = value paramItem[1] = value
@@ -1779,6 +1764,76 @@ class PluginEdit(QDialog):


QDialog.setVisible(self, yesNo) QDialog.setVisible(self, yesNo)


def idleSlow(self):
# Check Tab icons
for i in range(len(self.fTabIconTimers)):
if self.fTabIconTimers[i] == ICON_STATE_ON:
self.fTabIconTimers[i] = ICON_STATE_WAIT
elif self.fTabIconTimers[i] == ICON_STATE_WAIT:
self.fTabIconTimers[i] = ICON_STATE_OFF
elif self.fTabIconTimers[i] == ICON_STATE_OFF:
self.fTabIconTimers[i] = ICON_STATE_NULL
self.ui.tabWidget.setTabIcon(i+1, self.fTabIconOff)

# Check parameters needing update
for index, value in self.fParameterToUpdate:
if index == PARAMETER_DRYWET:
self.ui.dial_drywet.setValue(value * 1000, True, False)
elif index == PARAMETER_VOLUME:
self.ui.dial_vol.setValue(value * 1000, True, False)
elif index == PARAMETER_BALANCE_LEFT:
self.ui.dial_b_left.setValue(value * 1000, True, False)
elif index == PARAMETER_BALANCE_RIGHT:
self.ui.dial_b_right.setValue(value * 1000, True, False)
elif index == PARAMETER_PANNING:
pass #self.ui.dial_pan.setValue(value * 1000, True, False)
elif index >= 0:
for paramType, paramId, paramWidget in self.fParameterList:
if paramId == index:
paramWidget.setValue(value, False)

if paramType == PARAMETER_INPUT:
tabIndex = paramWidget.tabIndex()

if self.fTabIconTimers[tabIndex-1] == ICON_STATE_NULL:
self.ui.tabWidget.setTabIcon(tabIndex, self.fTabIconOn)

self.fTabIconTimers[tabIndex-1] = ICON_STATE_ON

break

# Clear all parameters
self.fParameterToUpdate = []

@pyqtSlot()
def slot_saveState(self):
if self.fCurrentStateFilename:
askTry = QMessageBox.question(self, self.tr("Overwrite?"), self.tr("Overwrite previously created file?"), QMessageBox.Ok|QMessageBox.Cancel)

if askTry == QMessageBox.Ok:
return #self.saveState()

self.fCurrentStateFilename = None

fileFilter = self.tr("Carla State File (*.carxs)")
filenameTry = QFileDialog.getSaveFileName(self, self.tr("Save Plugin State File"), filter=fileFilter)

if filenameTry:
if not filenameTry.endswith(".carxs"):
filenameTry += ".carxs"

self.fCurrentStateFilename = filenameTry
#self.saveState()

@pyqtSlot()
def slot_loadState(self):
fileFilter = self.tr("Carla State File (*.carxs)")
filenameTry = QFileDialog.getOpenFileName(self, self.tr("Open Plugin State File"), filter=fileFilter)

if filenameTry:
self.fCurrentStateFilename = filenameTry
#self.loadState()

@pyqtSlot(int) @pyqtSlot(int)
def slot_dryWetChanged(self, value): def slot_dryWetChanged(self, value):
Carla.host.set_drywet(self.fPluginId, float(value)/1000) Carla.host.set_drywet(self.fPluginId, float(value)/1000)
@@ -1804,12 +1859,12 @@ class PluginEdit(QDialog):
Carla.host.set_parameter_value(self.fPluginId, parameterId, value) Carla.host.set_parameter_value(self.fPluginId, parameterId, value)


@pyqtSlot(int, int) @pyqtSlot(int, int)
def slot_parameterMidiChannelChanged(self, parameterId, channel):
Carla.host.set_parameter_midi_channel(self.fPluginId, parameterId, channel-1)
def slot_parameterMidiControlChanged(self, parameterId, control):
Carla.host.set_parameter_midi_cc(self.fPluginId, parameterId, control)


@pyqtSlot(int, int) @pyqtSlot(int, int)
def slot_parameterMidiCcChanged(self, parameterId, cc):
Carla.host.set_parameter_midi_cc(self.fPluginId, parameterId, cc)
def slot_parameterMidiChannelChanged(self, parameterId, channel):
Carla.host.set_parameter_midi_channel(self.fPluginId, parameterId, channel-1)


@pyqtSlot(int) @pyqtSlot(int)
def slot_programIndexChanged(self, index): def slot_programIndexChanged(self, index):
@@ -1867,8 +1922,8 @@ class PluginEdit(QDialog):
if paramType == PARAMETER_INPUT: if paramType == PARAMETER_INPUT:
self.connect(paramWidget, SIGNAL("valueChanged(int, double)"), SLOT("slot_parameterValueChanged(int, double)")) self.connect(paramWidget, SIGNAL("valueChanged(int, double)"), SLOT("slot_parameterValueChanged(int, double)"))


self.connect(paramWidget, SIGNAL("midiControlChanged(int, int)"), SLOT("slot_parameterMidiControlChanged(int, int)"))
self.connect(paramWidget, SIGNAL("midiChannelChanged(int, int)"), SLOT("slot_parameterMidiChannelChanged(int, int)")) self.connect(paramWidget, SIGNAL("midiChannelChanged(int, int)"), SLOT("slot_parameterMidiChannelChanged(int, int)"))
self.connect(paramWidget, SIGNAL("midiCcChanged(int, int)"), SLOT("slot_parameterMidiCcChanged(int, int)"))


tabPageLayout.addStretch() tabPageLayout.addStretch()


@@ -3130,8 +3185,8 @@ class PluginDatabaseW(QDialog):


#ptest = { #ptest = {
#'index': 0, #'index': 0,
#'name': "",
#'symbol': "",
#'name': "Parameter",
#'symbol': "param",
#'current': 0.1, #'current': 0.1,
#'default': 0.3, #'default': 0.3,
#'minimum': 0.0, #'minimum': 0.0,
@@ -3140,7 +3195,7 @@ class PluginDatabaseW(QDialog):
#'midiCC': 2, #'midiCC': 2,
#'type': PARAMETER_INPUT, #'type': PARAMETER_INPUT,
#'hints': PARAMETER_IS_ENABLED | PARAMETER_IS_AUTOMABLE, #'hints': PARAMETER_IS_ENABLED | PARAMETER_IS_AUTOMABLE,
#'scalepoints': [],
#'scalePoints': [],
#'step': 0.01, #'step': 0.01,
#'stepSmall': 0.001, #'stepSmall': 0.001,
#'stepLarge': 0.1, #'stepLarge': 0.1,
@@ -3151,13 +3206,13 @@ class PluginDatabaseW(QDialog):
#app.setApplicationName("Carla") #app.setApplicationName("Carla")
#app.setApplicationVersion(VERSION) #app.setApplicationVersion(VERSION)
#app.setOrganizationName("falkTX") #app.setOrganizationName("falkTX")
#gui = CarlaAboutW(None)
#gui = PluginParameter(None, ptest, 0, 0)
##gui = CarlaAboutW(None)
##gui = PluginParameter(None, ptest, 0, 0)
#gui = PluginEdit(None, 0) #gui = PluginEdit(None, 0)
#gui = PluginWidget(None, 0)
#gui = PluginDatabaseW(None)
##gui = PluginWidget(None, 0)
##gui = PluginDatabaseW(None)
#gui.show() #gui.show()
#if gui.exec_():
#print(gui.fRetPlugin)
#gui = PluginRefreshW(None)
##if gui.exec_():
##print(gui.fRetPlugin)
##gui = PluginRefreshW(None)
#app.exec_() #app.exec_()

+ 0
- 8
source/utils/carla_backend_utils.hpp View File

@@ -55,10 +55,8 @@ const char* PluginType2Str(const PluginType& type)
{ {
case PLUGIN_NONE: case PLUGIN_NONE:
return "PLUGIN_NONE"; return "PLUGIN_NONE";
#ifndef BUILD_BRIDGE
case PLUGIN_INTERNAL: case PLUGIN_INTERNAL:
return "PLUGIN_INTERNAL"; return "PLUGIN_INTERNAL";
#endif
case PLUGIN_LADSPA: case PLUGIN_LADSPA:
return "PLUGIN_LADSPA"; return "PLUGIN_LADSPA";
case PLUGIN_DSSI: case PLUGIN_DSSI:
@@ -67,14 +65,12 @@ const char* PluginType2Str(const PluginType& type)
return "PLUGIN_LV2"; return "PLUGIN_LV2";
case PLUGIN_VST: case PLUGIN_VST:
return "PLUGIN_VST"; return "PLUGIN_VST";
#ifndef BUILD_BRIDGE
case PLUGIN_GIG: case PLUGIN_GIG:
return "PLUGIN_GIG"; return "PLUGIN_GIG";
case PLUGIN_SF2: case PLUGIN_SF2:
return "PLUGIN_SF2"; return "PLUGIN_SF2";
case PLUGIN_SFZ: case PLUGIN_SFZ:
return "PLUGIN_SFZ"; return "PLUGIN_SFZ";
#endif
} }


qWarning("CarlaBackend::PluginType2Str(%i) - invalid type", type); qWarning("CarlaBackend::PluginType2Str(%i) - invalid type", type);
@@ -343,10 +339,8 @@ const char* getPluginTypeString(const PluginType& type)
{ {
case PLUGIN_NONE: case PLUGIN_NONE:
return "NONE"; return "NONE";
#ifndef BUILD_BRIDGE
case PLUGIN_INTERNAL: case PLUGIN_INTERNAL:
return "INTERNAL"; return "INTERNAL";
#endif
case PLUGIN_LADSPA: case PLUGIN_LADSPA:
return "LADSPA"; return "LADSPA";
case PLUGIN_DSSI: case PLUGIN_DSSI:
@@ -355,14 +349,12 @@ const char* getPluginTypeString(const PluginType& type)
return "LV2"; return "LV2";
case PLUGIN_VST: case PLUGIN_VST:
return "VST"; return "VST";
#ifndef BUILD_BRIDGE
case PLUGIN_GIG: case PLUGIN_GIG:
return "GIG"; return "GIG";
case PLUGIN_SF2: case PLUGIN_SF2:
return "SF2"; return "SF2";
case PLUGIN_SFZ: case PLUGIN_SFZ:
return "SFZ"; return "SFZ";
#endif
} }


return "NONE"; return "NONE";


+ 10
- 4
source/widgets/paramspinbox.py View File

@@ -20,7 +20,7 @@
# Imports (Global) # Imports (Global)


from PyQt4.QtCore import pyqtSlot, Qt, QTimer, SIGNAL, SLOT from PyQt4.QtCore import pyqtSlot, Qt, QTimer, SIGNAL, SLOT
from PyQt4.QtGui import QAbstractSpinBox, QComboBox, QCursor, QDialog, QInputDialog, QMenu, QPainter, QProgressBar, QValidator
from PyQt4.QtGui import QAbstractSpinBox, QComboBox, QCursor, QDialog, QMenu, QProgressBar
#from PyQt4.QtGui import QStyleFactory #from PyQt4.QtGui import QStyleFactory
from math import isnan from math import isnan


@@ -71,12 +71,13 @@ class CustomInputDialog(QDialog):


self.fRetValue = current self.fRetValue = current


self.connect(self, SIGNAL("accepted()"), self.setReturnValue)
self.connect(self, SIGNAL("accepted()"), SLOT("slot_setReturnValue()"))


def returnValue(self): def returnValue(self):
return self.fRetValue return self.fRetValue


def setReturnValue(self):
@pyqtSlot()
def slot_setReturnValue(self):
self.fRetValue = self.ui.doubleSpinBox.value() self.fRetValue = self.ui.doubleSpinBox.value()


def done(self, r): def done(self, r):
@@ -189,6 +190,8 @@ class ParamSpinBox(QAbstractSpinBox):
self.fBar.setContextMenuPolicy(Qt.NoContextMenu) self.fBar.setContextMenuPolicy(Qt.NoContextMenu)
self.fBar.show() self.fBar.show()


self.fName = ""

self.lineEdit().setVisible(False) self.lineEdit().setVisible(False)


self.connect(self, SIGNAL("customContextMenuRequested(QPoint)"), SLOT("slot_showCustomMenu()")) self.connect(self, SIGNAL("customContextMenuRequested(QPoint)"), SLOT("slot_showCustomMenu()"))
@@ -260,6 +263,9 @@ class ParamSpinBox(QAbstractSpinBox):
def setLabel(self, label): def setLabel(self, label):
self.fBar.setLabel(label) self.fBar.setLabel(label)


def setName(self, name):
self.fName = name

def setTextCallback(self, textCall): def setTextCallback(self, textCall):
self.fBar.setTextCall(textCall) self.fBar.setTextCall(textCall)


@@ -375,7 +381,7 @@ class ParamSpinBox(QAbstractSpinBox):
actSel = menu.exec_(QCursor.pos()) actSel = menu.exec_(QCursor.pos())


if actSel == actSet: if actSel == actSet:
dialog = CustomInputDialog(self, self.parent().label.text(), self.fValue, self.fMinimum, self.fMaximum, self.fStep, self.fScalePoints)
dialog = CustomInputDialog(self, self.fName, self.fValue, self.fMinimum, self.fMaximum, self.fStep, self.fScalePoints)
if dialog.exec_(): if dialog.exec_():
value = dialog.returnValue() value = dialog.returnValue()
self.setValue(value) self.setValue(value)


Loading…
Cancel
Save