GUI: implement instrument preview in file dialog
SADLY it's just for the built-in file dialog but i'll think of a solution for the external one
This commit is contained in:
parent
663e724111
commit
e8c9b645c5
38 changed files with 113 additions and 85 deletions
|
|
@ -739,7 +739,9 @@ String DivEngine::getWarnings() {
|
|||
}
|
||||
|
||||
DivInstrument* DivEngine::getIns(int index, DivInstrumentType fallbackType) {
|
||||
if (index==-2 && tempIns!=NULL) return tempIns;
|
||||
if (index==-2 && tempIns!=NULL) {
|
||||
return tempIns;
|
||||
}
|
||||
if (index<0 || index>=song.insLen) {
|
||||
switch (fallbackType) {
|
||||
case DIV_INS_OPLL:
|
||||
|
|
@ -2027,7 +2029,7 @@ void DivEngine::autoNoteOn(int ch, int ins, int note, int vol) {
|
|||
}
|
||||
|
||||
do {
|
||||
if ((ins<0 || ins>=song.insLen || getChannelType(finalChan)==4 || getPreferInsType(finalChan)==getIns(ins)->type || getIns(ins)->type==DIV_INS_AMIGA) && chan[finalChan].midiNote==-1) {
|
||||
if ((ins==-1 || ins>=song.insLen || getChannelType(finalChan)==4 || getPreferInsType(finalChan)==getIns(ins)->type || getIns(ins)->type==DIV_INS_AMIGA) && chan[finalChan].midiNote==-1) {
|
||||
chan[finalChan].midiNote=note;
|
||||
pendingNotes.push(DivNoteEvent(finalChan,ins,note,vol,true));
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class DivPlatformAmiga: public DivDispatch {
|
|||
int audSub;
|
||||
signed char audDat;
|
||||
int sample, wave;
|
||||
unsigned char ins;
|
||||
int ins;
|
||||
int busClock;
|
||||
int note;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, useWave, setPos, useV, useP;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class DivPlatformArcade: public DivDispatch {
|
|||
DivMacroInt std;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins;
|
||||
int ins;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, portaPause, furnacePCM, hardReset;
|
||||
int vol, outVol;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ class DivPlatformAY8910: public DivDispatch {
|
|||
struct Channel {
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, note, pitch;
|
||||
unsigned char ins, psgMode, autoEnvNum, autoEnvDen;
|
||||
int ins;
|
||||
unsigned char psgMode, autoEnvNum, autoEnvDen;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta;
|
||||
int vol, outVol;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@ class DivPlatformAY8930: public DivDispatch {
|
|||
struct Channel {
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, note, pitch;
|
||||
unsigned char ins, psgMode, autoEnvNum, autoEnvDen, duty;
|
||||
int ins;
|
||||
unsigned char psgMode, autoEnvNum, autoEnvDen, duty;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta;
|
||||
int vol, outVol;
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
|
||||
class DivPlatformBubSysWSG: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta;
|
||||
signed char vol, outVol, wave;
|
||||
signed char waveROM[32] = {0}; // 4 bit PROM per channel on bubble system
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
class DivPlatformC64: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, prevFreq, testWhen, note;
|
||||
unsigned char ins, sweep, wave, attack, decay, sustain, release;
|
||||
int freq, baseFreq, pitch, prevFreq, testWhen, note, ins;
|
||||
unsigned char sweep, wave, attack, decay, sustain, release;
|
||||
short duty;
|
||||
bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, filter;
|
||||
bool resetMask, resetFilter, resetDuty, ring, sync;
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
class DivPlatformFDS: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, prevFreq, note, modFreq;
|
||||
unsigned char ins, duty, sweep, modDepth, modPos;
|
||||
int freq, baseFreq, pitch, prevFreq, note, modFreq, ins;
|
||||
unsigned char duty, sweep, modDepth, modPos;
|
||||
bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, modOn;
|
||||
signed char vol, outVol, wave;
|
||||
signed char modTable[32];
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
|
||||
class DivPlatformGB: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins, duty, sweep;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
unsigned char duty, sweep;
|
||||
bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta;
|
||||
signed char vol, outVol, wave;
|
||||
DivMacroInt std;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class DivPlatformGenesis: public DivDispatch {
|
|||
DivMacroInt std;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch, portaPauseFreq, note;
|
||||
unsigned char ins;
|
||||
int ins;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, furnaceDac, inPorta, hardReset;
|
||||
int vol, outVol;
|
||||
unsigned char pan;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ class DivPlatformGenesisExt: public DivPlatformGenesis {
|
|||
struct OpChannel {
|
||||
DivMacroInt std;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch, portaPauseFreq;
|
||||
unsigned char ins;
|
||||
int freq, baseFreq, pitch, portaPauseFreq, ins;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause;
|
||||
int vol;
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ class DivPlatformLynx: public DivDispatch {
|
|||
DivMacroInt std;
|
||||
MikeyFreqDiv fd;
|
||||
MikeyDuty duty;
|
||||
int baseFreq, pitch, note, actualNote, lfsr;
|
||||
unsigned char ins, pan;
|
||||
int baseFreq, pitch, note, actualNote, lfsr, ins;
|
||||
unsigned char pan;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta;
|
||||
signed char vol, outVol;
|
||||
Channel():
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
class DivPlatformMMC5: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, prevFreq, note;
|
||||
unsigned char ins, duty, sweep;
|
||||
int freq, baseFreq, pitch, prevFreq, note, ins;
|
||||
unsigned char duty, sweep;
|
||||
bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, furnaceDac;
|
||||
signed char vol, outVol, wave;
|
||||
DivMacroInt std;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
class DivPlatformNES: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, prevFreq, note;
|
||||
unsigned char ins, duty, sweep;
|
||||
int freq, baseFreq, pitch, prevFreq, note, ins;
|
||||
unsigned char duty, sweep;
|
||||
bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, furnaceDac;
|
||||
signed char vol, outVol, wave;
|
||||
DivMacroInt std;
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ class DivPlatformOPL: public DivDispatch {
|
|||
DivInstrumentFM state;
|
||||
DivMacroInt std;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, furnaceDac, inPorta, fourOp;
|
||||
int vol, outVol;
|
||||
unsigned char pan;
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ class DivPlatformOPLL: public DivDispatch {
|
|||
DivInstrumentFM state;
|
||||
DivMacroInt std;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, furnaceDac, inPorta;
|
||||
int vol, outVol;
|
||||
unsigned char pan;
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ class DivPlatformPCE: public DivDispatch {
|
|||
int freq, baseFreq, pitch, note;
|
||||
int dacPeriod, dacRate;
|
||||
unsigned int dacPos;
|
||||
int dacSample;
|
||||
unsigned char ins, pan;
|
||||
int dacSample, ins;
|
||||
unsigned char pan;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, noise, pcm, furnaceDac;
|
||||
signed char vol, outVol, wave;
|
||||
DivMacroInt std;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
class DivPlatformPCSpeaker: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins, duty, sweep;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
unsigned char duty, sweep;
|
||||
bool active, insChanged, freqChanged, sweepChanged, keyOn, keyOff, inPorta, furnaceDac;
|
||||
signed char vol, outVol, wave;
|
||||
DivMacroInt std;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@
|
|||
|
||||
class DivPlatformPET: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta;
|
||||
int vol, outVol, wave;
|
||||
unsigned char sreg;
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ class DivPlatformQSound: public DivDispatch {
|
|||
int freq, baseFreq, pitch;
|
||||
unsigned short audLen;
|
||||
unsigned int audPos;
|
||||
int sample, wave;
|
||||
unsigned char ins;
|
||||
int sample, wave, ins;
|
||||
int note;
|
||||
int panning;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, useWave;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ class DivPlatformSAA1099: public DivDispatch {
|
|||
protected:
|
||||
struct Channel {
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins, psgMode;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
unsigned char psgMode;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta;
|
||||
int vol, outVol;
|
||||
|
|
|
|||
|
|
@ -29,8 +29,7 @@ class DivPlatformSegaPCM: public DivDispatch {
|
|||
struct Channel {
|
||||
DivMacroInt std;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, portaPause, furnacePCM;
|
||||
int vol, outVol;
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
|
||||
class DivPlatformSMS: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, note, actualNote;
|
||||
unsigned char ins;
|
||||
int freq, baseFreq, pitch, note, actualNote, ins;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta;
|
||||
signed char vol, outVol;
|
||||
DivMacroInt std;
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@
|
|||
|
||||
class DivPlatformSwan: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins, pan;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
unsigned char pan;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta;
|
||||
int vol, outVol, wave;
|
||||
DivMacroInt std;
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
class DivPlatformTIA: public DivDispatch {
|
||||
protected:
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins, shape;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
unsigned char shape;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta;
|
||||
int vol, outVol;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,7 @@ class DivPlatformTX81Z: public DivDispatch {
|
|||
DivInstrumentFM state;
|
||||
DivMacroInt std;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, portaPause, furnacePCM, hardReset;
|
||||
int vol, outVol;
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ struct VERA_PCM;
|
|||
class DivPlatformVERA: public DivDispatch {
|
||||
protected:
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins, pan;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
unsigned char pan;
|
||||
bool active, freqChanged, inPorta;
|
||||
int vol, outVol;
|
||||
unsigned accum;
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
|
||||
class DivPlatformVIC20: public DivDispatch {
|
||||
struct Channel {
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins, pan;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
unsigned char pan;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta;
|
||||
int vol, outVol, wave, waveWriteCycle;
|
||||
DivMacroInt std;
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ class DivPlatformVRC6: public DivDispatch {
|
|||
int freq, baseFreq, pitch, note;
|
||||
int dacPeriod, dacRate, dacOut;
|
||||
unsigned int dacPos;
|
||||
int dacSample;
|
||||
unsigned char ins, duty;
|
||||
int dacSample, ins;
|
||||
unsigned char duty;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, pcm, furnaceDac;
|
||||
signed char vol, outVol;
|
||||
DivMacroInt std;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ class DivPlatformYM2610: public DivDispatch {
|
|||
struct Channel {
|
||||
DivInstrumentFM state;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins, psgMode, autoEnvNum, autoEnvDen;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
unsigned char psgMode, autoEnvNum, autoEnvDen;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta, furnacePCM, hardReset;
|
||||
int vol, outVol;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ class DivPlatformYM2610B: public DivDispatch {
|
|||
struct Channel {
|
||||
DivInstrumentFM state;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch, note;
|
||||
unsigned char ins, psgMode, autoEnvNum, autoEnvDen;
|
||||
int freq, baseFreq, pitch, note, ins;
|
||||
unsigned char psgMode, autoEnvNum, autoEnvDen;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause, inPorta, furnacePCM, hardReset;
|
||||
int vol, outVol;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ class DivPlatformYM2610BExt: public DivPlatformYM2610B {
|
|||
struct OpChannel {
|
||||
DivMacroInt std;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch;
|
||||
unsigned char ins;
|
||||
int freq, baseFreq, pitch, ins;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause;
|
||||
int vol;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ class DivPlatformYM2610Ext: public DivPlatformYM2610 {
|
|||
struct OpChannel {
|
||||
DivMacroInt std;
|
||||
unsigned char freqH, freqL;
|
||||
int freq, baseFreq, pitch;
|
||||
unsigned char ins;
|
||||
int freq, baseFreq, pitch, ins;
|
||||
signed char konCycles;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, portaPause;
|
||||
int vol;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue