mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-23 13:05:11 +00:00
GUI: add an FM preview
currently for OPN only
This commit is contained in:
parent
57f4cc8561
commit
09a30570de
7 changed files with 141 additions and 82 deletions
|
@ -455,12 +455,14 @@ void FurnaceGUI::drawInsList(bool asChild) {
|
||||||
if (ImGui::Selectable(name.c_str(),(i==-1)?(curIns<0 || curIns>=e->song.insLen):(curIns==i))) {
|
if (ImGui::Selectable(name.c_str(),(i==-1)?(curIns<0 || curIns>=e->song.insLen):(curIns==i))) {
|
||||||
curIns=i;
|
curIns=i;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
if (wantScrollList && curIns==i) ImGui::SetScrollHereY();
|
if (wantScrollList && curIns==i) ImGui::SetScrollHereY();
|
||||||
if (settings.insFocusesPattern && patternOpen && ImGui::IsItemActivated()) {
|
if (settings.insFocusesPattern && patternOpen && ImGui::IsItemActivated()) {
|
||||||
nextWindow=GUI_WINDOW_PATTERN;
|
nextWindow=GUI_WINDOW_PATTERN;
|
||||||
curIns=i;
|
curIns=i;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered() && i>=0 && !mobileUI) {
|
if (ImGui::IsItemHovered() && i>=0 && !mobileUI) {
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_TEXT]);
|
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_TEXT]);
|
||||||
|
@ -474,6 +476,7 @@ void FurnaceGUI::drawInsList(bool asChild) {
|
||||||
if (i>=0) {
|
if (i>=0) {
|
||||||
if (ImGui::BeginPopupContextItem("InsRightMenu")) {
|
if (ImGui::BeginPopupContextItem("InsRightMenu")) {
|
||||||
curIns=i;
|
curIns=i;
|
||||||
|
updateFMPreview=true;
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_TEXT]);
|
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_TEXT]);
|
||||||
if (ImGui::MenuItem("replace...")) {
|
if (ImGui::MenuItem("replace...")) {
|
||||||
doAction((curIns>=0 && curIns<(int)e->song.ins.size())?GUI_ACTION_INS_LIST_OPEN_REPLACE:GUI_ACTION_INS_LIST_OPEN);
|
doAction((curIns>=0 && curIns<(int)e->song.ins.size())?GUI_ACTION_INS_LIST_OPEN_REPLACE:GUI_ACTION_INS_LIST_OPEN);
|
||||||
|
|
|
@ -520,10 +520,6 @@ void FurnaceGUI::drawDebug() {
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
if (ImGui::TreeNode("FM Preview")) {
|
if (ImGui::TreeNode("FM Preview")) {
|
||||||
if (ImGui::Button("Generate")) {
|
|
||||||
DivInstrument* ins=e->getIns(curIns);
|
|
||||||
if (ins!=NULL) renderFMPreview(ins->fm);
|
|
||||||
}
|
|
||||||
float asFloat[FM_PREVIEW_SIZE];
|
float asFloat[FM_PREVIEW_SIZE];
|
||||||
for (int i=0; i<FM_PREVIEW_SIZE; i++) {
|
for (int i=0; i<FM_PREVIEW_SIZE; i++) {
|
||||||
asFloat[i]=(float)fmPreview[i]/8192.0f;
|
asFloat[i]=(float)fmPreview[i]/8192.0f;
|
||||||
|
|
|
@ -127,6 +127,7 @@ void FurnaceGUI::doAction(int what) {
|
||||||
}
|
}
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
wantScrollList=true;
|
wantScrollList=true;
|
||||||
|
updateFMPreview=true;
|
||||||
break;
|
break;
|
||||||
case GUI_ACTION_INS_DOWN:
|
case GUI_ACTION_INS_DOWN:
|
||||||
if (++curIns>=(int)e->song.ins.size()) {
|
if (++curIns>=(int)e->song.ins.size()) {
|
||||||
|
@ -134,6 +135,7 @@ void FurnaceGUI::doAction(int what) {
|
||||||
}
|
}
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
wantScrollList=true;
|
wantScrollList=true;
|
||||||
|
updateFMPreview=true;
|
||||||
break;
|
break;
|
||||||
case GUI_ACTION_STEP_UP:
|
case GUI_ACTION_STEP_UP:
|
||||||
if (++editStep>64) editStep=64;
|
if (++editStep>64) editStep=64;
|
||||||
|
@ -593,6 +595,7 @@ void FurnaceGUI::doAction(int what) {
|
||||||
wantScrollList=true;
|
wantScrollList=true;
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GUI_ACTION_INS_LIST_DUPLICATE:
|
case GUI_ACTION_INS_LIST_DUPLICATE:
|
||||||
|
@ -606,6 +609,7 @@ void FurnaceGUI::doAction(int what) {
|
||||||
wantScrollList=true;
|
wantScrollList=true;
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -653,11 +657,13 @@ void FurnaceGUI::doAction(int what) {
|
||||||
if (--curIns<0) curIns=0;
|
if (--curIns<0) curIns=0;
|
||||||
wantScrollList=true;
|
wantScrollList=true;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
break;
|
break;
|
||||||
case GUI_ACTION_INS_LIST_DOWN:
|
case GUI_ACTION_INS_LIST_DOWN:
|
||||||
if (++curIns>=(int)e->song.ins.size()) curIns=((int)e->song.ins.size())-1;
|
if (++curIns>=(int)e->song.ins.size()) curIns=((int)e->song.ins.size())-1;
|
||||||
wantScrollList=true;
|
wantScrollList=true;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GUI_ACTION_WAVE_LIST_ADD:
|
case GUI_ACTION_WAVE_LIST_ADD:
|
||||||
|
@ -1366,6 +1372,7 @@ void FurnaceGUI::doAction(int what) {
|
||||||
nextWindow=GUI_WINDOW_INS_EDIT;
|
nextWindow=GUI_WINDOW_INS_EDIT;
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,61 +22,63 @@
|
||||||
#include "../../extern/opn/ym3438.h"
|
#include "../../extern/opn/ym3438.h"
|
||||||
|
|
||||||
#define FM_WRITE(addr,val) \
|
#define FM_WRITE(addr,val) \
|
||||||
OPN2_Write(&fm,0,(addr)); \
|
OPN2_Write((ym3438_t*)fmPreviewOPN,0,(addr)); \
|
||||||
do { \
|
do { \
|
||||||
OPN2_Clock(&fm,out); \
|
OPN2_Clock((ym3438_t*)fmPreviewOPN,out); \
|
||||||
} while (fm.write_busy); \
|
} while (((ym3438_t*)fmPreviewOPN)->write_busy); \
|
||||||
OPN2_Write(&fm,1,(val)); \
|
OPN2_Write((ym3438_t*)fmPreviewOPN,1,(val)); \
|
||||||
do { \
|
do { \
|
||||||
OPN2_Clock(&fm,out); \
|
OPN2_Clock((ym3438_t*)fmPreviewOPN,out); \
|
||||||
} while (fm.write_busy); \
|
} while (((ym3438_t*)fmPreviewOPN)->write_busy); \
|
||||||
|
|
||||||
|
const unsigned char dtTableFMP[8]={
|
||||||
|
7,6,5,0,1,2,3,4
|
||||||
|
};
|
||||||
|
|
||||||
void FurnaceGUI::renderFMPreview(const DivInstrumentFM& params, int pos) {
|
void FurnaceGUI::renderFMPreview(const DivInstrumentFM& params, int pos) {
|
||||||
ym3438_t fm;
|
if (fmPreviewOPN==NULL) {
|
||||||
|
fmPreviewOPN=new ym3438_t;
|
||||||
|
}
|
||||||
short out[2];
|
short out[2];
|
||||||
int aOut=0;
|
int aOut=0;
|
||||||
|
bool mult0=false;
|
||||||
|
|
||||||
OPN2_Reset(&fm);
|
if (pos==0) {
|
||||||
OPN2_SetChipType(&fm,ym3438_mode_opn);
|
OPN2_Reset((ym3438_t*)fmPreviewOPN);
|
||||||
|
OPN2_SetChipType((ym3438_t*)fmPreviewOPN,ym3438_mode_opn);
|
||||||
|
|
||||||
// set params
|
// set params
|
||||||
FM_WRITE(0x50,31); // AR
|
for (int i=0; i<4; i++) {
|
||||||
FM_WRITE(0x54,31);
|
if ((params.op[i].mult&15)==0) {
|
||||||
FM_WRITE(0x58,31);
|
mult0=true;
|
||||||
FM_WRITE(0x5c,31);
|
break;
|
||||||
FM_WRITE(0x60,0); // DR
|
}
|
||||||
FM_WRITE(0x64,0);
|
}
|
||||||
FM_WRITE(0x68,0);
|
for (int i=0; i<4; i++) {
|
||||||
FM_WRITE(0x6c,0);
|
const DivInstrumentFM::Operator& op=params.op[i];
|
||||||
FM_WRITE(0x70,0); // D2R
|
unsigned short baseAddr=i*4;
|
||||||
FM_WRITE(0x74,0);
|
FM_WRITE(baseAddr+0x40,op.tl);
|
||||||
FM_WRITE(0x78,0);
|
FM_WRITE(baseAddr+0x30,(op.mult&15)|(dtTableFMP[op.dt&7]<<4));
|
||||||
FM_WRITE(0x7c,0);
|
FM_WRITE(baseAddr+0x50,(op.ar&31)|(op.rs<<6));
|
||||||
FM_WRITE(0x80,0); // SL/RR
|
FM_WRITE(baseAddr+0x60,(op.dr&31)|(op.am<<7));
|
||||||
FM_WRITE(0x84,0);
|
FM_WRITE(baseAddr+0x70,op.d2r&31);
|
||||||
FM_WRITE(0x88,0);
|
FM_WRITE(baseAddr+0x80,(op.rr&15)|(op.sl<<4));
|
||||||
FM_WRITE(0x8c,0);
|
FM_WRITE(baseAddr+0x90,op.ssgEnv&15);
|
||||||
FM_WRITE(0xa4,0x0c); // frequency
|
}
|
||||||
|
FM_WRITE(0xb0,(params.alg&7)|((params.fb&7)<<3));
|
||||||
|
FM_WRITE(0xb4,0xc0|(params.fms&7)|((params.ams&3)<<4));
|
||||||
|
FM_WRITE(0xa4,mult0?0x1c:0x14); // frequency
|
||||||
FM_WRITE(0xa0,0);
|
FM_WRITE(0xa0,0);
|
||||||
FM_WRITE(0xb0,(params.alg&7)|((params.fb&7)<<3)); // ALG/FB
|
|
||||||
FM_WRITE(0xb4,0xc0); // pan
|
|
||||||
FM_WRITE(0x30,params.op[0].mult&15); // MULT
|
|
||||||
FM_WRITE(0x34,params.op[1].mult&15);
|
|
||||||
FM_WRITE(0x38,params.op[2].mult&15);
|
|
||||||
FM_WRITE(0x3c,params.op[3].mult&15);
|
|
||||||
FM_WRITE(0x40,params.op[0].tl&127); // TL
|
|
||||||
FM_WRITE(0x44,params.op[1].tl&127);
|
|
||||||
FM_WRITE(0x48,params.op[2].tl&127);
|
|
||||||
FM_WRITE(0x4c,params.op[3].tl&127);
|
|
||||||
FM_WRITE(0x28,0xf0); // key on
|
FM_WRITE(0x28,0xf0); // key on
|
||||||
|
}
|
||||||
|
|
||||||
// render
|
// render
|
||||||
for (int i=0; i<FM_PREVIEW_SIZE; i++) {
|
for (int i=0; i<FM_PREVIEW_SIZE; i++) {
|
||||||
aOut=0;
|
aOut=0;
|
||||||
for (int j=0; j<24; j++) {
|
for (int j=0; j<24; j++) {
|
||||||
OPN2_Clock(&fm,out);
|
OPN2_Clock((ym3438_t*)fmPreviewOPN,out);
|
||||||
}
|
}
|
||||||
aOut+=fm.ch_out[0];
|
aOut+=((ym3438_t*)fmPreviewOPN)->ch_out[0];
|
||||||
if (aOut<-32768) aOut=-32768;
|
if (aOut<-32768) aOut=-32768;
|
||||||
if (aOut>32767) aOut=32767;
|
if (aOut>32767) aOut=32767;
|
||||||
fmPreview[i]=aOut;
|
fmPreview[i]=aOut;
|
||||||
|
|
|
@ -1175,6 +1175,7 @@ void FurnaceGUI::valueInput(int num, bool direct, int target) {
|
||||||
if (settings.absorbInsInput) {
|
if (settings.absorbInsInput) {
|
||||||
curIns=pat->data[cursor.y][target];
|
curIns=pat->data[cursor.y][target];
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
makeUndo(GUI_UNDO_PATTERN_EDIT);
|
makeUndo(GUI_UNDO_PATTERN_EDIT);
|
||||||
if (direct) {
|
if (direct) {
|
||||||
|
@ -3404,6 +3405,7 @@ bool FurnaceGUI::loop() {
|
||||||
curIns=msg.data[0];
|
curIns=msg.data[0];
|
||||||
if (curIns>=(int)e->song.ins.size()) curIns=e->song.ins.size()-1;
|
if (curIns>=(int)e->song.ins.size()) curIns=e->song.ins.size()-1;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TA_MIDI_CONTROL:
|
case TA_MIDI_CONTROL:
|
||||||
|
@ -4158,6 +4160,7 @@ bool FurnaceGUI::loop() {
|
||||||
} else {
|
} else {
|
||||||
curIns=prevIns;
|
curIns=prevIns;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
prevIns=-3;
|
prevIns=-3;
|
||||||
}
|
}
|
||||||
|
@ -5155,6 +5158,7 @@ bool FurnaceGUI::loop() {
|
||||||
if (i!=DIV_INS_AMIGA) e->song.ins[curIns]->amiga.useSample=true;
|
if (i!=DIV_INS_AMIGA) e->song.ins[curIns]->amiga.useSample=true;
|
||||||
nextWindow=GUI_WINDOW_INS_EDIT;
|
nextWindow=GUI_WINDOW_INS_EDIT;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
MARK_MODIFIED;
|
MARK_MODIFIED;
|
||||||
}
|
}
|
||||||
|
@ -6016,6 +6020,10 @@ FurnaceGUI::FurnaceGUI():
|
||||||
mobileEditButtonPos(0.7f,0.7f),
|
mobileEditButtonPos(0.7f,0.7f),
|
||||||
mobileEditButtonSize(60.0f,60.0f),
|
mobileEditButtonSize(60.0f,60.0f),
|
||||||
curSysSection(NULL),
|
curSysSection(NULL),
|
||||||
|
updateFMPreview(true),
|
||||||
|
fmPreviewOn(false),
|
||||||
|
fmPreviewPaused(false),
|
||||||
|
fmPreviewOPN(NULL),
|
||||||
pendingRawSampleDepth(8),
|
pendingRawSampleDepth(8),
|
||||||
pendingRawSampleChannels(1),
|
pendingRawSampleChannels(1),
|
||||||
pendingRawSampleUnsigned(false),
|
pendingRawSampleUnsigned(false),
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
|
|
||||||
#define BIND_FOR(x) getKeyName(actionKeys[x],true).c_str()
|
#define BIND_FOR(x) getKeyName(actionKeys[x],true).c_str()
|
||||||
|
|
||||||
#define FM_PREVIEW_SIZE 1024
|
#define FM_PREVIEW_SIZE 512
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// - add colors for FM envelope and waveform
|
// - add colors for FM envelope and waveform
|
||||||
|
@ -1195,6 +1195,8 @@ class FurnaceGUI {
|
||||||
const int* curSysSection;
|
const int* curSysSection;
|
||||||
DivInstrumentFM opllPreview;
|
DivInstrumentFM opllPreview;
|
||||||
short fmPreview[FM_PREVIEW_SIZE];
|
short fmPreview[FM_PREVIEW_SIZE];
|
||||||
|
bool updateFMPreview, fmPreviewOn, fmPreviewPaused;
|
||||||
|
void* fmPreviewOPN;
|
||||||
|
|
||||||
String pendingRawSample;
|
String pendingRawSample;
|
||||||
int pendingRawSampleDepth, pendingRawSampleChannels;
|
int pendingRawSampleDepth, pendingRawSampleChannels;
|
||||||
|
@ -1890,6 +1892,7 @@ class FurnaceGUI {
|
||||||
void drawGBEnv(unsigned char vol, unsigned char len, unsigned char sLen, bool dir, const ImVec2& size);
|
void drawGBEnv(unsigned char vol, unsigned char len, unsigned char sLen, bool dir, const ImVec2& size);
|
||||||
bool drawSysConf(int chan, DivSystem type, DivConfig& flags, bool modifyOnChange);
|
bool drawSysConf(int chan, DivSystem type, DivConfig& flags, bool modifyOnChange);
|
||||||
void kvsConfig(DivInstrument* ins);
|
void kvsConfig(DivInstrument* ins);
|
||||||
|
void drawFMPreview(const ImVec2& size);
|
||||||
void renderFMPreview(const DivInstrumentFM& params, int pos=0);
|
void renderFMPreview(const DivInstrumentFM& params, int pos=0);
|
||||||
|
|
||||||
// these ones offer ctrl-wheel fine value changes.
|
// these ones offer ctrl-wheel fine value changes.
|
||||||
|
|
|
@ -1259,9 +1259,10 @@ void FurnaceGUI::drawGBEnv(unsigned char vol, unsigned char len, unsigned char s
|
||||||
#define P(x) if (x) { \
|
#define P(x) if (x) { \
|
||||||
MARK_MODIFIED; \
|
MARK_MODIFIED; \
|
||||||
e->notifyInsChange(curIns); \
|
e->notifyInsChange(curIns); \
|
||||||
|
updateFMPreview=true; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PARAMETER MARK_MODIFIED; e->notifyInsChange(curIns);
|
#define PARAMETER MARK_MODIFIED; e->notifyInsChange(curIns); updateFMPreview=true;
|
||||||
|
|
||||||
String genericGuide(float value) {
|
String genericGuide(float value) {
|
||||||
return fmt::sprintf("%d",(int)value);
|
return fmt::sprintf("%d",(int)value);
|
||||||
|
@ -1279,9 +1280,25 @@ inline bool enBit30(const int val) {
|
||||||
|
|
||||||
|
|
||||||
void FurnaceGUI::kvsConfig(DivInstrument* ins) {
|
void FurnaceGUI::kvsConfig(DivInstrument* ins) {
|
||||||
|
if (ins->type==DIV_INS_FM && fmPreviewOn) {
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::SetTooltip("(click to configure TL scaling)");
|
ImGui::SetTooltip("left click to restart\nmiddle click to pause\nright click to see algorithm");
|
||||||
}
|
}
|
||||||
|
if (ImGui::IsItemClicked(ImGuiMouseButton_Left)) {
|
||||||
|
updateFMPreview=true;
|
||||||
|
}
|
||||||
|
if (ImGui::IsItemClicked(ImGuiMouseButton_Middle)) {
|
||||||
|
fmPreviewPaused=!fmPreviewPaused;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (ImGui::IsItemHovered()) {
|
||||||
|
ImGui::SetTooltip("left click to configure TL scaling\nright click to see FM preview");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ImGui::IsItemClicked(ImGuiMouseButton_Right) && ins->type==DIV_INS_FM) {
|
||||||
|
fmPreviewOn=!fmPreviewOn;
|
||||||
|
}
|
||||||
|
if (!fmPreviewOn || ins->type!=DIV_INS_FM) {
|
||||||
int opCount=4;
|
int opCount=4;
|
||||||
if (ins->type==DIV_INS_OPLL) opCount=2;
|
if (ins->type==DIV_INS_OPLL) opCount=2;
|
||||||
if (ins->type==DIV_INS_OPL) opCount=(ins->fm.ops==4)?4:2;
|
if (ins->type==DIV_INS_OPL) opCount=(ins->fm.ops==4)?4:2;
|
||||||
|
@ -1316,6 +1333,15 @@ void FurnaceGUI::kvsConfig(DivInstrument* ins) {
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void FurnaceGUI::drawFMPreview(const ImVec2& size) {
|
||||||
|
float asFloat[FM_PREVIEW_SIZE];
|
||||||
|
for (int i=0; i<FM_PREVIEW_SIZE; i++) {
|
||||||
|
asFloat[i]=(float)fmPreview[i]/8192.0f;
|
||||||
|
}
|
||||||
|
ImGui::PlotLines("##DebugFMPreview",asFloat,FM_PREVIEW_SIZE,0,NULL,-1.0,1.0,size);
|
||||||
|
}
|
||||||
|
|
||||||
void FurnaceGUI::drawMacroEdit(FurnaceGUIMacroDesc& i, int totalFit, float availableWidth, int index) {
|
void FurnaceGUI::drawMacroEdit(FurnaceGUIMacroDesc& i, int totalFit, float availableWidth, int index) {
|
||||||
static float asFloat[256];
|
static float asFloat[256];
|
||||||
|
@ -2125,6 +2151,7 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
if (ImGui::Selectable(name.c_str(),curIns==(int)i)) {
|
if (ImGui::Selectable(name.c_str(),curIns==(int)i)) {
|
||||||
curIns=i;
|
curIns=i;
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndCombo();
|
ImGui::EndCombo();
|
||||||
|
@ -2148,6 +2175,10 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DivInstrument* ins=e->song.ins[curIns];
|
DivInstrument* ins=e->song.ins[curIns];
|
||||||
|
if (updateFMPreview) {
|
||||||
|
renderFMPreview(ins->fm);
|
||||||
|
updateFMPreview=false;
|
||||||
|
}
|
||||||
if (settings.insEditColorize) {
|
if (settings.insEditColorize) {
|
||||||
pushAccentColors(uiColors[GUI_COLOR_INSTR_STD+ins->type],uiColors[GUI_COLOR_INSTR_STD+ins->type],uiColors[GUI_COLOR_INSTR_STD+ins->type],ImVec4(0.0f,0.0f,0.0f,0.0f));
|
pushAccentColors(uiColors[GUI_COLOR_INSTR_STD+ins->type],uiColors[GUI_COLOR_INSTR_STD+ins->type],uiColors[GUI_COLOR_INSTR_STD+ins->type],ImVec4(0.0f,0.0f,0.0f,0.0f));
|
||||||
}
|
}
|
||||||
|
@ -2167,6 +2198,7 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
curIns=i;
|
curIns=i;
|
||||||
ins=e->song.ins[curIns];
|
ins=e->song.ins[curIns];
|
||||||
wavePreviewInit=true;
|
wavePreviewInit=true;
|
||||||
|
updateFMPreview=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::EndCombo();
|
ImGui::EndCombo();
|
||||||
|
@ -2306,7 +2338,15 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
P(CWSliderScalar(FM_NAME(FM_ALG),ImGuiDataType_U8,&ins->fm.alg,&_ZERO,&_SEVEN)); rightClickable
|
P(CWSliderScalar(FM_NAME(FM_ALG),ImGuiDataType_U8,&ins->fm.alg,&_ZERO,&_SEVEN)); rightClickable
|
||||||
P(CWSliderScalar(FM_NAME(FM_AMS),ImGuiDataType_U8,&ins->fm.ams,&_ZERO,&_THREE)); rightClickable
|
P(CWSliderScalar(FM_NAME(FM_AMS),ImGuiDataType_U8,&ins->fm.ams,&_ZERO,&_THREE)); rightClickable
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
if (ins->type==DIV_INS_FM && fmPreviewOn) {
|
||||||
|
drawFMPreview(ImVec2(ImGui::GetContentRegionAvail().x,48.0*dpiScale));
|
||||||
|
if (!fmPreviewPaused) {
|
||||||
|
renderFMPreview(ins->fm,1);
|
||||||
|
WAKE_UP;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
drawAlgorithm(ins->fm.alg,FM_ALGS_4OP,ImVec2(ImGui::GetContentRegionAvail().x,48.0*dpiScale));
|
drawAlgorithm(ins->fm.alg,FM_ALGS_4OP,ImVec2(ImGui::GetContentRegionAvail().x,48.0*dpiScale));
|
||||||
|
}
|
||||||
kvsConfig(ins);
|
kvsConfig(ins);
|
||||||
break;
|
break;
|
||||||
case DIV_INS_OPZ:
|
case DIV_INS_OPZ:
|
||||||
|
|
Loading…
Reference in a new issue