diff --git a/Builds/MacOSX/Dexed.xcodeproj/project.pbxproj b/Builds/MacOSX/Dexed.xcodeproj/project.pbxproj index 25f654c..b800a6f 100644 --- a/Builds/MacOSX/Dexed.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/Dexed.xcodeproj/project.pbxproj @@ -117,6 +117,7 @@ 14AF9F1F28D50F8E47606660 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Slider.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/widgets/juce_Slider.h"; sourceTree = "SOURCE_ROOT"; }; 153D4DE95D01307F844AA15B = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_VST3PluginFormat.h"; path = "../../JuceLibraryCode/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h"; sourceTree = "SOURCE_ROOT"; }; 1585F30843449EA6EA078288 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_ThreadWithProgressWindow.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.cpp"; sourceTree = "SOURCE_ROOT"; }; + 15B75D829C40872D542A38B8 = { isa = PBXFileReference; lastKnownFileType = file.zip; name = "builtin_pgm.zip"; path = "../../Resources/builtin_pgm.zip"; sourceTree = "SOURCE_ROOT"; }; 1600EDBEE9B363CBAB68CD43 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_StringPool.cpp"; path = "../../JuceLibraryCode/modules/juce_core/text/juce_StringPool.cpp"; sourceTree = "SOURCE_ROOT"; }; 1635BBF869518BAA7A88A6A0 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_FileSearchPathListComponent.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.h"; sourceTree = "SOURCE_ROOT"; }; 163C2312B370BA53F482B84B = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_TabbedButtonBar.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/layout/juce_TabbedButtonBar.h"; sourceTree = "SOURCE_ROOT"; }; @@ -143,7 +144,6 @@ 1D31136D1C9D959792023095 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RelativeTime.cpp"; path = "../../JuceLibraryCode/modules/juce_core/time/juce_RelativeTime.cpp"; sourceTree = "SOURCE_ROOT"; }; 1D798858682A27299589F4E5 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_ComponentListener.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_basics/components/juce_ComponentListener.cpp"; sourceTree = "SOURCE_ROOT"; }; 1D95A78059DCCC7B58782F07 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_AudioSampleBuffer.h"; path = "../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h"; sourceTree = "SOURCE_ROOT"; }; - 1DC9D8AC8B4311052BC86115 = { isa = PBXFileReference; lastKnownFileType = image.png; name = background.png; path = ../../Resources/background.png; sourceTree = "SOURCE_ROOT"; }; 1E1A0627C2977D5FCB8440CC = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_LookAndFeel.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel.h"; sourceTree = "SOURCE_ROOT"; }; 1EB6398B6F537A4302092240 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_TextEditorKeyMapper.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/keyboard/juce_TextEditorKeyMapper.h"; sourceTree = "SOURCE_ROOT"; }; 1F51658DEF590741920719FF = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_MACAddress.cpp"; path = "../../JuceLibraryCode/modules/juce_core/network/juce_MACAddress.cpp"; sourceTree = "SOURCE_ROOT"; }; @@ -774,7 +774,6 @@ E8A7578ED10948AB49EE2997 = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_FileTreeComponent.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.h"; sourceTree = "SOURCE_ROOT"; }; E90C9A775597228F1F127252 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_EdgeTable.cpp"; path = "../../JuceLibraryCode/modules/juce_graphics/geometry/juce_EdgeTable.cpp"; sourceTree = "SOURCE_ROOT"; }; E912092604DBF571BDC08D60 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_DrawableRectangle.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_DrawableRectangle.cpp"; sourceTree = "SOURCE_ROOT"; }; - E93431088B4E40AC9A48D817 = { isa = PBXFileReference; lastKnownFileType = file.syx; name = startup.syx; path = ../../Resources/startup.syx; sourceTree = "SOURCE_ROOT"; }; E99DD30E1F2706D62695EB8C = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Colours.h"; path = "../../JuceLibraryCode/modules/juce_graphics/colour/juce_Colours.h"; sourceTree = "SOURCE_ROOT"; }; E9BA26E4F993EBFB0E36B18C = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_RelativePointPath.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/positioning/juce_RelativePointPath.h"; sourceTree = "SOURCE_ROOT"; }; E9E4792648C00B4A23C1A39D = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_DrawableShape.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_DrawableShape.h"; sourceTree = "SOURCE_ROOT"; }; @@ -854,8 +853,7 @@ FF5B77AA3517B4637F862BD3 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_RelativeCoordinatePositioner.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.cpp"; sourceTree = "SOURCE_ROOT"; }; FF6607118B29435E76806DFA = { isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Dexed.component; sourceTree = "BUILT_PRODUCTS_DIR"; }; F472964B0FFEE5615B72CE3D = { isa = PBXGroup; children = ( - 1DC9D8AC8B4311052BC86115, - E93431088B4E40AC9A48D817 ); name = Resources; sourceTree = ""; }; + 15B75D829C40872D542A38B8 ); name = Resources; sourceTree = ""; }; BDC5059F1563FD8DD69AD324 = { isa = PBXGroup; children = ( 3715DFDD7A1B12083F051F5A, 8F395B738E7AB81A0333AF96, diff --git a/Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate b/Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate index 915ea1d..33331dc 100644 Binary files a/Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate and b/Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Builds/VisualStudio2012/Dexed.vcxproj b/Builds/VisualStudio2012/Dexed.vcxproj index a2a39c8..744d5bf 100644 --- a/Builds/VisualStudio2012/Dexed.vcxproj +++ b/Builds/VisualStudio2012/Dexed.vcxproj @@ -1518,8 +1518,7 @@ - - + diff --git a/Builds/VisualStudio2012/Dexed.vcxproj.filters b/Builds/VisualStudio2012/Dexed.vcxproj.filters index 529789d..93a09a1 100644 --- a/Builds/VisualStudio2012/Dexed.vcxproj.filters +++ b/Builds/VisualStudio2012/Dexed.vcxproj.filters @@ -2600,10 +2600,7 @@ - - Dexed\Resources - - + Dexed\Resources diff --git a/Dexed.jucer b/Dexed.jucer index 33017b0..c91259f 100644 --- a/Dexed.jucer +++ b/Dexed.jucer @@ -11,8 +11,7 @@ jucerVersion="3.1.0" companyName="Digital Suburban"> - - + getValue(); level[i] = s_level[i]->getValue(); @@ -111,6 +115,9 @@ void AlgoDisplay::paint(Graphics &g) { alg = 31; } const char *arr = algoArr[alg]; + + g.setColour (Colours::black.withAlpha(0.5f)); + g.fillRoundedRectangle (0.0f, 0.0f, (float) getWidth(), (float) getHeight(), 1.0f); for(int i=0;i<13;i++) { char target = arr[i]; @@ -137,20 +144,26 @@ void AlgoDisplay::paint(Graphics &g) { drawOp(g, (i-12)+3, 0, target, feedback); } + String algoTxt; + algoTxt << (alg+1); + g.drawText(algoTxt, 0, 0, 21, 14, Justification::left, true); } void AlgoDisplay::drawOp(Graphics &g, int x, int y, int num, bool feedback) { String txt; txt << num; + int offx = 25; + int offy = 18; + g.setColour(Colour(0xFF0FC00F)); - g.fillRect(x*21+1, y*14+1, 19, 13); + g.fillRect(x*offx+1, y*offy+1, offx-2, offy-1); g.setColour(Colour(0xFFFFFFFF)); - g.drawText(txt, x*21, y*14, 21, 14, Justification::centred, true); + g.drawText(txt, x*offx, y*offy, offx, offy, Justification::centred, true); if ( feedback ) { g.setColour(Colour(0xFFFFFFFF)); - int x1 = (x*21) + 19; - g.drawLine(x1, y*14+1, x1, y*14+14, 3); + int x1 = (x*offx) + 23; + g.drawLine(x1, y*offy+1, x1, y*offy+offy, 3); } } diff --git a/Source/GlobalEditor.cpp b/Source/GlobalEditor.cpp index 1ad5dd4..356ed89 100644 --- a/Source/GlobalEditor.cpp +++ b/Source/GlobalEditor.cpp @@ -32,7 +32,7 @@ GlobalEditor::GlobalEditor () addAndMakeVisible (algo = new Slider ("algo")); algo->setRange (1, 32, 1); algo->setSliderStyle (Slider::Rotary); - algo->setTextBoxStyle (Slider::TextBoxLeft, true, 80, 20); + algo->setTextBoxStyle (Slider::NoTextBox, true, 80, 20); algo->addListener (this); addAndMakeVisible (lfoType = new ComboBox ("new combo box")); @@ -159,6 +159,9 @@ GlobalEditor::GlobalEditor () addAndMakeVisible (lfoSync = new ToggleButton ("lfoSync")); lfoSync->setButtonText (String::empty); + addAndMakeVisible (component = new Component()); + component->setName ("new component"); + //[UserPreSize] //[/UserPreSize] @@ -199,6 +202,7 @@ GlobalEditor::~GlobalEditor() oscSync = nullptr; pitchModSens = nullptr; lfoSync = nullptr; + component = nullptr; //[Destructor]. You can add your own custom destruction code here.. @@ -228,7 +232,7 @@ void GlobalEditor::paint (Graphics& g) void GlobalEditor::resized() { - algo->setBounds (480, 64, 80, 24); + algo->setBounds (568, 32, 24, 24); lfoType->setBounds (624, 40, 96, 16); lfoSpeed->setBounds (624, 16, 96, 16); lfoAmDepth->setBounds (696, 64, 24, 24); @@ -236,7 +240,7 @@ void GlobalEditor::resized() lfoDelay->setBounds (672, 64, 24, 24); cutoff->setBounds (8, 40, 48, 48); reso->setBounds (64, 40, 48, 48); - algoDisplay->setBounds (480, 8, 126, 56); + algoDisplay->setBounds (416, 8, 150, 72); pitchRate2->setBounds (776, 64, 32, 24); pitchRate3->setBounds (800, 64, 32, 24); pitchRate4->setBounds (824, 64, 32, 24); @@ -245,11 +249,12 @@ void GlobalEditor::resized() pitchLevel3->setBounds (800, 40, 32, 24); pitchLevel4->setBounds (824, 40, 32, 24); pitchLevel1->setBounds (752, 40, 32, 24); - feedback->setBounds (560, 64, 24, 24); + feedback->setBounds (568, 56, 24, 24); transpose->setBounds (728, 0, 24, 56); - oscSync->setBounds (584, 64, 24, 24); + oscSync->setBounds (600, 64, 24, 24); pitchModSens->setBounds (728, 64, 24, 24); lfoSync->setBounds (624, 64, 24, 24); + component->setBounds (752, 8, 96, 32); //[UserResized] Add your own custom resize handling here.. //[/UserResized] } @@ -428,8 +433,8 @@ BEGIN_JUCER_METADATA fixedSize="1" initialWidth="855" initialHeight="90"> + END_JUCER_METADATA diff --git a/Source/GlobalEditor.h b/Source/GlobalEditor.h index 0e925f9..003960f 100644 --- a/Source/GlobalEditor.h +++ b/Source/GlobalEditor.h @@ -90,6 +90,7 @@ private: ScopedPointer oscSync; ScopedPointer pitchModSens; ScopedPointer lfoSync; + ScopedPointer component; //============================================================================== diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 723c339..def4cdd 100755 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -34,41 +34,43 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner LookAndFeel::setDefaultLookAndFeel(&dx_lnf); - // This is where our plugin's editor size is set. setSize (865, 420); processor = ownerFilter; - cachedImage_background_png = ImageCache::getFromMemory (BinaryData::background_png, BinaryData::background_pngSize); - + addAndMakeVisible (cartButton = new TextButton("CART")); + cartButton->setButtonText ("CART"); + cartButton->addListener (this); + cartButton->setBounds(5, 5, 50, 18); + addAndMakeVisible (loadButton = new TextButton("LOAD")); loadButton->setButtonText ("LOAD"); loadButton->addListener (this); - loadButton->setBounds(5, 5, 50, 18); + loadButton->setBounds(57, 5, 50, 18); - addAndMakeVisible( saveButton = new TextButton("SAVE")); + addAndMakeVisible(saveButton = new TextButton("SAVE")); saveButton->setButtonText ("SAVE"); saveButton->addListener (this); - saveButton->setBounds (57, 5, 50, 18); - - addAndMakeVisible( storeButton = new TextButton("STORE")); + saveButton->setBounds (109, 5, 50, 18); + + addAndMakeVisible (&presets); + presets.setEditableText (false); + presets.setJustificationType (Justification::centredLeft); + presets.setTextWhenNothingSelected (String::empty); + presets.setBounds(163, 5, 180, 18); + rebuildPresetCombobox(); + presets.addListener(this); + + addAndMakeVisible(storeButton = new TextButton("STORE")); storeButton->setButtonText ("STORE"); storeButton->addListener (this); - storeButton->setBounds (300, 5, 50, 18); + storeButton->setBounds (347, 5, 50, 18); - addAndMakeVisible( aboutButton = new TextButton("ABOUT")); + addAndMakeVisible(aboutButton = new TextButton("ABOUT")); aboutButton->setButtonText ("ABOUT"); aboutButton->addListener (this); aboutButton->setBounds (805, 5, 50, 18); - addAndMakeVisible (&presets); - presets.setEditableText (false); - presets.setJustificationType (Justification::centredLeft); - presets.setTextWhenNothingSelected (String::empty); - presets.setBounds(115, 5, 180, 18); - - rebuildPresetCombobox(); - presets.addListener(this); // OPERATORS addAndMakeVisible(&(operators[0])); @@ -107,9 +109,9 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner addAndMakeVisible(&global); global.setBounds(5,235,855,90); global.bind(processor); - - updateUI(); - startTimer(100); + + updateUI(); + startTimer(100); } DexedAudioProcessorEditor::~DexedAudioProcessorEditor() { @@ -118,9 +120,12 @@ DexedAudioProcessorEditor::~DexedAudioProcessorEditor() { } //============================================================================== -void DexedAudioProcessorEditor::paint (Graphics& g) { - g.drawImage (cachedImage_background_png, 0, 0, 865, 420, - 0, 0, cachedImage_background_png.getWidth(), cachedImage_background_png.getHeight()); +void DexedAudioProcessorEditor::paint (Graphics& g) { + g.setColour(Colour(0xFF744420)); + g.fillRoundedRectangle(0.0f, 0.0f, (float) getWidth(), (float) getHeight(), 0); + + g.setColour(Colour(0xFFA87B67)); + g.fillRoundedRectangle(0.0f, 30, (float) getWidth(), 200, 0); } void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) { @@ -143,9 +148,7 @@ void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) { processor->importSysex((char *) &syx_data); processor->setCurrentProgram(0); rebuildPresetCombobox(); - presets.setSelectedId(processor->getCurrentProgram()+1, NotificationType::dontSendNotification); - processor->setCurrentProgram(0); processor->updateHostDisplay(); } @@ -204,6 +207,31 @@ void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) { return; } + if (buttonThatWasClicked == cartButton) { + StringArray cart; + + for(int i=0;ibuiltin_pgm->getNumEntries();i++) { + const ZipFile::ZipEntry *e = processor->builtin_pgm->getEntry(i); + + cart.add(e->filename.dropLastCharacters(4)); + + } + AlertWindow dialog(String("Builtin cartridges"), "", AlertWindow::NoIcon, this); + dialog.addComboBox(String("cart"), cart); + dialog.addButton("OK", 0, KeyPress(KeyPress::returnKey)); + dialog.addButton("Cancel", 1, KeyPress(KeyPress::escapeKey)); + if ( dialog.runModalLoop() == 0 ) { + ComboBox *select = dialog.getComboBoxComponent(String("cart")); + int idx = select->getSelectedItemIndex(); + processor->loadBuiltin(idx); + processor->setCurrentProgram(0); + rebuildPresetCombobox(); + presets.setSelectedId(processor->getCurrentProgram()+1, NotificationType::dontSendNotification); + processor->updateHostDisplay(); + } + return; + } + if (buttonThatWasClicked == aboutButton) { AlertWindow::showMessageBoxAsync(AlertWindow::NoIcon, "DEXED - DX Emulator 0.3", "https://github.com/asb2m10/dexed\n" "(c) 2013 Pascal Gauthier\nUnder the GPL v2\n\n" diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 0e79462..90483eb 100755 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -38,7 +38,8 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, ComboBox presets; MidiKeyboardComponent midiKeyboard; DXLookNFeel dx_lnf; - + + ScopedPointer cartButton; ScopedPointer loadButton; ScopedPointer saveButton; ScopedPointer storeButton; @@ -61,9 +62,6 @@ public: void updateUI(); void rebuildPresetCombobox(); - - - Image cachedImage_background_png; }; diff --git a/Source/PluginParam.cpp b/Source/PluginParam.cpp index 3e6e2e3..0ef2575 100755 --- a/Source/PluginParam.cpp +++ b/Source/PluginParam.cpp @@ -18,10 +18,14 @@ * Boston, MA 02110-1301 USA. */ +#include + #include "PluginParam.h" #include "PluginProcessor.h" #include "PluginEditor.h" + + // ************************************************************************ // Ctrl::Ctrl(String name) { @@ -145,6 +149,10 @@ int CtrlDX::getValue() { return dxValue; } +int CtrlDX::getOffset() { + return dxOffset; +} + String CtrlDX::getValueDisplay() { String ret; ret << ( getValue() + displayValue ); @@ -199,7 +207,12 @@ void CtrlDX::updateComponent() { * */ void DexedAudioProcessor::initCtrl() { - importSysex(BinaryData::startup_syx); + MemoryInputStream *mis = new MemoryInputStream(BinaryData::builtin_pgm_zip, BinaryData::builtin_pgm_zipSize, false); + builtin_pgm = new ZipFile(mis, true); + builtin_pgm->sortEntriesByFilename(); + + loadBuiltin(0); + currentProgram = 0; fxCutoff = new CtrlFloat("Cutoff", &fx.uiCutoff); @@ -397,10 +410,7 @@ void DexedAudioProcessor::exportSysex(char *dest) { memcpy(dest+4102, footer, 2); } -/* - */ - void DexedAudioProcessor::unpackProgram(int idx) { char *bulk = sysex + (idx * 128); @@ -494,6 +504,21 @@ void DexedAudioProcessor::setDxValue(int offset, int v) { midiOut.addEvent(msg, 7, 0); } +void DexedAudioProcessor::loadBuiltin(int idx) { + InputStream *is = builtin_pgm->createStreamForEntry(idx); + + if ( is == NULL ) { + TRACE("ENTRY IN ZIP NOT FOUND"); + return; + } + + uint8_t syx_data[4104]; + is->read(&syx_data, 4104); + delete is; + + importSysex((char *) &syx_data); +} + void DexedAudioProcessor::unbindUI() { for (int i = 0; i < ctrl.size(); i++) { ctrl[i]->unbind(); @@ -522,8 +547,8 @@ int DexedAudioProcessor::getCurrentProgram() { } void DexedAudioProcessor::setCurrentProgram(int index) { - TRACE("setting program %d state %d", index, bypassVstChangeProgram); - if ( bypassVstChangeProgram ) { + TRACE("setting program %d state", index); + if ( lastStateSave + 2 < time(NULL) ) { for (int i = 0; i < MAX_ACTIVE_NOTES; i++) { if (voices[i].keydown == false && voices[i].live == true) { voices[i].live = false; @@ -533,7 +558,6 @@ void DexedAudioProcessor::setCurrentProgram(int index) { unpackProgram(index); lfo.reset(data + 137); } - bypassVstChangeProgram = 1; currentProgram = index; updateUI(); } @@ -588,7 +612,6 @@ void DexedAudioProcessor::setStateInformation(const void* source, int sizeInByte // used to LOAD plugin state PluginState state; - bypassVstChangeProgram = 0; if ( sizeInBytes < sizeof(PluginState) ) { TRACE("too small plugin state size %d", sizeInBytes); @@ -607,7 +630,8 @@ void DexedAudioProcessor::setStateInformation(const void* source, int sizeInByte fx.uiCutoff = state.cutoff; fx.uiReso = state.reso; - // TODO: this should only be set if it is a VST + + lastStateSave = (long) time(NULL); TRACE("setting VST STATE"); updateUI(); } diff --git a/Source/PluginParam.h b/Source/PluginParam.h index d3923e3..eeabe2e 100755 --- a/Source/PluginParam.h +++ b/Source/PluginParam.h @@ -92,7 +92,8 @@ public: void setValue(int value); int getValue(); String getValueDisplay(); - + int getOffset(); + void sliderValueChanged (Slider* moved); void comboBoxChanged (ComboBox* combo); void updateComponent(); diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index d17f5ea..2257207 100755 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -42,12 +42,13 @@ DexedAudioProcessor::DexedAudioProcessor() { Tanh::init(); Sin::init(); + lastStateSave = 0; + currentNote = -1; workBlock = NULL; initCtrl(); setCurrentProgram(0); sendSysexChange = true; - bypassVstChangeProgram = 1; } DexedAudioProcessor::~DexedAudioProcessor() { diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index c16619a..7e50220 100755 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -65,12 +65,9 @@ class DexedAudioProcessor : public AudioProcessor char patchNames[32][13]; /** - * This flag is used to ignore change program when a VST chunk has been loaded. - * This is because the VST host will set the chunk value THEN change the program - * number. By doing this, it erase the current state of the program to the - * original one in the cartrige. + * The last time the state was save, to be able to bypass a VST host bug. */ - bool bypassVstChangeProgram; + long lastStateSave; /** * PlugFX @@ -99,7 +96,8 @@ public : int refreshUI; bool sendSysexChange; char data[161]; - + + ScopedPointer builtin_pgm; Array ctrl; OperatorCtrl opCtrl[6]; @@ -141,7 +139,7 @@ public : void packProgram(int idx, const char *name); void unpackProgram(int idx); void updateProgramFromSysex(const uint8 *rawdata); - + void loadBuiltin(int idx); //============================================================================== const String getName() const; int getNumParameters();