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

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

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

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

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

Loading…
Cancel
Save