Browse Source

Proper Vex param names

tags/1.9.4
falkTX 11 years ago
parent
commit
80dd8f869a
3 changed files with 56 additions and 49 deletions
  1. +0
    -1
      source/backend/plugin/NativePlugin.cpp
  2. +52
    -47
      source/modules/carla_native/vex-synth.cpp
  3. +4
    -1
      source/modules/carla_native/vex/gui/SnappingSlider.h

+ 0
- 1
source/backend/plugin/NativePlugin.cpp View File

@@ -405,7 +405,6 @@ public:
std::strncpy(strBuf, param->unit, STR_MAX); std::strncpy(strBuf, param->unit, STR_MAX);
return; return;
} }
carla_assert("param->unit != nullptr", __FILE__, __LINE__);
return CarlaPlugin::getParameterUnit(parameterId, strBuf); return CarlaPlugin::getParameterUnit(parameterId, strBuf);
} }




+ 52
- 47
source/modules/carla_native/vex-synth.cpp View File

@@ -16,6 +16,7 @@
*/ */


#include "CarlaNative.hpp" #include "CarlaNative.hpp"
#include "CarlaString.hpp"


#include "JucePluginWindow.hpp" #include "JucePluginWindow.hpp"


@@ -93,7 +94,7 @@ public:
internalCachedImage1 = ImageCache::getFromMemory(Resources::vex3_png, Resources::vex3_pngSize); internalCachedImage1 = ImageCache::getFromMemory(Resources::vex3_png, Resources::vex3_pngSize);


// Comboboxes, wave selection // Comboboxes, wave selection
addAndMakeVisible(comboBox1 = new ComboBox (String::empty));
addAndMakeVisible(comboBox1 = new ComboBox("comboBox1"));
comboBox1->setEditableText(false); comboBox1->setEditableText(false);
comboBox1->setJustificationType(Justification::centredLeft); comboBox1->setJustificationType(Justification::centredLeft);
comboBox1->setTextWhenNothingSelected(String("silent")); comboBox1->setTextWhenNothingSelected(String("silent"));
@@ -106,7 +107,7 @@ public:
comboBox1->setWantsKeyboardFocus(false); comboBox1->setWantsKeyboardFocus(false);
comboBox1->setLookAndFeel(&mlaf); comboBox1->setLookAndFeel(&mlaf);


addAndMakeVisible(comboBox2 = new ComboBox (String::empty));
addAndMakeVisible(comboBox2 = new ComboBox("comboBox2"));
comboBox2->setEditableText(false); comboBox2->setEditableText(false);
comboBox2->setJustificationType(Justification::centredLeft); comboBox2->setJustificationType(Justification::centredLeft);
comboBox2->setTextWhenNothingSelected(String("silent")); comboBox2->setTextWhenNothingSelected(String("silent"));
@@ -119,7 +120,7 @@ public:
comboBox2->setWantsKeyboardFocus(false); comboBox2->setWantsKeyboardFocus(false);
comboBox2->setLookAndFeel(&mlaf); comboBox2->setLookAndFeel(&mlaf);


addAndMakeVisible(comboBox3 = new ComboBox(String::empty));
addAndMakeVisible(comboBox3 = new ComboBox("comboBox3"));
comboBox3->setEditableText(false); comboBox3->setEditableText(false);
comboBox3->setJustificationType(Justification::centredLeft); comboBox3->setJustificationType(Justification::centredLeft);
comboBox3->setTextWhenNothingSelected(String("silent")); comboBox3->setTextWhenNothingSelected(String("silent"));
@@ -191,7 +192,7 @@ public:
sliders[82]->setSnap(0.0f, 0.05f); sliders[82]->setSnap(0.0f, 0.05f);


//PART ON/OFF //PART ON/OFF
addAndMakeVisible(TB1 = new TextButton ("new button"));
addAndMakeVisible(TB1 = new TextButton("TB1"));
TB1->setButtonText(String::empty); TB1->setButtonText(String::empty);
TB1->addListener(this); TB1->addListener(this);
TB1->setColour(TextButton::buttonColourId, Colours::darkred.withAlpha(0.5f)); TB1->setColour(TextButton::buttonColourId, Colours::darkred.withAlpha(0.5f));
@@ -199,7 +200,7 @@ public:
TB1->setClickingTogglesState(true); TB1->setClickingTogglesState(true);
TB1->setToggleState(false, dontSendNotification); TB1->setToggleState(false, dontSendNotification);


