diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 5607defc..da52342f 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -520,19 +520,34 @@ class DivDispatch { /** * Get sample memory buffer. + * @param index the memory index. + * @return a pointer to sample memory, or NULL. */ virtual const void* getSampleMem(int index = 0); /** * Get sample memory capacity. + * @param index the memory index. + * @return memory capacity in bytes, or 0 if memory doesn't exist. */ virtual size_t getSampleMemCapacity(int index = 0); /** * Get sample memory usage. + * @param index the memory index. + * @return memory usage in bytes. */ virtual size_t getSampleMemUsage(int index = 0); + /** + * check whether sample has been loaded in memory. + * @param memory index. + * @param sample the sample in question. + * @return whether it did. + */ + virtual bool isSampleLoaded(int index, int sample); + + /** * Render samples into sample memory. */ diff --git a/src/engine/platform/abstract.cpp b/src/engine/platform/abstract.cpp index 8b3239f0..9b5c377c 100644 --- a/src/engine/platform/abstract.cpp +++ b/src/engine/platform/abstract.cpp @@ -156,6 +156,10 @@ size_t DivDispatch::getSampleMemUsage(int index) { return 0; } +bool DivDispatch::isSampleLoaded(int index, int sample) { + return false; +} + void DivDispatch::renderSamples() { } diff --git a/src/engine/platform/msm6258.cpp b/src/engine/platform/msm6258.cpp index 17e88ae6..a5e0192f 100644 --- a/src/engine/platform/msm6258.cpp +++ b/src/engine/platform/msm6258.cpp @@ -362,6 +362,12 @@ size_t DivPlatformMSM6258::getSampleMemUsage(int index) { return index == 0 ? adpcmMemLen : 0; } +bool DivPlatformMSM6258::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + void DivPlatformMSM6258::renderSamples() { memset(adpcmMem,0,getSampleMemCapacity(0)); diff --git a/src/engine/platform/msm6258.h b/src/engine/platform/msm6258.h index 02ec7e14..d4d10cf0 100644 --- a/src/engine/platform/msm6258.h +++ b/src/engine/platform/msm6258.h @@ -81,6 +81,7 @@ class DivPlatformMSM6258: public DivDispatch { unsigned char* adpcmMem; size_t adpcmMemLen; + bool sampleLoaded[256]; unsigned char sampleBank, msmPan, msmDivider, rateSel, msmClock, clockSel; signed char msmDividerCount, msmClockCount; short msmOut; @@ -113,6 +114,7 @@ class DivPlatformMSM6258: public DivDispatch { const void* getSampleMem(int index); size_t getSampleMemCapacity(int index); size_t getSampleMemUsage(int index); + bool isSampleLoaded(int index, int sample); void renderSamples(); int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); diff --git a/src/engine/platform/msm6295.cpp b/src/engine/platform/msm6295.cpp index d46a9bb6..3c590e1b 100644 --- a/src/engine/platform/msm6295.cpp +++ b/src/engine/platform/msm6295.cpp @@ -335,6 +335,12 @@ size_t DivPlatformMSM6295::getSampleMemUsage(int index) { return index == 0 ? adpcmMemLen : 0; } +bool DivPlatformMSM6295::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + void DivPlatformMSM6295::renderSamples() { unsigned int sampleOffVOX[256]; diff --git a/src/engine/platform/msm6295.h b/src/engine/platform/msm6295.h index 40d35757..c9aecbb2 100644 --- a/src/engine/platform/msm6295.h +++ b/src/engine/platform/msm6295.h @@ -68,6 +68,7 @@ class DivPlatformMSM6295: public DivDispatch, public vgsound_emu_mem_intf { unsigned char* adpcmMem; size_t adpcmMemLen; + bool sampleLoaded[256]; unsigned char sampleBank; int delay, updateOsc; @@ -101,6 +102,7 @@ class DivPlatformMSM6295: public DivDispatch, public vgsound_emu_mem_intf { virtual const void* getSampleMem(int index) override; virtual size_t getSampleMemCapacity(int index) override; virtual size_t getSampleMemUsage(int index) override; + virtual bool isSampleLoaded(int index, int sample) override; virtual void renderSamples() override; virtual int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags) override; diff --git a/src/engine/platform/nes.cpp b/src/engine/platform/nes.cpp index 47d81573..4ed958f3 100644 --- a/src/engine/platform/nes.cpp +++ b/src/engine/platform/nes.cpp @@ -721,6 +721,12 @@ size_t DivPlatformNES::getSampleMemUsage(int index) { return index==0?dpcmMemLen:0; } +bool DivPlatformNES::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + void DivPlatformNES::renderSamples() { memset(dpcmMem,0,getSampleMemCapacity(0)); diff --git a/src/engine/platform/nes.h b/src/engine/platform/nes.h index 16f52f20..d3965a1e 100644 --- a/src/engine/platform/nes.h +++ b/src/engine/platform/nes.h @@ -68,6 +68,7 @@ class DivPlatformNES: public DivDispatch { int dacSample; unsigned char* dpcmMem; size_t dpcmMemLen; + bool sampleLoaded[256]; unsigned char dpcmBank; unsigned char sampleBank; unsigned char writeOscBuf; @@ -115,6 +116,7 @@ class DivPlatformNES: public DivDispatch { const void* getSampleMem(int index); size_t getSampleMemCapacity(int index); size_t getSampleMemUsage(int index); + bool isSampleLoaded(int index, int sample); void renderSamples(); int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); void quit(); diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index e7152bca..b4446657 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -1757,6 +1757,12 @@ size_t DivPlatformOPL::getSampleMemUsage(int index) { return (index==0 && adpcmChan>=0) ? adpcmBMemLen : 0; } +bool DivPlatformOPL::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + void DivPlatformOPL::renderSamples() { if (adpcmChan<0) return; memset(adpcmBMem,0,getSampleMemCapacity(0)); diff --git a/src/engine/platform/opl.h b/src/engine/platform/opl.h index 8fe8cb25..3eb1da77 100644 --- a/src/engine/platform/opl.h +++ b/src/engine/platform/opl.h @@ -91,6 +91,7 @@ class DivPlatformOPL: public DivDispatch { size_t adpcmBMemLen; DivOPLAInterface iface; unsigned int sampleOffB[256]; + bool sampleLoaded[256]; ymfm::adpcm_b_engine* adpcmB; const unsigned char** slotsNonDrums; @@ -152,6 +153,7 @@ class DivPlatformOPL: public DivDispatch { const void* getSampleMem(int index); size_t getSampleMemCapacity(int index); size_t getSampleMemUsage(int index); + bool isSampleLoaded(int index, int sample); void renderSamples(); int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); void quit(); diff --git a/src/engine/platform/qsound.cpp b/src/engine/platform/qsound.cpp index 31525528..97cf3f39 100644 --- a/src/engine/platform/qsound.cpp +++ b/src/engine/platform/qsound.cpp @@ -644,6 +644,12 @@ size_t DivPlatformQSound::getSampleMemUsage(int index) { return index == 0 ? sampleMemLen : 0; } +bool DivPlatformQSound::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + // TODO: ADPCM... come on... void DivPlatformQSound::renderSamples() { memset(sampleMem,0,getSampleMemCapacity()); diff --git a/src/engine/platform/qsound.h b/src/engine/platform/qsound.h index 89488627..d092d4d9 100644 --- a/src/engine/platform/qsound.h +++ b/src/engine/platform/qsound.h @@ -69,6 +69,7 @@ class DivPlatformQSound: public DivDispatch { unsigned char* sampleMem; size_t sampleMemLen; + bool sampleLoaded[256]; struct qsound_chip chip; unsigned short regPool[512]; @@ -103,6 +104,7 @@ class DivPlatformQSound: public DivDispatch { const void* getSampleMem(int index = 0); size_t getSampleMemCapacity(int index = 0); size_t getSampleMemUsage(int index = 0); + bool isSampleLoaded(int index, int sample); void renderSamples(); int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); void quit(); diff --git a/src/engine/platform/rf5c68.cpp b/src/engine/platform/rf5c68.cpp index d0786896..eec62f5b 100644 --- a/src/engine/platform/rf5c68.cpp +++ b/src/engine/platform/rf5c68.cpp @@ -385,6 +385,12 @@ size_t DivPlatformRF5C68::getSampleMemUsage(int index) { return index == 0 ? sampleMemLen : 0; } +bool DivPlatformRF5C68::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + void DivPlatformRF5C68::renderSamples() { memset(sampleMem,0,getSampleMemCapacity()); memset(sampleOffRFC,0,256*sizeof(unsigned int)); diff --git a/src/engine/platform/rf5c68.h b/src/engine/platform/rf5c68.h index 4c64c2d6..84cb6867 100644 --- a/src/engine/platform/rf5c68.h +++ b/src/engine/platform/rf5c68.h @@ -67,6 +67,7 @@ class DivPlatformRF5C68: public DivDispatch { int chipType; unsigned char curChan; unsigned int sampleOffRFC[256]; + bool sampleLoaded[256]; unsigned char* sampleMem; size_t sampleMemLen; @@ -99,6 +100,7 @@ class DivPlatformRF5C68: public DivDispatch { const void* getSampleMem(int index = 0); size_t getSampleMemCapacity(int index = 0); size_t getSampleMemUsage(int index = 0); + bool isSampleLoaded(int index, int sample); void renderSamples(); int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); void quit(); diff --git a/src/engine/platform/snes.cpp b/src/engine/platform/snes.cpp index f7790e42..8ab24dda 100644 --- a/src/engine/platform/snes.cpp +++ b/src/engine/platform/snes.cpp @@ -797,6 +797,12 @@ size_t DivPlatformSNES::getSampleMemUsage(int index) { return index == 0 ? sampleMemLen : 0; } +bool DivPlatformSNES::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + void DivPlatformSNES::renderSamples() { memset(copyOfSampleMem,0,getSampleMemCapacity()); memset(sampleOff,0,256*sizeof(unsigned int)); diff --git a/src/engine/platform/snes.h b/src/engine/platform/snes.h index a21db150..ad3b0ab2 100644 --- a/src/engine/platform/snes.h +++ b/src/engine/platform/snes.h @@ -109,6 +109,7 @@ class DivPlatformSNES: public DivDispatch { signed char copyOfSampleMem[65536]; size_t sampleMemLen; unsigned int sampleOff[256]; + bool sampleLoaded[256]; unsigned char regPool[0x80]; SPC_DSP dsp; friend void putDispatchChan(void*,int,int); @@ -136,6 +137,7 @@ class DivPlatformSNES: public DivDispatch { const void* getSampleMem(int index = 0); size_t getSampleMemCapacity(int index = 0); size_t getSampleMemUsage(int index = 0); + bool isSampleLoaded(int index, int sample); void renderSamples(); int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); void quit(); diff --git a/src/engine/platform/su.cpp b/src/engine/platform/su.cpp index c00847fc..6833eac1 100644 --- a/src/engine/platform/su.cpp +++ b/src/engine/platform/su.cpp @@ -547,6 +547,12 @@ size_t DivPlatformSoundUnit::getSampleMemUsage(int index) { return (index==0)?sampleMemLen:0; } +bool DivPlatformSoundUnit::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + void DivPlatformSoundUnit::renderSamples() { memset(su->pcm,0,getSampleMemCapacity(0)); memset(sampleOffSU,0,256*sizeof(unsigned int)); diff --git a/src/engine/platform/su.h b/src/engine/platform/su.h index 004c04c5..e7eff8d4 100644 --- a/src/engine/platform/su.h +++ b/src/engine/platform/su.h @@ -102,6 +102,7 @@ class DivPlatformSoundUnit: public DivDispatch { unsigned char initIlCtrl, initIlSize, initFil1; signed char echoVol, initEchoVol; unsigned int sampleOffSU[256]; + bool sampleLoaded[256]; int cycles, curChan, delay; short tempL; @@ -138,6 +139,7 @@ class DivPlatformSoundUnit: public DivDispatch { const void* getSampleMem(int index); size_t getSampleMemCapacity(int index); size_t getSampleMemUsage(int index); + bool isSampleLoaded(int index, int sample); void renderSamples(); int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); void quit(); diff --git a/src/engine/platform/x1_010.cpp b/src/engine/platform/x1_010.cpp index 6f220242..f017d6c3 100644 --- a/src/engine/platform/x1_010.cpp +++ b/src/engine/platform/x1_010.cpp @@ -949,6 +949,12 @@ size_t DivPlatformX1_010::getSampleMemUsage(int index) { return index >= 0 ? sampleMemLen : 0; } +bool DivPlatformX1_010::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + void DivPlatformX1_010::renderSamples() { memset(sampleMem,0,getSampleMemCapacity()); memset(sampleOffX1,0,256*sizeof(unsigned int)); diff --git a/src/engine/platform/x1_010.h b/src/engine/platform/x1_010.h index ff5557bb..e54a3e89 100644 --- a/src/engine/platform/x1_010.h +++ b/src/engine/platform/x1_010.h @@ -116,6 +116,7 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf { bool isBanked=false; unsigned int bankSlot[8]; unsigned int sampleOffX1[256]; + bool sampleLoaded[256]; unsigned char regPool[0x2000]; double NoteX1_010(int ch, int note); @@ -146,6 +147,7 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf { const void* getSampleMem(int index = 0); size_t getSampleMemCapacity(int index = 0); size_t getSampleMemUsage(int index = 0); + bool isSampleLoaded(int index, int sample); void renderSamples(); const char** getRegisterSheet(); void setBanked(bool banked); diff --git a/src/engine/platform/ym2608.cpp b/src/engine/platform/ym2608.cpp index a58bad8d..2995c6da 100644 --- a/src/engine/platform/ym2608.cpp +++ b/src/engine/platform/ym2608.cpp @@ -1336,6 +1336,12 @@ size_t DivPlatformYM2608::getSampleMemUsage(int index) { return index == 0 ? adpcmBMemLen : 0; } +bool DivPlatformYM2608::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + void DivPlatformYM2608::renderSamples() { memset(adpcmBMem,0,getSampleMemCapacity(0)); memset(sampleOffB,0,256*sizeof(unsigned int)); diff --git a/src/engine/platform/ym2608.h b/src/engine/platform/ym2608.h index f4c101c2..81a6844d 100644 --- a/src/engine/platform/ym2608.h +++ b/src/engine/platform/ym2608.h @@ -100,6 +100,7 @@ class DivPlatformYM2608: public DivPlatformOPN { size_t adpcmBMemLen; DivYM2608Interface iface; unsigned int sampleOffB[256]; + bool sampleLoaded[256]; DivPlatformAY8910* ay; unsigned char sampleBank; @@ -137,6 +138,7 @@ class DivPlatformYM2608: public DivPlatformOPN { const void* getSampleMem(int index); size_t getSampleMemCapacity(int index); size_t getSampleMemUsage(int index); + bool isSampleLoaded(int index, int sample); void renderSamples(); void setFlags(const DivConfig& flags); int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); diff --git a/src/engine/platform/ym2610shared.h b/src/engine/platform/ym2610shared.h index 4b69920c..6dd3bbba 100644 --- a/src/engine/platform/ym2610shared.h +++ b/src/engine/platform/ym2610shared.h @@ -142,6 +142,8 @@ template class DivPlatformYM2610Base: public DivPlatformOPN { unsigned char sampleBank; bool extMode, noExtMacros; + + bool sampleLoaded[2][256]; unsigned char writeADPCMAOff, writeADPCMAOn; int globalADPCMAVolume; @@ -208,10 +210,17 @@ template class DivPlatformYM2610Base: public DivPlatformOPN { return index == 0 ? adpcmAMemLen : index == 1 ? adpcmBMemLen : 0; } + bool isSampleLoaded(int index, int sample) { + if (index<0 || index>1) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[index][sample]; + } + void renderSamples() { memset(adpcmAMem,0,getSampleMemCapacity(0)); memset(sampleOffA,0,256*sizeof(unsigned int)); memset(sampleOffB,0,256*sizeof(unsigned int)); + memset(sampleLoaded,0,256*2*sizeof(bool)); size_t memPos=0; for (int i=0; isong.sampleLen; i++) { @@ -231,6 +240,7 @@ template class DivPlatformYM2610Base: public DivPlatformOPN { memcpy(adpcmAMem+memPos,s->dataA,paddedLen); } sampleOffA[i]=memPos; + sampleLoaded[0][i]=true; memPos+=paddedLen; } adpcmAMemLen=memPos+256; @@ -255,6 +265,7 @@ template class DivPlatformYM2610Base: public DivPlatformOPN { memcpy(adpcmBMem+memPos,s->dataB,paddedLen); } sampleOffB[i]=memPos; + sampleLoaded[1][i]=true; memPos+=paddedLen; } adpcmBMemLen=memPos+256; diff --git a/src/engine/platform/ymz280b.cpp b/src/engine/platform/ymz280b.cpp index 5ad8a0ed..91d63e3b 100644 --- a/src/engine/platform/ymz280b.cpp +++ b/src/engine/platform/ymz280b.cpp @@ -420,6 +420,12 @@ size_t DivPlatformYMZ280B::getSampleMemUsage(int index) { return index == 0 ? sampleMemLen : 0; } +bool DivPlatformYMZ280B::isSampleLoaded(int index, int sample) { + if (index!=0) return false; + if (sample<0 || sample>255) return false; + return sampleLoaded[sample]; +} + void DivPlatformYMZ280B::renderSamples() { memset(sampleMem,0,getSampleMemCapacity()); memset(sampleOff,0,256*sizeof(unsigned int)); diff --git a/src/engine/platform/ymz280b.h b/src/engine/platform/ymz280b.h index 3b4b60d5..7e8ceb67 100644 --- a/src/engine/platform/ymz280b.h +++ b/src/engine/platform/ymz280b.h @@ -67,6 +67,7 @@ class DivPlatformYMZ280B: public DivDispatch { bool isMuted[8]; int chipType; unsigned int sampleOff[256]; + bool sampleLoaded[256]; unsigned char* sampleMem; size_t sampleMemLen; @@ -99,6 +100,7 @@ class DivPlatformYMZ280B: public DivDispatch { const void* getSampleMem(int index = 0); size_t getSampleMemCapacity(int index = 0); size_t getSampleMemUsage(int index = 0); + bool isSampleLoaded(int index, int sample); void renderSamples(); void setFlags(const DivConfig& flags); int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags); diff --git a/src/gui/gui.h b/src/gui/gui.h index 80e9909f..a371789f 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -227,6 +227,13 @@ enum FurnaceGUIColors { GUI_COLOR_SAMPLE_SEL, GUI_COLOR_SAMPLE_SEL_POINT, GUI_COLOR_SAMPLE_NEEDLE, + GUI_COLOR_SAMPLE_NEEDLE_PLAYING, + GUI_COLOR_SAMPLE_LOOP_POINT, + GUI_COLOR_SAMPLE_TIME_BG, + GUI_COLOR_SAMPLE_TIME_FG, + GUI_COLOR_SAMPLE_CHIP_DISABLED, + GUI_COLOR_SAMPLE_CHIP_ENABLED, + GUI_COLOR_SAMPLE_CHIP_WARNING, GUI_COLOR_PAT_MANAGER_NULL, GUI_COLOR_PAT_MANAGER_USED, diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index b542b3f7..07716653 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -860,6 +860,13 @@ const FurnaceGUIColorDef guiColors[GUI_COLOR_MAX]={ D(GUI_COLOR_SAMPLE_SEL,"",ImVec4(0.26f,0.59f,0.98f,0.25f)), D(GUI_COLOR_SAMPLE_SEL_POINT,"",ImVec4(0.06f,0.53f,0.98f,0.5f)), D(GUI_COLOR_SAMPLE_NEEDLE,"",ImVec4(1.0f,0.8f,0.0f,1.0f)), + D(GUI_COLOR_SAMPLE_NEEDLE_PLAYING,"",ImVec4(0.2f,1.0f,0.0f,1.0f)), + D(GUI_COLOR_SAMPLE_LOOP_POINT,"",ImVec4(1.0f,0.0f,0.0f,1.0f)), + D(GUI_COLOR_SAMPLE_TIME_BG,"",ImVec4(0.1f,0.11f,0.12f,1.0f)), + D(GUI_COLOR_SAMPLE_TIME_FG,"",ImVec4(0.4f,0.4f,0.4f,1.0f)), + D(GUI_COLOR_SAMPLE_CHIP_DISABLED,"",ImVec4(0.6f,0.6f,0.6f,1.0f)), + D(GUI_COLOR_SAMPLE_CHIP_ENABLED,"",ImVec4(0.3f,1.0f,0.3f,1.0f)), + D(GUI_COLOR_SAMPLE_CHIP_WARNING,"",ImVec4(1.0f,0.75f,0.3f,1.0f)), D(GUI_COLOR_PAT_MANAGER_NULL,"",ImVec4(0.15f,0.15f,0.15f,1.0f)), D(GUI_COLOR_PAT_MANAGER_USED,"",ImVec4(0.15f,1.0f,0.15f,1.0f)), diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index 9f692c77..676481f6 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -277,6 +277,7 @@ void FurnaceGUI::drawSampleEdit() { bool isChipVisible[32]; bool isTypeVisible[4]; bool isMemVisible[4][32]; + bool isMemWarning[4][32]; memset(isChipVisible,0,32*sizeof(bool)); memset(isTypeVisible,0,4*sizeof(bool)); memset(isMemVisible,0,32*4*sizeof(bool)); @@ -289,6 +290,7 @@ void FurnaceGUI::drawSampleEdit() { isChipVisible[i]=true; isTypeVisible[j]=true; isMemVisible[j][i]=true; + if (!dispatch->isSampleLoaded(j,curSample)) isMemWarning[j][i]=true; } } int selColumns=1; @@ -319,9 +321,41 @@ void FurnaceGUI::drawSampleEdit() { if (!isMemVisible[i][j]) continue; snprintf(id,1023,"##_SEC%d_%d",i,j); + + ImVec4 baseColor=sample->renderOn[i][j]?(isMemWarning[i][j]?uiColors[GUI_COLOR_SAMPLE_CHIP_WARNING]:uiColors[GUI_COLOR_SAMPLE_CHIP_ENABLED]):uiColors[GUI_COLOR_SAMPLE_CHIP_DISABLED]; + ImVec4 color=baseColor; + ImVec4 colorHovered=baseColor; + ImVec4 colorActive=baseColor; + + if (settings.guiColorsBase) { + color.x*=0.8f; + color.y*=0.8f; + color.z*=0.8f; + colorHovered.x*=0.65f; + colorHovered.y*=0.65f; + colorHovered.z*=0.65f; + colorActive.x*=0.3f; + colorActive.y*=0.3f; + colorActive.z*=0.3f; + } else { + color.x*=0.2f; + color.y*=0.2f; + color.z*=0.2f; + colorHovered.x*=0.4f; + colorHovered.y*=0.4f; + colorHovered.z*=0.4f; + } + + ImGui::PushStyleColor(ImGuiCol_FrameBg,color); + ImGui::PushStyleColor(ImGuiCol_FrameBgHovered,colorHovered); + ImGui::PushStyleColor(ImGuiCol_FrameBgActive,colorActive); + ImGui::PushStyleColor(ImGuiCol_CheckMark,baseColor); + if (ImGui::Checkbox(id,&sample->renderOn[i][j])) { e->renderSamplesP(); } + + ImGui::PopStyleColor(4); } } ImGui::EndTable(); diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 1fae2792..90ce5bff 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -1843,12 +1843,19 @@ void FurnaceGUI::drawSettings() { if (ImGui::TreeNode("Sample Editor")) { UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_BG,"Background"); UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_FG,"Waveform"); + UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_TIME_BG,"Time background"); + UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_TIME_FG,"Time text"); UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_LOOP,"Loop region"); UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_CENTER,"Center guide"); UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_GRID,"Grid"); UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_SEL,"Selection"); UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_SEL_POINT,"Selection points"); UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_NEEDLE,"Preview needle"); + UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_NEEDLE_PLAYING,"Playing needles"); + UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_LOOP_POINT,"Loop markers"); + UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_CHIP_DISABLED,"Chip select: disabled"); + UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_CHIP_ENABLED,"Chip select: enabled"); + UI_COLOR_CONFIG(GUI_COLOR_SAMPLE_CHIP_WARNING,"Chip select: enabled (failure)"); ImGui::TreePop(); } if (ImGui::TreeNode("Pattern Manager")) {