diff --git a/Builds/MacOSX/Dexed.xcodeproj/project.pbxproj b/Builds/MacOSX/Dexed.xcodeproj/project.pbxproj index 0403310..c06b953 100644 --- a/Builds/MacOSX/Dexed.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/Dexed.xcodeproj/project.pbxproj @@ -100,6 +100,7 @@ 0B2C1056583363B66704DB9C = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Array.h"; path = "../../JuceLibraryCode/modules/juce_core/containers/juce_Array.h"; sourceTree = "SOURCE_ROOT"; }; 0B338B58E9C37E83F0FD865D = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_Desktop.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/components/juce_Desktop.h"; sourceTree = "SOURCE_ROOT"; }; 0B7725520356AED2C80FC943 = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_MarkerList.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_basics/positioning/juce_MarkerList.cpp"; sourceTree = "SOURCE_ROOT"; }; + 0BD21CA621B7350EBED18C0A = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Dexed.h; path = ../../Source/Dexed.h; sourceTree = "SOURCE_ROOT"; }; 0C0B6B8DAD62A3F5C926825F = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_DynamicLibrary.h"; path = "../../JuceLibraryCode/modules/juce_core/threads/juce_DynamicLibrary.h"; sourceTree = "SOURCE_ROOT"; }; 0CB234755B75E0DBC2FFB58E = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "juce_ResizableCornerComponent.cpp"; path = "../../JuceLibraryCode/modules/juce_gui_basics/layout/juce_ResizableCornerComponent.cpp"; sourceTree = "SOURCE_ROOT"; }; 0DCC7A5AD5AC5D3637FFAAFB = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "juce_ToolbarButton.h"; path = "../../JuceLibraryCode/modules/juce_gui_basics/buttons/juce_ToolbarButton.h"; sourceTree = "SOURCE_ROOT"; }; @@ -906,6 +907,7 @@ 3BE8F91A99E8F48CB9F10C1F, 68D35AFE11BAA35EAE497D47, ); name = msfa; sourceTree = ""; }; 29B923E6EB12F97B68585AFC = {isa = PBXGroup; children = ( + 0BD21CA621B7350EBED18C0A, 45ADFD8885BE76C7F7D999AC, 5C0A1B7E2BF8FCAF5A1E8616, 59D15F780D468B587F9C7E78, 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 86539cb..8891e63 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 3558a70..28766d5 100644 --- a/Builds/VisualStudio2012/Dexed.vcxproj +++ b/Builds/VisualStudio2012/Dexed.vcxproj @@ -1137,6 +1137,7 @@ + diff --git a/Builds/VisualStudio2012/Dexed.vcxproj.filters b/Builds/VisualStudio2012/Dexed.vcxproj.filters index 1e2689b..0ec4f8e 100644 --- a/Builds/VisualStudio2012/Dexed.vcxproj.filters +++ b/Builds/VisualStudio2012/Dexed.vcxproj.filters @@ -1419,6 +1419,9 @@ + + Dexed\Source + Dexed\Source diff --git a/Builds/VisualStudio2013/Dexed.vcxproj b/Builds/VisualStudio2013/Dexed.vcxproj index c81b7a2..70a3aae 100644 --- a/Builds/VisualStudio2013/Dexed.vcxproj +++ b/Builds/VisualStudio2013/Dexed.vcxproj @@ -1136,6 +1136,7 @@ + diff --git a/Builds/VisualStudio2013/Dexed.vcxproj.filters b/Builds/VisualStudio2013/Dexed.vcxproj.filters index 685192c..34d1244 100644 --- a/Builds/VisualStudio2013/Dexed.vcxproj.filters +++ b/Builds/VisualStudio2013/Dexed.vcxproj.filters @@ -1419,6 +1419,9 @@ + + Dexed\Source + Dexed\Source diff --git a/Dexed.jucer b/Dexed.jucer index 9aae1aa..6cb8688 100644 --- a/Dexed.jucer +++ b/Dexed.jucer @@ -16,6 +16,7 @@ + addItemList(input, 1); + sysexIn->addItemList(input, 2); StringArray output; output.add("None"); output.addArray(MidiOutput::getDevices()); - sysexOut->addItemList(output, 1); + sysexOut->addItemList(output, 2); //[/Constructor] } @@ -123,13 +124,13 @@ void ParamDialog::paint (Graphics& g) g.setColour (Colours::white); g.setFont (Font (15.00f, Font::plain)); g.drawText (TRANS("Sysex In"), - 19, 170, 131, 23, + 19, 178, 131, 23, Justification::centredLeft, true); g.setColour (Colours::white); g.setFont (Font (15.00f, Font::plain)); g.drawText (TRANS("Sysex Out"), - 19, 210, 131, 23, + 19, 218, 131, 23, Justification::centredLeft, true); g.setColour (Colours::white); @@ -146,8 +147,8 @@ void ParamDialog::resized() { pitchRange->setBounds (192, 16, 72, 24); pitchStep->setBounds (192, 56, 72, 24); - sysexIn->setBounds (104, 168, 152, 24); - sysexOut->setBounds (104, 208, 152, 24); + sysexIn->setBounds (104, 176, 152, 24); + sysexOut->setBounds (104, 216, 152, 24); sysexChl->setBounds (184, 256, 72, 24); //[UserResized] Add your own custom resize handling here.. //[/UserResized] @@ -209,10 +210,15 @@ void ParamDialog::setDialogValues(Controllers &c, SysexComm &mgr) { sysexChl->setValue(mgr.getChl() + 1); StringArray inputs = MidiInput::getDevices(); - sysexIn->setItemEnabled(inputs.indexOf(mgr.getInput()), true); - + int idx = inputs.indexOf(mgr.getInput()); + idx = idx == -1 ? 0 : idx + 1; + sysexIn->setSelectedItemIndex(idx); + StringArray outputs = MidiOutput::getDevices(); - sysexOut->setItemEnabled(outputs.indexOf(mgr.getOutput()), true); + idx = outputs.indexOf(mgr.getOutput()); + TRACE("output idx %d output %s", idx, mgr.getOutput().toRawUTF8()); + idx = idx == -1 ? 0 : idx + 1; + sysexOut->setSelectedItemIndex(idx); } void ParamDialog::getDialogValues(Controllers &c, SysexComm &mgr) { @@ -244,9 +250,9 @@ BEGIN_JUCER_METADATA fontname="Default font" fontsize="15" bold="0" italic="0" justification="33"/> - - @@ -260,10 +266,10 @@ BEGIN_JUCER_METADATA max="12" int="1" style="Rotary" textBoxPos="TextBoxLeft" textBoxEditable="1" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/> + + using namespace ::std; class AboutBox : public DialogWindow { @@ -47,7 +50,7 @@ public: g.drawImage (about_png, 0, 0, about_png.getWidth(), about_png.getHeight(), 0, 0, about_png.getWidth(), about_png.getHeight()); g.setColour(Colour(0xFF000000)); - String ver("Version 0.5 ; built date " __DATE__ ); + String ver("Version " DEXED_VERSION " ; built date " __DATE__ ); g.drawSingleLineText(ver, 9, 118); } }; @@ -147,8 +150,8 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner global.setBounds(5,235,855,90); global.bind(processor); - sendPopup.addItem(1, "Send current program to DX7 via sysex"); - sendPopup.addItem(2, "Send current cartridge to DX7 via sysex"); + sendPopup.addItem(1, "Send current program to DX7"); + sendPopup.addItem(2, "Send current cartridge to DX7"); updateUI(); startTimer(100); diff --git a/Source/PluginParam.cpp b/Source/PluginParam.cpp index a7f7ff0..5d09062 100644 --- a/Source/PluginParam.cpp +++ b/Source/PluginParam.cpp @@ -23,6 +23,7 @@ #include "PluginParam.h" #include "PluginProcessor.h" #include "PluginEditor.h" +#include "Dexed.h" // ************************************************************************ // @@ -57,16 +58,19 @@ void Ctrl::bind(ComboBox *c) { void Ctrl::unbind() { if (slider != NULL) { slider->removeListener(this); + slider->removeMouseListener(this); slider = NULL; } if (button != NULL) { button->removeListener(this); + button->removeMouseListener(this); button = NULL; } if (comboBox != NULL) { comboBox->removeListener(this); + comboBox->removeMouseListener(this); comboBox = NULL; } } diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index b18d9f6..706108c 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -21,6 +21,7 @@ #include "PluginProcessor.h" #include "PluginEditor.h" +#include "Dexed.h" #include "msfa/synth.h" #include "msfa/freqlut.h" #include "msfa/sin.h" diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 7ef1315..aeb9929 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -206,12 +206,4 @@ private: }; -void dexed_trace(const char *source, const char *fmt, ...); - -#ifdef _MSC_VER -#define TRACE(fmt, ...) dexed_trace(__FUNCTION__,fmt,##__VA_ARGS__) -#else -#define TRACE(fmt, ...) dexed_trace(__PRETTY_FUNCTION__,fmt,##__VA_ARGS__) -#endif - #endif // PLUGINPROCESSOR_H_INCLUDED diff --git a/Source/SysexComm.cpp b/Source/SysexComm.cpp index 5a47916..3450f29 100644 --- a/Source/SysexComm.cpp +++ b/Source/SysexComm.cpp @@ -1,14 +1,25 @@ -/* - ============================================================================== - - MidiMgr.cpp - Created: 24 Jun 2014 2:43:55am - Author: Pascal Gauthier - - ============================================================================== -*/ +/** + * + * Copyright (c) 2014 Pascal Gauthier. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + */ #include "SysexComm.h" +#include "Dexed.h" SysexComm::SysexComm() { sysexChl = 1; @@ -49,7 +60,7 @@ void SysexComm::setInput(String target) { int idx = devices.indexOf(target); if ( idx == -1 ) { - // device not found + TRACE("device %s not found", target.toRawUTF8()); inputName = ""; return; } @@ -58,6 +69,9 @@ void SysexComm::setInput(String target) { if ( input != NULL ) { inputName = target; input->start(); + TRACE("sysex %s opened", target.toRawUTF8()); + } else { + TRACE("unable to open %s", target.toRawUTF8()); } } @@ -75,13 +89,17 @@ void SysexComm::setOutput(String target) { int idx = devices.indexOf(target); if ( idx == -1 ) { - // device not found + TRACE("device %s not found", target.toRawUTF8()); + outputName = ""; return; } output = MidiOutput::openDevice(idx); if ( output != NULL ) { outputName = target; + TRACE("sysex %s opened", target.toRawUTF8()); + } else { + TRACE("unable to open %s", target.toRawUTF8()); } } @@ -105,5 +123,6 @@ void SysexComm::send(const juce::MidiMessage &message) { if ( output == NULL ) return; + TRACE("sending sysex..."); output->sendMessageNow(message); } \ No newline at end of file diff --git a/Source/SysexComm.h b/Source/SysexComm.h index a6ce6bc..04f5da3 100644 --- a/Source/SysexComm.h +++ b/Source/SysexComm.h @@ -1,12 +1,22 @@ -/* - ============================================================================== - - MidiMgr.h - Created: 24 Jun 2014 2:43:55am - Author: Pascal Gauthier - - ============================================================================== -*/ +/** + * + * Copyright (c) 2014 Pascal Gauthier. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + */ #ifndef SYSEXCOMM_H_INCLUDED #define SYSEXCOMM_H_INCLUDED @@ -39,6 +49,4 @@ public : void send(const MidiMessage& message); }; - - #endif // SYSEXCOMM_H_INCLUDED \ No newline at end of file