Window and Linux fixes

pull/1/head
Pascal Gauthier 10 years ago
parent 847ba1635e
commit 35550de5dc
  1. 8
      README.md
  2. 24
      Source/CartManager.cpp
  3. 5
      Source/CartManager.h
  4. 4
      Source/Dexed.h
  5. 12
      Source/PluginData.cpp
  6. 2
      Source/PluginEditor.cpp

@ -18,12 +18,14 @@ in the source folder) stays on the Apache 2.0 license to able to collaborate bet
Changelog Changelog
--------- ---------
#### Version 0.8.2 #### Version 0.9.0
* Cartridge Manager
* Apple AU support * Apple AU support
* Cartridge Manager
* Store action also can update the currently loaded cartridge
* Basic theming * Basic theming
* Fixed the UI corruption when more than one Dexed instance was loaded * Fixed the UI corruption when more than one Dexed instance was loaded
* Fixed wrong display value issues * Fixed wrong display value issues (coarse and fine)
#### 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/)

@ -47,7 +47,6 @@ CartManager::CartManager(DexedAudioProcessorEditor *editor) : TopLevelWindow("Ca
activeCart->setBounds(28, 441, 800, 96); activeCart->setBounds(28, 441, 800, 96);
activeCart->addListener(this); activeCart->addListener(this);
memset(browserSysex, 0, 4096);
addAndMakeVisible(browserCart = new ProgramListBox("browserpgm", 2)); addAndMakeVisible(browserCart = new ProgramListBox("browserpgm", 2));
browserCart->setBounds(635, 18, 200, 384); browserCart->setBounds(635, 18, 200, 384);
browserCart->addListener(this); browserCart->addListener(this);
@ -81,11 +80,11 @@ CartManager::CartManager(DexedAudioProcessorEditor *editor) : TopLevelWindow("Ca
fileMgrButton->addListener(this); fileMgrButton->addListener(this);
addAndMakeVisible(getDXPgmButton = new TextButton("GET DX7 PGM")); addAndMakeVisible(getDXPgmButton = new TextButton("GET DX7 PGM"));
getDXPgmButton->setBounds(668, 545, 95, 30); getDXPgmButton->setBounds(656, 545, 100, 30);
getDXPgmButton->addListener(this); getDXPgmButton->addListener(this);
addAndMakeVisible(getDXCartButton = new TextButton("GET DX7 CART")); addAndMakeVisible(getDXCartButton = new TextButton("GET DX7 CART"));
getDXCartButton->setBounds(761, 545, 95, 30); getDXCartButton->setBounds(755, 545, 100, 30);
getDXCartButton->addListener(this); getDXCartButton->addListener(this);
} }
@ -111,10 +110,10 @@ void CartManager::programSelected(ProgramListBox *source, int pos) {
mainWindow->processor->setCurrentProgram(pos); mainWindow->processor->setCurrentProgram(pos);
mainWindow->processor->updateHostDisplay(); mainWindow->processor->updateHostDisplay();
} else { } else {
if ( browserSysex == nullptr ) if ( source->getCurrentCart() == nullptr )
return; return;
char unpackPgm[161]; char unpackPgm[161];
unpackProgramFromSysex(unpackPgm, browserSysex, pos); unpackProgramFromSysex(unpackPgm, source->getCurrentCart(), pos);
activeCart->setSelected(-1); activeCart->setSelected(-1);
browserCart->setSelected(pos); browserCart->setSelected(pos);
repaint(); repaint();
@ -148,17 +147,21 @@ void CartManager::buttonClicked(juce::Button *buttonThatWasClicked) {
} }
if ( buttonThatWasClicked == getDXPgmButton ) { if ( buttonThatWasClicked == getDXPgmButton ) {
if ( mainWindow->processor->sysexComm.isOutputActive() ) { if ( mainWindow->processor->sysexComm.isInputActive() && mainWindow->processor->sysexComm.isOutputActive() ) {
unsigned char msg[] = { 0xF0, 0x43, 0x20, 0x00, 0xF7 }; unsigned char msg[] = { 0xF0, 0x43, 0x20, 0x00, 0xF7 };
mainWindow->processor->sysexComm.send(MidiMessage(msg, 5)); mainWindow->processor->sysexComm.send(MidiMessage(msg, 5));
} else {
showSysexConfigMsg();
} }
return; return;
} }
if ( buttonThatWasClicked == getDXCartButton ) { if ( buttonThatWasClicked == getDXCartButton ) {
if ( mainWindow->processor->sysexComm.isOutputActive() ) { if ( mainWindow->processor->sysexComm.isInputActive() && mainWindow->processor->sysexComm.isOutputActive() ) {
unsigned char msg[] = { 0xF0, 0x43, 0x20, 0x01, 0xF7 }; unsigned char msg[] = { 0xF0, 0x43, 0x20, 0x01, 0xF7 };
mainWindow->processor->sysexComm.send(MidiMessage(msg, 5)); mainWindow->processor->sysexComm.send(MidiMessage(msg, 5));
} else {
showSysexConfigMsg();
} }
return; return;
} }
@ -228,6 +231,7 @@ void CartManager::selectionChanged() {
fp_in.read((char *)syx_data, 4104); fp_in.read((char *)syx_data, 4104);
fp_in.close(); fp_in.close();
char browserSysex[4104];
memcpy(browserSysex, syx_data+6, 4096); memcpy(browserSysex, syx_data+6, 4096);
int checksum = sysexChecksum(((char *) &browserSysex), 4096); int checksum = sysexChecksum(((char *) &browserSysex), 4096);
@ -312,6 +316,12 @@ void CartManager::initialFocus() {
cartBrowser->grabKeyboardFocus(); cartBrowser->grabKeyboardFocus();
} }
void CartManager::showSysexConfigMsg() {
AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon, "Warning", "The DX7 midi interface is not configured correctly.\n\n"
"These buttons are used to 'ask' the DX7 to send the current program/cartridge.\n\n"
"In order to use this correctly, you need to connect your midi in and midi out of your DX7 to a midi interface and configure this midi interface with the [PARM] dialog.");
}
// unused stuff from FileBrowserListener // unused stuff from FileBrowserListener
void CartManager::browserRootChanged (const File& newRoot) {} void CartManager::browserRootChanged (const File& newRoot) {}

