Popup cartridges

pull/1/head
asb2m10 11 years ago
parent 1d550a9d60
commit 55183f4a81
  1. BIN
      Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate
  2. 7
      Source/DXComponents.cpp
  3. 2
      Source/GlobalEditor.cpp
  4. 6
      Source/OperatorEditor.cpp
  5. 56
      Source/PluginEditor.cpp
  6. 5
      Source/PluginEditor.h

@ -194,7 +194,8 @@ void EnvDisplay::paint(Graphics &g) {
g.setColour(Colour(0xFFFFFFFF));
String len;
len << ((int) total);
len << ((int) total) << " / ";
len << ((int) vPos);
g.drawText(len, 5, 1, 72, 14, Justification::left, true);
}
@ -290,9 +291,9 @@ void LcdDisplay::paint(Graphics &g) {
g.setColour (Colours::white);
g.setFont (Font (Font::getDefaultMonospacedFontName(), 15.00f, Font::plain));
g.drawText (systemMsg,
4, 4, 300, 8,
7, 4, 300, 8,
Justification::centredLeft, true);
g.drawText (paramMsg,
4, 20, 300, 8,
7, 20, 300, 8,
Justification::centredLeft, true);
}

@ -173,7 +173,7 @@ GlobalEditor::GlobalEditor ()
//[Constructor] You can add your own custom stuff here..
lcdDisplay->systemMsg << "* DEXED DX synthesizer *";
lcdDisplay->systemMsg << "*** DEXED FM synthesizer ***";
//[/Constructor]
}

@ -241,8 +241,8 @@ void OperatorEditor::paint (Graphics& g)
//[UserPrePaint] Add your own custom painting code here..
//[/UserPrePaint]
g.setColour (Colour (0x41000000));
g.fillRect (-5, -8, 293, 100);
g.setColour (Colour (0x32000000));
g.fillRect (-5, -7, 293, 100);
//[UserPaint] Add your own custom painting code here..
//[/UserPaint]
@ -498,7 +498,7 @@ BEGIN_JUCER_METADATA
snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
fixedSize="1" initialWidth="280" initialHeight="90">
<BACKGROUND backgroundColour="ffffff">
<RECT pos="-5 -8 293 100" fill="solid: 41000000" hasStroke="0"/>
<RECT pos="-5 -7 293 100" fill="solid: 32000000" hasStroke="0"/>
</BACKGROUND>
<SLIDER name="egl1" id="dc070cc41347df47" memberName="s_egl1" virtualName=""
explicitFocusOrder="0" pos="136 40 24 24" min="0" max="99" int="1"

@ -36,43 +36,47 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner
setSize (866, 420);
processor = ownerFilter;
addAndMakeVisible(&cartridges);
cartridges.setEditableText(false);
cartridges.setJustificationType(Justification::centredLeft);
cartridges.setTextWhenNothingSelected(String::empty);
cartridges.setBounds(5, 5, 160, 18);
cartridges.addItemList(processor->cartManager.cartNames, 1);
cartridges.setSelectedItemIndex(0, NotificationType::dontSendNotification);
cartridges.addListener(this);
addAndMakeVisible (cartButton = new TextButton("CART"));
cartButton->setButtonText ("CART");
cartButton->addListener (this);
cartButton->setBounds(5, 6, 50, 18);
for(int i=0;i<processor->cartManager.cartNames.size();i++) {
cartPopup.addItem(i+1, processor->cartManager.cartNames[i]);
}
addAndMakeVisible (loadButton = new TextButton("LOAD"));
loadButton->setButtonText ("LOAD");
loadButton->addListener (this);
loadButton->setBounds(169, 5, 50, 18);
loadButton->setBounds(59, 6, 50, 18);
addAndMakeVisible(saveButton = new TextButton("SAVE"));
saveButton->setButtonText ("SAVE");
saveButton->addListener (this);
saveButton->setBounds (222, 5, 50, 18);
saveButton->setBounds (113, 6, 50, 18);
addAndMakeVisible (&programs);
programs.setEditableText (false);
programs.setJustificationType (Justification::centredLeft);
programs.setTextWhenNothingSelected (String::empty);
programs.setBounds(276, 5, 160, 18);
programs.setBounds(167, 6, 160, 18);
rebuildProgramCombobox();
programs.addListener(this);
addAndMakeVisible(storeButton = new TextButton("STORE"));
storeButton->setButtonText ("STORE");
storeButton->addListener (this);
storeButton->setBounds (439, 5, 50, 18);
storeButton->setBounds (331, 6, 50, 18);
addAndMakeVisible(settingsButton = new TextButton("PARMS"));
settingsButton->setButtonText ("PARMS");
settingsButton->addListener (this);
settingsButton->setBounds (755, 6, 50, 18);
addAndMakeVisible(aboutButton = new TextButton("ABOUT"));
aboutButton->setButtonText ("ABOUT");
aboutButton->addListener (this);
aboutButton->setBounds (807, 5, 50, 18);
aboutButton->setBounds (807, 6, 50, 18);
// OPERATORS
@ -132,6 +136,17 @@ void DexedAudioProcessorEditor::paint (Graphics& g) {
}
void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) {
if (buttonThatWasClicked == cartButton) {
int result = cartPopup.show();
processor->loadBuiltin(result-1);
processor->setCurrentProgram(0);
rebuildProgramCombobox();
programs.setSelectedId(processor->getCurrentProgram()+1, NotificationType::dontSendNotification);
processor->updateHostDisplay();
return;
}
if (buttonThatWasClicked == loadButton) {
FileChooser fc ("Import original DX sysex...", File::nonexistent, "*.syx;*.SYX;*.*", 1);
@ -195,17 +210,8 @@ void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) {
}
void DexedAudioProcessorEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged) {
if ( comboBoxThatHasChanged == &programs ) {
processor->setCurrentProgram(programs.getSelectedId()-1);
processor->updateHostDisplay();
} else {
int idx = comboBoxThatHasChanged->getSelectedItemIndex();
processor->loadBuiltin(idx);
processor->setCurrentProgram(0);
rebuildProgramCombobox();
programs.setSelectedId(processor->getCurrentProgram()+1, NotificationType::dontSendNotification);
processor->updateHostDisplay();
}
processor->setCurrentProgram(programs.getSelectedId()-1);
processor->updateHostDisplay();
}
void DexedAudioProcessorEditor::timerCallback() {

@ -36,16 +36,17 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor,
public Timer {
DexedAudioProcessor *processor;
ComboBox programs;
ComboBox cartridges;
PopupMenu cartPopup;
MidiKeyboardComponent midiKeyboard;
DXLookNFeel dx_lnf;
ScopedPointer<TextButton> cartButton;
ScopedPointer<TextButton> loadButton;
ScopedPointer<TextButton> saveButton;
ScopedPointer<TextButton> storeButton;
ScopedPointer<TextButton> aboutButton;
ScopedPointer<TextButton> settings;
ScopedPointer<TextButton> settingsButton;
void storeProgram();

Loading…
Cancel
Save