UI Label fix (and 'verbose' transpose)

pull/1/head
asb2m10 10 years ago
parent 0d382416c3
commit 74bd4fa6b9
  1. 5178
      Builds/MacOSX/Dexed.xcodeproj/project.pbxproj
  2. BIN
      Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate
  3. 7
      README.md
  4. 9
      Source/DXComponents.cpp
  5. 70
      Source/PluginParam.cpp
  6. 2
      Source/PluginParam.h

File diff suppressed because it is too large Load Diff

@ -35,6 +35,13 @@ new version here but you see it in the change log, it's because this version is
Changelog Changelog
--------- ---------
#### Version 0.8.1
* Apple AU support
* Basic theming
* Fixed the UI corruption when more than one Dexed instance was loaded
#### Version 0.8.0 #### Version 0.8.0
* New UI by [AZur Studio](http://bji.yukihotaru.com/) * New UI by [AZur Studio](http://bji.yukihotaru.com/)
* You can now copy/paste the operator/envelopes values by using the right-click mouse button on the operator * You can now copy/paste the operator/envelopes values by using the right-click mouse button on the operator

@ -351,11 +351,17 @@ void LcdDisplay::paint(Graphics &g) {
void ComboBoxImage::paint(Graphics &g) { void ComboBoxImage::paint(Graphics &g) {
int idx = getSelectedItemIndex(); int idx = getSelectedItemIndex();
if ( itemPos[0] != -1 ) {
if ( idx < 4 )
idx = itemPos[idx];
}
g.drawImage(items, 0, 0, items.getWidth(), itemHeight, 0, idx * itemHeight, items.getWidth(), itemHeight); g.drawImage(items, 0, 0, items.getWidth(), itemHeight, 0, idx * itemHeight, items.getWidth(), itemHeight);
} }
ComboBoxImage::ComboBoxImage() { ComboBoxImage::ComboBoxImage() {
onPopup = false; onPopup = false;
itemPos[0] = -1;
} }
void ComboBoxImage::showPopup() { void ComboBoxImage::showPopup() {
@ -391,6 +397,9 @@ void ComboBoxImage::setImage(Image image, int pos[]) {
Image tmp = image.getClippedImage(Rectangle<int>(0,itemHeight*pos[i], image.getWidth(), itemHeight)); Image tmp = image.getClippedImage(Rectangle<int>(0,itemHeight*pos[i], image.getWidth(), itemHeight));
popup.addItem(i+1, getItemText(i), true, false, tmp); popup.addItem(i+1, getItemText(i), true, false, tmp);
} }
for(int i=0;i<4;i++)
itemPos[i] = pos[i];
} }
void ProgramSelector::setInit() { void ProgramSelector::setInit() {

@ -25,6 +25,51 @@
#include "PluginEditor.h" #include "PluginEditor.h"
#include "Dexed.h" #include "Dexed.h"
// ************************************************************************
// Custom displays
class CtrlDXLabel : public CtrlDX {
public:
StringArray labels;
CtrlDXLabel(String name, int steps, int offset) : CtrlDX(name, steps, offset, 0) {
};
String getValueDisplay() {
return labels[getValue()];
}
};
class CtrlDXTranspose : public CtrlDX {
public:
CtrlDXTranspose(String name, int steps, int offset) : CtrlDX(name, steps, offset, 0) {
};
String getValueDisplay() {
String ret;
int value = getValue();
if ( value == 48 )
value = 47;
switch(value % 12) {
case 0: ret << "C"; break;
case 1: ret << "C#"; break;
case 2: ret << "D"; break;
case 3: ret << "D#"; break;
case 4: ret << "E"; break;
case 5: ret << "F"; break;
case 6: ret << "F#"; break;
case 7: ret << "G"; break;
case 8: ret << "G#"; break;
case 9: ret << "A"; break;
case 10: ret << "A#"; break;
case 11: ret << "B"; break;
}
return ret << (value/12-2);
}
};
// ************************************************************************ // ************************************************************************
// //
Ctrl::Ctrl(String name) { Ctrl::Ctrl(String name) {
@ -266,10 +311,17 @@ void DexedAudioProcessor::initCtrl() {
lfoSync = new CtrlDX("LFO KEY SYNC", 2, 141); lfoSync = new CtrlDX("LFO KEY SYNC", 2, 141);
ctrl.add(lfoSync); ctrl.add(lfoSync);
lfoWaveform = new CtrlDX("LFO WAVE", 6, 142); CtrlDXLabel *t = new CtrlDXLabel("LFO WAVE", 6, 142);
t->labels.add("TRIANGE");
t->labels.add("SAW DOWN");
t->labels.add("SAW UP");
t->labels.add("SQUARE");
t->labels.add("SINE");
t->labels.add("S&HOLD");
lfoWaveform = t;
ctrl.add(lfoWaveform); ctrl.add(lfoWaveform);
transpose = new CtrlDX("MIDDLE C", 49, 144); transpose = new CtrlDXTranspose("MIDDLE C", 49, 144);
ctrl.add(transpose); ctrl.add(transpose);
pitchModSens = new CtrlDX("P MODE SENS.", 8, 143); pitchModSens = new CtrlDX("P MODE SENS.", 8, 143);
@ -289,6 +341,12 @@ void DexedAudioProcessor::initCtrl() {
ctrl.add(pitchEgLevel[i]); ctrl.add(pitchEgLevel[i]);
} }
StringArray keyScaleLabels;
keyScaleLabels.add("-LN");
keyScaleLabels.add("-EX");
keyScaleLabels.add("+EX");
keyScaleLabels.add("+LN");
// fill operator values; // fill operator values;
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
//// In the Sysex, OP6 comes first, then OP5... //// In the Sysex, OP6 comes first, then OP5...
@ -353,12 +411,16 @@ void DexedAudioProcessor::initCtrl() {
String sclLeftCurve; String sclLeftCurve;
sclLeftCurve << opName << " L KEY SCALE"; sclLeftCurve << opName << " L KEY SCALE";
opCtrl[opVal].sclLeftCurve = new CtrlDX(sclLeftCurve, 4, opTarget + 11); t = new CtrlDXLabel(sclLeftCurve, 4, opTarget + 11);
t->labels = keyScaleLabels;
opCtrl[opVal].sclLeftCurve = t;
ctrl.add(opCtrl[opVal].sclLeftCurve); ctrl.add(opCtrl[opVal].sclLeftCurve);
String sclRightCurve; String sclRightCurve;
sclRightCurve << opName << " R KEY SCALE"; sclRightCurve << opName << " R KEY SCALE";
opCtrl[opVal].sclRightCurve = new CtrlDX(sclRightCurve, 4, opTarget + 12); t = new CtrlDXLabel(sclRightCurve, 4, opTarget + 12);
t->labels = keyScaleLabels;
opCtrl[opVal].sclRightCurve = t;
ctrl.add(opCtrl[opVal].sclRightCurve); ctrl.add(opCtrl[opVal].sclRightCurve);
String sclRate; String sclRate;

@ -93,8 +93,8 @@ public:
void setValue(int value); void setValue(int value);
int getValue(); int getValue();
String getValueDisplay();
int getOffset(); int getOffset();
String getValueDisplay();
void sliderValueChanged (Slider* moved); void sliderValueChanged (Slider* moved);
void comboBoxChanged (ComboBox* combo); void comboBoxChanged (ComboBox* combo);

Loading…
Cancel
Save