@ -47,8 +47,9 @@ class CartManager : public TopLevelWindow, public ButtonListener, public DragAn
File cartDir; File cartDir;
DexedAudioProcessorEditor *mainWindow; DexedAudioProcessorEditor *mainWindow;
char browserSysex[4096]; void showSysexConfigMsg();
public: public:
CartManager(DexedAudioProcessorEditor *editor); CartManager(DexedAudioProcessorEditor *editor);
virtual ~CartManager(); virtual ~CartManager();

@ -24,14 +24,14 @@
void dexed_trace(const char *source, const char *fmt, ...); void dexed_trace(const char *source, const char *fmt, ...);
#ifdef DEBUG #ifdef DEBUG
#define DEXED_VERSION "0.8.2 DEBUG" #define DEXED_VERSION "0.9.0 DEBUG"
#ifdef _MSC_VER #ifdef _MSC_VER
#define TRACE(fmt, ...) dexed_trace(__FUNCTION__,fmt,##__VA_ARGS__) #define TRACE(fmt, ...) dexed_trace(__FUNCTION__,fmt,##__VA_ARGS__)
#else #else
#define TRACE(fmt, ...) dexed_trace(__PRETTY_FUNCTION__,fmt,##__VA_ARGS__) #define TRACE(fmt, ...) dexed_trace(__PRETTY_FUNCTION__,fmt,##__VA_ARGS__)
#endif #endif
#else #else
#define DEXED_VERSION "0.8.2" #define DEXED_VERSION "0.9.0 BETA"
#define TRACE(fmt, ...) #define TRACE(fmt, ...)
#endif #endif

