Browse Source

Allow output/read-only params to go out of bounds

tags/v1.9.11
falkTX 6 years ago
parent
commit
7673150223
2 changed files with 10 additions and 3 deletions
  1. +3
    -2
      source/carla_widgets.py
  2. +7
    -1
      source/widgets/paramspinbox.py

+ 3
- 2
source/carla_widgets.py View File

@@ -202,11 +202,9 @@ class PluginParameter(QWidget):

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

self.ui.widget.setMinimum(pInfo['minimum'])
self.ui.widget.setMaximum(pInfo['maximum'])
self.ui.widget.setDefault(pInfo['default'])
self.ui.widget.setValue(pInfo['current'])
self.ui.widget.setLabel(pInfo['unit'])
self.ui.widget.setStep(pInfo['step'])
self.ui.widget.setStepSmall(pInfo['stepSmall'])
@@ -236,6 +234,9 @@ class PluginParameter(QWidget):
self.ui.sb_control.setVisible(False)
self.ui.sb_channel.setVisible(False)

# Only set value after all hints are handled
self.ui.widget.setValue(pInfo['current'])

if pHints & PARAMETER_USES_CUSTOM_TEXT and not host.isPlugin:
self.ui.widget.setTextCallback(self._textCallBack)



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

@@ -164,6 +164,11 @@ class ParamProgressBar(QProgressBar):
else:
vper = float(value - self.fMinimum) / div

if vper < 0.0:
vper = 0.0
elif vper > 1.0:
vper = 1.0

if self.fValueCall is not None:
self.fValueCall(value)

@@ -306,7 +311,8 @@ class ParamSpinBox(QAbstractSpinBox):
self.fBar.setMaximum(value)

def setValue(self, value):
value = geFixedValue(self.fName, value, self.fMinimum, self.fMaximum)
if not self.fIsReadOnly:
value = geFixedValue(self.fName, value, self.fMinimum, self.fMaximum)

if self.fBar.fIsInteger:
value = round(value)


Loading…
Cancel
Save