addAndMakeVisible(TB2 = new TextButton ("new button"));
addAndMakeVisible(TB2 = new TextButton("TB2"));
TB2->setButtonText(String::empty); TB2->setButtonText(String::empty);
TB2->addListener(this); TB2->addListener(this);
TB2->setColour(TextButton::buttonColourId, Colours::darkred.withAlpha(0.5f)); TB2->setColour(TextButton::buttonColourId, Colours::darkred.withAlpha(0.5f));
@@ -207,7 +208,7 @@ public:
TB2->setClickingTogglesState(true); TB2->setClickingTogglesState(true);
TB2->setToggleState(false, dontSendNotification); TB2->setToggleState(false, dontSendNotification);


addAndMakeVisible(TB3 = new TextButton ("new button"));
addAndMakeVisible(TB3 = new TextButton("TB3"));
TB3->setButtonText(String::empty); TB3->setButtonText(String::empty);
TB3->addListener(this); TB3->addListener(this);
TB3->setColour(TextButton::buttonColourId, Colours::darkred.withAlpha(0.5f)); TB3->setColour(TextButton::buttonColourId, Colours::darkred.withAlpha(0.5f));
@@ -216,7 +217,7 @@ public:
TB3->setToggleState(false, dontSendNotification); TB3->setToggleState(false, dontSendNotification);


//Peggy ON/OFF //Peggy ON/OFF
addAndMakeVisible(TB4 = new TextButton ("new button"));
addAndMakeVisible(TB4 = new TextButton("TB4"));
TB4->setButtonText(String::empty); TB4->setButtonText(String::empty);
TB4->addListener(this); TB4->addListener(this);
TB4->setColour(TextButton::buttonColourId, Colours::darkblue.withAlpha(0.5f)); TB4->setColour(TextButton::buttonColourId, Colours::darkblue.withAlpha(0.5f));
@@ -224,7 +225,7 @@ public:
TB4->setClickingTogglesState(true); TB4->setClickingTogglesState(true);
TB4->setToggleState(false, dontSendNotification); TB4->setToggleState(false, dontSendNotification);


addAndMakeVisible(TB5 = new TextButton ("new button"));
addAndMakeVisible(TB5 = new TextButton("TB5"));
TB5->setButtonText(String::empty); TB5->setButtonText(String::empty);
TB5->addListener(this); TB5->addListener(this);
TB5->setColour(TextButton::buttonColourId, Colours::darkblue.withAlpha(0.5f)); TB5->setColour(TextButton::buttonColourId, Colours::darkblue.withAlpha(0.5f));
@@ -232,7 +233,7 @@ public:
TB5->setClickingTogglesState(true); TB5->setClickingTogglesState(true);
TB5->setToggleState(false, dontSendNotification); TB5->setToggleState(false, dontSendNotification);


addAndMakeVisible(TB6 = new TextButton ("new button"));
addAndMakeVisible(TB6 = new TextButton("TB6"));
TB6->setButtonText(String::empty); TB6->setButtonText(String::empty);
TB6->addListener(this); TB6->addListener(this);
TB6->setColour(TextButton::buttonColourId, Colours::darkblue.withAlpha(0.5f)); TB6->setColour(TextButton::buttonColourId, Colours::darkblue.withAlpha(0.5f));
@@ -628,6 +629,7 @@ protected:


const Parameter* getParameterInfo(const uint32_t index) const override const Parameter* getParameterInfo(const uint32_t index) const override
{ {
static CarlaString tmpName;
static Parameter paramInfo; static Parameter paramInfo;


int hints = PARAMETER_IS_ENABLED|PARAMETER_IS_AUTOMABLE; int hints = PARAMETER_IS_ENABLED|PARAMETER_IS_AUTOMABLE;
@@ -650,107 +652,110 @@ protected:
switch (ri) switch (ri)
{ {
case 1: case 1:
paramInfo.name = "oct";
tmpName = "Part0 Oct";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 2: case 2:
paramInfo.name = "cent";
tmpName = "Part0 Cent";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 3: case 3:
paramInfo.name = "phaseOffset";
tmpName = "Part0 Phase";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 4: case 4:
paramInfo.name = "phaseIncOffset";
tmpName = "Part0 Tune";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 5: case 5:
paramInfo.name = "filter";
tmpName = "Part0 Filter Cut";
paramInfo.ranges.def = 0.9f; paramInfo.ranges.def = 0.9f;
break; break;
case 6: case 6:
paramInfo.name = "filter";
tmpName = "Part0 Filter Res";
paramInfo.ranges.def = 0.0f; paramInfo.ranges.def = 0.0f;
break; break;
case 7: case 7:
paramInfo.name = "filter";
tmpName = "Part0 Filter HP/LP";
paramInfo.ranges.def = 1.0f; paramInfo.ranges.def = 1.0f;
break; break;
case 8: case 8:
paramInfo.name = "filter";
tmpName = "Part0 Filter Env";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 9: case 9:
paramInfo.name = "F ADSR";
tmpName = "Part0 Filter Env Atk";
paramInfo.ranges.def = 0.0f; paramInfo.ranges.def = 0.0f;
break; break;
case 10: case 10:
paramInfo.name = "F ADSR";
tmpName = "Part0 Filter Env Dec";
paramInfo.ranges.def = 0.2f; paramInfo.ranges.def = 0.2f;
break; break;
case 11: case 11:
paramInfo.name = "F ADSR";
tmpName = "Part0 Filter Env Sus";
paramInfo.ranges.def = 0.0f; paramInfo.ranges.def = 0.0f;
break; break;
case 12: case 12:
paramInfo.name = "F ADSR";
tmpName = "Part0 Filter Env Rel";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 13: case 13:
paramInfo.name = "F velocity";
tmpName = "Part0 Filter Env Vel";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 14: case 14:
paramInfo.name = "A ADSR";
tmpName = "Part0 Amp Env Atk";
paramInfo.ranges.def = 0.0f; paramInfo.ranges.def = 0.0f;
break; break;
case 15: case 15:
paramInfo.name = "A ADSR";
tmpName = "Part0 Amp Env Dec";
paramInfo.ranges.def = 0.3f; paramInfo.ranges.def = 0.3f;
break; break;
case 16: case 16:
paramInfo.name = "A ADSR";
tmpName = "Part0 Amp Env Sus";
paramInfo.ranges.def = 0.7f; paramInfo.ranges.def = 0.7f;
break; break;
case 17: case 17:
paramInfo.name = "A ADSR";
tmpName = "Part0 Amp Env Rel";
paramInfo.ranges.def = 0.1f; paramInfo.ranges.def = 0.1f;
break; break;
case 18: case 18:
paramInfo.name = "A velocity";
tmpName = "Part0 Amp Env Vel";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 19: case 19:
paramInfo.name = "lfoC";
tmpName = "Part0 LFO Rate";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 20: case 20:
paramInfo.name = "lfoA";
tmpName = "Part0 LFO Amp";
paramInfo.ranges.def = 0.0f; paramInfo.ranges.def = 0.0f;
break; break;
case 21: case 21:
paramInfo.name = "lfoF";
tmpName = "Part0 LFO Flt";
paramInfo.ranges.def = 0.0f; paramInfo.ranges.def = 0.0f;
break; break;
case 22: case 22:
paramInfo.name = "fx vol D";
tmpName = "Part0 Delay";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 23: case 23:
paramInfo.name = "fx vol C";
tmpName = "Part0 Chorus";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 24: case 24:
case 0: case 0:
paramInfo.name = "fx vol R";
tmpName = "Part0 Reverb";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
default: default:
paramInfo.name = "unknown2";
tmpName = "Part0 Unknown";
break; break;
} }


tmpName[4] = '0' + ((index+24) / 24);

paramInfo.name = (const char*)tmpName;
paramInfo.hints = static_cast<ParameterHints>(hints); paramInfo.hints = static_cast<ParameterHints>(hints);
return &paramInfo; return &paramInfo;
} }
@@ -758,7 +763,7 @@ protected:
switch (index) switch (index)
{ {
case 0: case 0:
paramInfo.name = "Main volume";
paramInfo.name = "Master";
paramInfo.ranges.def = 1.0f; paramInfo.ranges.def = 1.0f;
break; break;
case 73: case 73:
@@ -777,7 +782,7 @@ protected:
paramInfo.ranges.max = 100.0f; paramInfo.ranges.max = 100.0f;
break; break;
case 75: case 75:
paramInfo.name = "Delay Volume";
paramInfo.name = "Delay Level";
paramInfo.ranges.def = 0.0f; paramInfo.ranges.def = 0.0f;
break; break;
case 76: case 76:
@@ -789,7 +794,7 @@ protected:
paramInfo.ranges.def = 0.6f; paramInfo.ranges.def = 0.6f;
break; break;
case 78: case 78:
paramInfo.name = "Chorus Volume";
paramInfo.name = "Chorus Level";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 79: case 79:
@@ -805,46 +810,46 @@ protected:
paramInfo.ranges.def = 0.6f; paramInfo.ranges.def = 0.6f;
break; break;
case 82: case 82:
paramInfo.name = "Reverb Volume";
paramInfo.name = "Reverb Level";
paramInfo.ranges.def = 0.0f; paramInfo.ranges.def = 0.0f;
break; break;
case 83: case 83:
paramInfo.name = "Wave1 Panning";
paramInfo.name = "Part1 Panning";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 84: case 84:
paramInfo.name = "Wave2 Panning";
paramInfo.name = "Part2 Panning";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 85: case 85:
paramInfo.name = "Wave3 Panning";
paramInfo.name = "Part3 Panning";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 86: case 86:
paramInfo.name = "Wave1 Volume";
paramInfo.name = "Part1 Volume";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 87: case 87:
paramInfo.name = "Wave2 Volume";
paramInfo.name = "Part2 Volume";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 88: case 88:
paramInfo.name = "Wave3 Volume";
paramInfo.name = "Part3 Volume";
paramInfo.ranges.def = 0.5f; paramInfo.ranges.def = 0.5f;
break; break;
case 89: case 89:
hints |= PARAMETER_IS_BOOLEAN; hints |= PARAMETER_IS_BOOLEAN;
paramInfo.name = "Wave1 on/off";
paramInfo.name = "Part1 on/off";
paramInfo.ranges.def = 1.0f; paramInfo.ranges.def = 1.0f;
break; break;
case 90: case 90:
hints |= PARAMETER_IS_BOOLEAN; hints |= PARAMETER_IS_BOOLEAN;
paramInfo.name = "Wave2 on/off";
paramInfo.name = "Part2 on/off";
paramInfo.ranges.def = 0.0f; paramInfo.ranges.def = 0.0f;
break; break;
case 91: case 91:
hints |= PARAMETER_IS_BOOLEAN; hints |= PARAMETER_IS_BOOLEAN;
paramInfo.name = "Wave3 on/off";
paramInfo.name = "Part3 on/off";
paramInfo.ranges.def = 0.0f; paramInfo.ranges.def = 0.0f;
break; break;
default: default:


+ 4
- 1
source/modules/carla_native/vex/gui/SnappingSlider.h View File

@@ -61,12 +61,15 @@ public:
snapMargin = margin; snapMargin = margin;
} }
double snapValue(const double attemptedValue, const bool userIsDragging)
#if 0
// FIXME?
double snapValue(const double attemptedValue , const bool userIsDragging)
{ {
if (std::fabs(attemptedValue - snapTarget) < snapMargin) if (std::fabs(attemptedValue - snapTarget) < snapMargin)
return snapTarget; return snapTarget;
return attemptedValue; return attemptedValue;
} }
#endif
private: private:
float snapTarget, snapMargin; float snapTarget, snapMargin;


Loading…
Cancel
Save