@ -250,18 +250,21 @@ void DexedAudioProcessor::setupStartupCart() {
File startup = dexedCartDir.getChildFile("Dexed_01.syx"); File startup = dexedCartDir.getChildFile("Dexed_01.syx");
if ( startup.exists() ) { if ( startup.exists() ) {
ScopedPointer<FileInputStream> fis = startup.createInputStream(); FileInputStream *fis = startup.createInputStream();
if ( fis == nullptr ) { if ( fis == nullptr ) {
TRACE("unable to open default cartridge"); TRACE("unable to open default cartridge");
return; return;
} }
fis->read(syx_data, 4104); fis->read(syx_data, 4104);
delete fis;
} else { } else {
// The user deleted the file :/, load from the builtin zip file. // The user deleted the file :/, load from the builtin zip file.
MemoryInputStream *mis = new MemoryInputStream(BinaryData::builtin_pgm_zip, BinaryData::builtin_pgm_zipSize, false); MemoryInputStream *mis = new MemoryInputStream(BinaryData::builtin_pgm_zip, BinaryData::builtin_pgm_zipSize, false);
ScopedPointer<ZipFile> builtin_pgm = new ZipFile(mis, true); ZipFile *builtin_pgm = new ZipFile(mis, true);
ScopedPointer<InputStream> is = builtin_pgm->createStreamForEntry(builtin_pgm->getIndexOfFileName(("Dexed_01.syx"))); InputStream *is = builtin_pgm->createStreamForEntry(builtin_pgm->getIndexOfFileName(("Dexed_01.syx")));
is->read(syx_data, 4104); is->read(syx_data, 4104);
delete is;
delete builtin_pgm;
} }
importSysex((char *) &syx_data); importSysex((char *) &syx_data);
} }
@ -459,7 +462,7 @@ void DexedAudioProcessor::resolvAppDir() {
synprezFmDir.createDirectory(); synprezFmDir.createDirectory();
MemoryInputStream *mis = new MemoryInputStream(BinaryData::builtin_pgm_zip, BinaryData::builtin_pgm_zipSize, false); MemoryInputStream *mis = new MemoryInputStream(BinaryData::builtin_pgm_zip, BinaryData::builtin_pgm_zipSize, false);
ScopedPointer<ZipFile> builtin_pgm = new ZipFile(mis, true); ZipFile *builtin_pgm = new ZipFile(mis, true);
for(int i=0;i<builtin_pgm->getNumEntries();i++) { for(int i=0;i<builtin_pgm->getNumEntries();i++) {
if ( builtin_pgm->getEntry(i)->filename == "Dexed_01.syx" ) { if ( builtin_pgm->getEntry(i)->filename == "Dexed_01.syx" ) {
@ -468,5 +471,6 @@ void DexedAudioProcessor::resolvAppDir() {
builtin_pgm->uncompressEntry(i, synprezFmDir); builtin_pgm->uncompressEntry(i, synprezFmDir);
} }
} }
delete builtin_pgm;
} }
} }

@ -163,6 +163,8 @@ void DexedAudioProcessorEditor::loadCart(File file) {
} }
void DexedAudioProcessorEditor::saveCart() { void DexedAudioProcessorEditor::saveCart() {
File startFileName = processor->activeFileCartridge.exists() ? processor->activeFileCartridge : processor->dexedCartDir;
FileChooser fc ("Export DX sysex...", processor->dexedCartDir, "*.syx", 1); FileChooser fc ("Export DX sysex...", processor->dexedCartDir, "*.syx", 1);
if ( fc.browseForFileToSave(true) ) { if ( fc.browseForFileToSave(true) ) {
String f = fc.getResults().getReference(0).getFullPathName(); String f = fc.getResults().getReference(0).getFullPathName();

Loading…
Cancel
Save