Browse Source

Remove leftover csound option in UI; Fix params division by 0

tags/1.9.4
falkTX 11 years ago
parent
commit
5868bca525
5 changed files with 60 additions and 67 deletions
  1. +40
    -47
      resources/ui/carla_database.ui
  2. +0
    -7
      resources/ui/carla_refresh.ui
  3. +0
    -5
      resources/ui/carla_settings.ui
  4. +1
    -1
      source/carla_widgets.py
  5. +19
    -7
      source/widgets/paramspinbox.py

+ 40
- 47
resources/ui/carla_database.ui View File

@@ -61,94 +61,94 @@
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="1">
<widget class="QCheckBox" name="ch_other">
<item row="0" column="1">
<widget class="QCheckBox" name="ch_effects">
<property name="text">
<string>Other/Misc</string>
<string>Effects</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="ch_lv2">
<item row="2" column="2">
<widget class="QCheckBox" name="ch_bridged_wine">
<property name="text">
<string>LV2</string>
<string>Bridged (Wine)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="ch_instruments">
<item row="0" column="0">
<widget class="QCheckBox" name="ch_internal">
<property name="text">
<string>Instruments</string>
<string>Internal</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="ch_bridged">
<item row="6" column="0">
<widget class="QCheckBox" name="ch_au">
<property name="text">
<string>Bridged</string>
<string>AudioUnits</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QCheckBox" name="ch_rtsafe">
<item row="1" column="0">
<widget class="QCheckBox" name="ch_ladspa">
<property name="text">
<string>Real-time safe only</string>
<string>LADSPA</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="ch_dssi">
<item row="4" column="2">
<widget class="QCheckBox" name="ch_stereo">
<property name="text">
<string>DSSI</string>
<string>Stereo only</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="ch_native">
<item row="3" column="1">
<widget class="QCheckBox" name="ch_other">
<property name="text">
<string>Native</string>
<string>Other/Misc</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="ch_effects">
<item row="3" column="0">
<widget class="QCheckBox" name="ch_lv2">
<property name="text">
<string>Effects</string>
<string>LV2</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="ch_bridged_wine">
<item row="1" column="1">
<widget class="QCheckBox" name="ch_instruments">
<property name="text">
<string>Bridged (Wine)</string>
<string>Instruments</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="ch_internal">
<item row="1" column="2">
<widget class="QCheckBox" name="ch_bridged">
<property name="text">
<string>Internal</string>
<string>Bridged</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="ch_au">
<item row="3" column="2">
<widget class="QCheckBox" name="ch_rtsafe">
<property name="text">
<string>AudioUnits</string>
<string>Real-time safe only</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="ch_ladspa">
<item row="2" column="0">
<widget class="QCheckBox" name="ch_dssi">
<property name="text">
<string>LADSPA</string>
<string>DSSI</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QCheckBox" name="ch_stereo">
<item row="0" column="2">
<widget class="QCheckBox" name="ch_native">
<property name="text">
<string>Stereo only</string>
<string>Native</string>
</property>
</widget>
</item>
@@ -166,20 +166,13 @@
</property>
</widget>
</item>
<item row="8" column="0">
<item row="7" column="0">
<widget class="QCheckBox" name="ch_kits">
<property name="text">
<string>Sound Kits</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="ch_csound">
<property name="text">
<string>CSound modules</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="ch_vst3">
<property name="text">


+ 0
- 7
resources/ui/carla_refresh.ui View File

@@ -98,13 +98,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_csound">
<property name="text">
<string>CSD</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ch_gig">
<property name="text">


+ 0
- 5
resources/ui/carla_settings.ui View File

@@ -1111,11 +1111,6 @@ This mode is not available for VST plugins.</string>
<string>AU</string>
</property>
</item>
<item>
<property name="text">
<string>CSound</string>
</property>
</item>
<item>
<property name="text">
<string>GIG</string>


+ 1
- 1
source/carla_widgets.py View File

@@ -810,7 +810,7 @@ class PluginEdit(QDialog):
'index': 0,
'default': 0.0,
'minimum': 0.0,
'maximum': 0.0,
'maximum': 1.0,
'step': 0.0,
'stepSmall': 0.0,
'stepLarge': 0.0,


+ 19
- 7
source/widgets/paramspinbox.py View File

@@ -43,15 +43,15 @@ import ui_inputdialog_value
# ------------------------------------------------------------------------------------------------------------
# Get a fixed value within min/max bounds

def geFixedValue(value, minimum, maximum):
def geFixedValue(name, value, minimum, maximum):
if isnan(value):
print("Parameter is NaN! - %f" % value)
print("Parameter '%s' is NaN! - %f" % (name, value))
return minimum
if value < minimum:
print("Parameter too low! - %f/%f" % (value, minimum))
print("Parameter '%s' too low! - %f/%f" % (name, value, minimum))
return minimum
if value > maximum:
print("Parameter too high! - %f/%f" % (value, maximum))
print("Parameter '%s' too high! - %f/%f" % (name, value, maximum))
return maximum
return value

@@ -114,6 +114,7 @@ class ParamProgressBar(QProgressBar):
self.fRealValue = 0.0

self.fLabel = ""
self.fName = ""
self.fPreLabel = " "
self.fTextCall = None

@@ -132,7 +133,14 @@ class ParamProgressBar(QProgressBar):

def setValue(self, value):
self.fRealValue = value
vper = float(value - self.fMinimum) / float(self.fMaximum - self.fMinimum)
div = float(self.fMaximum - self.fMinimum)

if div == 0.0:
print("Parameter '%s' division by 0 prevented (value:%f, min:%f, max:%f)" % (self.fName, value, self.fMaximum, self.fMinimum))
vper = 1.0
else:
vper = float(value - self.fMinimum) / div

QProgressBar.setValue(self, int(vper * 10000))

def setLabel(self, label):
@@ -144,6 +152,9 @@ class ParamProgressBar(QProgressBar):

self.update()

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

def setTextCall(self, textCall):
self.fTextCall = textCall

@@ -224,7 +235,7 @@ class ParamSpinBox(QAbstractSpinBox):
QTimer.singleShot(0, self.slot_updateProgressBarGeometry)

def setDefault(self, value):
value = geFixedValue(value, self.fMinimum, self.fMaximum)
value = geFixedValue(self.fName, value, self.fMinimum, self.fMaximum)
self.fDefault = value

def setMinimum(self, value):
@@ -236,7 +247,7 @@ class ParamSpinBox(QAbstractSpinBox):
self.fBar.setMaximum(value)

def setValue(self, value, send=True):
value = geFixedValue(value, self.fMinimum, self.fMaximum)
value = geFixedValue(self.fName, value, self.fMinimum, self.fMaximum)

if self.fValue == value:
return False
@@ -290,6 +301,7 @@ class ParamSpinBox(QAbstractSpinBox):

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

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


Loading…
Cancel
Save