Merge branch 'master' of https://github.com/tildearrow/furnace into mod-import

This commit is contained in:
Natt Akuma 2022-03-14 21:57:54 +07:00
commit c7fb5df206
83 changed files with 7113 additions and 372 deletions

View file

@ -36,6 +36,7 @@
#include "../engine/platform/tia.h"
#include "../engine/platform/saa.h"
#include "../engine/platform/amiga.h"
#include "../engine/platform/x1_010.h"
#include "../engine/platform/dummy.h"
#define GENESIS_DEBUG \
@ -232,6 +233,47 @@ void putDispatchChan(void* data, int chanNum, int type) {
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
break;
}
case DIV_SYSTEM_X1_010: {
DivPlatformX1_010::Channel* ch=(DivPlatformX1_010::Channel*)data;
ImGui::Text("> X1-010");
ImGui::Text("* freq: %.4x",ch->freq);
ImGui::Text(" - base: %d",ch->baseFreq);
ImGui::Text(" - pitch: %d",ch->pitch);
ImGui::Text("- note: %d",ch->note);
ImGui::Text("- wave: %d",ch->wave);
ImGui::Text("- sample: %d",ch->sample);
ImGui::Text("- ins: %d",ch->ins);
ImGui::Text("- pan: %d",ch->pan);
ImGui::Text("* envelope:");
ImGui::Text(" - shape: %d",ch->env.shape);
ImGui::Text(" - period: %.2x",ch->env.period);
ImGui::Text(" - slide: %.2x",ch->env.slide);
ImGui::Text(" - slidefrac: %.2x",ch->env.slidefrac);
ImGui::Text(" - autoEnvNum: %.2x",ch->autoEnvNum);
ImGui::Text(" - autoEnvDen: %.2x",ch->autoEnvDen);
ImGui::Text("- WaveBank: %d",ch->waveBank);
ImGui::Text("- vol: %.2x",ch->vol);
ImGui::Text("- outVol: %.2x",ch->outVol);
ImGui::Text("- Lvol: %.2x",ch->lvol);
ImGui::Text("- Rvol: %.2x",ch->rvol);
ImGui::TextColored(ch->active?colorOn:colorOff,">> Active");
ImGui::TextColored(ch->insChanged?colorOn:colorOff,">> InsChanged");
ImGui::TextColored(ch->envChanged?colorOn:colorOff,">> EnvChanged");
ImGui::TextColored(ch->freqChanged?colorOn:colorOff,">> FreqChanged");
ImGui::TextColored(ch->keyOn?colorOn:colorOff,">> KeyOn");
ImGui::TextColored(ch->keyOff?colorOn:colorOff,">> KeyOff");
ImGui::TextColored(ch->inPorta?colorOn:colorOff,">> InPorta");
ImGui::TextColored(ch->furnacePCM?colorOn:colorOff,">> FurnacePCM");
ImGui::TextColored(ch->pcm?colorOn:colorOff,">> PCM");
ImGui::TextColored(ch->env.flag.envEnable?colorOn:colorOff,">> EnvEnable");
ImGui::TextColored(ch->env.flag.envOneshot?colorOn:colorOff,">> EnvOneshot");
ImGui::TextColored(ch->env.flag.envSplit?colorOn:colorOff,">> EnvSplit");
ImGui::TextColored(ch->env.flag.envHinvR?colorOn:colorOff,">> EnvHinvR");
ImGui::TextColored(ch->env.flag.envVinvR?colorOn:colorOff,">> EnvVinvR");
ImGui::TextColored(ch->env.flag.envHinvL?colorOn:colorOff,">> EnvHinvL");
ImGui::TextColored(ch->env.flag.envVinvL?colorOn:colorOff,">> EnvVinvL");
break;
}
default:
ImGui::Text("Unknown system! Help!");
break;

106
src/gui/fileDialog.cpp Normal file
View file

@ -0,0 +1,106 @@
#include "fileDialog.h"
#include "ImGuiFileDialog.h"
#include "../ta-log.h"
#include "../../extern/pfd-fixed/portable-file-dialogs.h"
bool FurnaceGUIFileDialog::openLoad(String header, std::vector<String> filter, const char* noSysFilter, String path, double dpiScale) {
if (opened) return false;
saving=false;
curPath=path;
if (sysDialog) {
dialogO=new pfd::open_file(header,path,filter);
} else {
ImGuiFileDialog::Instance()->DpiScale=dpiScale;
ImGuiFileDialog::Instance()->OpenModal("FileDialog",header,noSysFilter,path);
}
opened=true;
return true;
}
bool FurnaceGUIFileDialog::openSave(String header, std::vector<String> filter, const char* noSysFilter, String path, double dpiScale) {
if (opened) return false;
saving=true;
curPath=path;
if (sysDialog) {
dialogS=new pfd::save_file(header,path,filter);
} else {
ImGuiFileDialog::Instance()->DpiScale=dpiScale;
ImGuiFileDialog::Instance()->OpenModal("FileDialog",header,noSysFilter,path,1,nullptr,ImGuiFileDialogFlags_ConfirmOverwrite);
}
opened=true;
return true;
}
bool FurnaceGUIFileDialog::accepted() {
if (sysDialog) {
return (fileName!="");
} else {
return ImGuiFileDialog::Instance()->IsOk();
}
}
void FurnaceGUIFileDialog::close() {
if (sysDialog) {
if (saving) {
if (dialogS!=NULL) {
delete dialogS;
dialogS=NULL;
}
} else {
if (dialogO!=NULL) {
delete dialogO;
dialogO=NULL;
}
}
} else {
ImGuiFileDialog::Instance()->Close();
}
opened=false;
}
bool FurnaceGUIFileDialog::render(const ImVec2& min, const ImVec2& max) {
if (sysDialog) {
if (saving) {
if (dialogS!=NULL) {
if (dialogS->ready(1)) {
fileName=dialogS->result();
logD("returning %s\n",fileName.c_str());
return true;
}
}
} else {
if (dialogO!=NULL) {
if (dialogO->ready(1)) {
if (dialogO->result().empty()) {
fileName="";
logD("returning nothing\n");
} else {
fileName=dialogO->result()[0];
logD("returning %s\n",fileName.c_str());
}
return true;
}
}
}
return false;
} else {
return ImGuiFileDialog::Instance()->Display("FileDialog",ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_NoMove,min,max);
}
}
String FurnaceGUIFileDialog::getPath() {
if (sysDialog) {
return curPath;
} else {
return ImGuiFileDialog::Instance()->GetCurrentPath();
}
}
String FurnaceGUIFileDialog::getFileName() {
if (sysDialog) {
return fileName;
} else {
return ImGuiFileDialog::Instance()->GetFilePathName();
}
}

32
src/gui/fileDialog.h Normal file
View file

@ -0,0 +1,32 @@
#include "../ta-utils.h"
#include "imgui.h"
#include <vector>
namespace pfd {
class open_file;
class save_file;
}
class FurnaceGUIFileDialog {
bool sysDialog;
bool opened;
bool saving;
String curPath;
String fileName;
pfd::open_file* dialogO;
pfd::save_file* dialogS;
public:
bool openLoad(String header, std::vector<String> filter, const char* noSysFilter, String path, double dpiScale);
bool openSave(String header, std::vector<String> filter, const char* noSysFilter, String path, double dpiScale);
bool accepted();
void close();
bool render(const ImVec2& min, const ImVec2& max);
String getPath();
String getFileName();
FurnaceGUIFileDialog(bool system):
sysDialog(system),
opened(false),
saving(false),
dialogO(NULL),
dialogS(NULL) {}
};

File diff suppressed because it is too large Load diff

View file

@ -27,6 +27,8 @@
#include <map>
#include <vector>
#include "fileDialog.h"
#define rightClickable if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) ImGui::SetKeyboardFocusHere(-1);
#define handleUnimportant if (settings.insFocusesPattern && patternOpen) {nextWindow=GUI_WINDOW_PATTERN;}
@ -73,6 +75,8 @@ enum FurnaceGUIColors {
GUI_COLOR_INSTR_BEEPER,
GUI_COLOR_INSTR_SWAN,
GUI_COLOR_INSTR_MIKEY,
GUI_COLOR_INSTR_VERA,
GUI_COLOR_INSTR_X1_010,
GUI_COLOR_INSTR_UNKNOWN,
GUI_COLOR_CHANNEL_FM,
GUI_COLOR_CHANNEL_PULSE,
@ -233,6 +237,10 @@ enum FurnaceGUIActions {
GUI_ACTION_PAT_CUT,
GUI_ACTION_PAT_COPY,
GUI_ACTION_PAT_PASTE,
GUI_ACTION_PAT_PASTE_MIX,
GUI_ACTION_PAT_PASTE_MIX_BG,
GUI_ACTION_PAT_PASTE_FLOOD,
GUI_ACTION_PAT_PASTE_OVERFLOW,
GUI_ACTION_PAT_CURSOR_UP,
GUI_ACTION_PAT_CURSOR_DOWN,
GUI_ACTION_PAT_CURSOR_LEFT,
@ -268,6 +276,17 @@ enum FurnaceGUIActions {
GUI_ACTION_PAT_COLLAPSE,
GUI_ACTION_PAT_INCREASE_COLUMNS,
GUI_ACTION_PAT_DECREASE_COLUMNS,
GUI_ACTION_PAT_INTERPOLATE,
GUI_ACTION_PAT_FADE,
GUI_ACTION_PAT_INVERT_VALUES,
GUI_ACTION_PAT_FLIP_SELECTION,
GUI_ACTION_PAT_COLLAPSE_ROWS,
GUI_ACTION_PAT_EXPAND_ROWS,
GUI_ACTION_PAT_COLLAPSE_PAT,
GUI_ACTION_PAT_EXPAND_PAT,
GUI_ACTION_PAT_COLLAPSE_SONG,
GUI_ACTION_PAT_EXPAND_SONG,
GUI_ACTION_PAT_LATCH,
GUI_ACTION_PAT_MAX,
GUI_ACTION_INS_LIST_MIN,
@ -334,6 +353,14 @@ enum FurnaceGUIActions {
GUI_ACTION_MAX
};
enum PasteMode {
GUI_PASTE_MODE_NORMAL=0,
GUI_PASTE_MODE_MIX_FG,
GUI_PASTE_MODE_MIX_BG,
GUI_PASTE_MODE_FLOOD,
GUI_PASTE_MODE_OVERFLOW
};
#define FURKMOD_CTRL (1<<31)
#define FURKMOD_SHIFT (1<<29)
#define FURKMOD_META (1<<28)
@ -354,7 +381,16 @@ enum ActionType {
GUI_UNDO_PATTERN_PULL,
GUI_UNDO_PATTERN_PUSH,
GUI_UNDO_PATTERN_CUT,
GUI_UNDO_PATTERN_PASTE
GUI_UNDO_PATTERN_PASTE,
GUI_UNDO_PATTERN_CHANGE_INS,
GUI_UNDO_PATTERN_INTERPOLATE,
GUI_UNDO_PATTERN_FADE,
GUI_UNDO_PATTERN_SCALE,
GUI_UNDO_PATTERN_RANDOMIZE,
GUI_UNDO_PATTERN_INVERT_VAL,
GUI_UNDO_PATTERN_FLIP,
GUI_UNDO_PATTERN_COLLAPSE,
GUI_UNDO_PATTERN_EXPAND
};
struct UndoPatternData {
@ -442,6 +478,8 @@ class FurnaceGUI {
FurnaceGUIFileDialogs curFileDialog;
FurnaceGUIWarnings warnAction;
FurnaceGUIFileDialog* fileDialog;
int scrW, scrH;
double dpiScale;
@ -499,6 +537,11 @@ class FurnaceGUI {
int guiColorsBase;
int avoidRaisingPattern;
int insFocusesPattern;
int stepOnInsert;
// TODO flags
int unifiedDataView;
int sysFileDialog;
// end
unsigned int maxUndoSteps;
String mainFontPath;
String patFontPath;
@ -512,7 +555,7 @@ class FurnaceGUI {
audioQuality(0),
arcadeCore(0),
ym2612Core(0),
saaCore(0),
saaCore(1),
mainFont(0),
patFont(0),
audioRate(44100),
@ -542,6 +585,9 @@ class FurnaceGUI {
guiColorsBase(0),
avoidRaisingPattern(0),
insFocusesPattern(1),
stepOnInsert(0),
unifiedDataView(0),
sysFileDialog(1),
maxUndoSteps(100),
mainFontPath(""),
patFontPath(""),
@ -558,13 +604,16 @@ class FurnaceGUI {
bool pianoOpen, notesOpen, channelsOpen, regViewOpen;
SelectionPoint selStart, selEnd, cursor;
bool selecting, curNibble, orderNibble, followOrders, followPattern, changeAllOrders;
bool collapseWindow, demandScrollX, fancyPattern, wantPatName;
bool collapseWindow, demandScrollX, fancyPattern, wantPatName, firstFrame;
FurnaceGUIWindows curWindow, nextWindow;
float peak[2];
float patChanX[DIV_MAX_CHANS+1];
float patChanSlideY[DIV_MAX_CHANS+1];
const int* nextDesc;
bool opMaskNote, opMaskIns, opMaskVol, opMaskEffect, opMaskEffectVal;
short latchNote, latchIns, latchVol, latchEffect, latchEffectVal;
// bit 31: ctrl
// bit 30: reserved for SDL scancode mask
// bit 29: shift
@ -624,6 +673,7 @@ class FurnaceGUI {
bool macroDragInitialValueSet;
bool macroDragInitialValue;
bool macroDragChar;
bool macroDragLineMode; // TODO
bool macroDragActive;
ImVec2 macroLoopDragStart;
@ -650,6 +700,9 @@ class FurnaceGUI {
ImVec2 threeChars, twoChars;
SelectionPoint sel1, sel2;
int dummyRows, demandX;
int transposeAmount, randomizeMin, randomizeMax, fadeMin, fadeMax;
float scaleMax;
bool fadeMode, randomMode;
int oldOrdersLen;
DivOrders oldOrders;
@ -668,6 +721,9 @@ class FurnaceGUI {
void patternRow(int i, bool isPlaying, float lineHeight, int chans, int ord);
void actualWaveList();
void actualSampleList();
void drawEditControls();
void drawSongInfo();
void drawOrders();
@ -718,9 +774,19 @@ class FurnaceGUI {
void doInsert();
void doTranspose(int amount);
void doCopy(bool cut);
void doPaste();
void doPaste(PasteMode mode=GUI_PASTE_MODE_NORMAL);
void doChangeIns(int ins);
void doInterpolate();
void doFade(int p0, int p1, bool mode);
void doInvertValues();
void doScale(float top);
void doRandomize(int bottom, int top, bool mode);
void doFlip();
void doCollapse(int divider);
void doExpand(int multiplier);
void doUndo();
void doRedo();
void editOptions(bool topMenu);
void play(int row=0);
void stop();

View file

@ -19,6 +19,7 @@
// guiConst: constants used in the GUI like arrays, strings and other stuff
#include "guiConst.h"
#include "../engine/instrument.h"
const int opOrder[4]={
0, 2, 1, 3
@ -64,3 +65,31 @@ const char* pitchLabel[11]={
"1/6", "1/5", "1/4", "1/3", "1/2", "1x", "2x", "3x", "4x", "5x", "6x"
};
const char* insTypes[DIV_INS_MAX]={
"Standard",
"FM (4-operator)",
"Game Boy",
"C64",
"Amiga/Sample",
"PC Engine",
"AY-3-8910/SSG",
"AY8930",
"TIA",
"SAA1099",
"VIC",
"PET",
"VRC6",
"FM (OPLL)",
"FM (OPL)",
"FDS",
"Virtual Boy",
"Namco 163",
"Konami SCC",
"FM (OPZ)",
"POKEY",
"PC Beeper",
"WonderSwan",
"Atari Lynx",
"VERA",
"X1-010"
};

View file

@ -23,3 +23,4 @@ extern const int opOrder[4];
extern const char* noteNames[180];
extern const char* noteNamesG[180];
extern const char* pitchLabel[11];
extern const char* insTypes[];

View file

@ -27,33 +27,6 @@
#include <imgui.h>
#include "plot_nolerp.h"
const char* insTypes[24]={
"Standard",
"FM (4-operator)",
"Game Boy",
"C64",
"Amiga/Sample",
"PC Engine",
"AY-3-8910/SSG",
"AY8930",
"TIA",
"SAA1099",
"VIC",
"PET",
"VRC6",
"FM (OPLL)",
"FM (OPL)",
"FDS",
"Virtual Boy",
"Namco 163",
"Konami SCC",
"FM (OPZ)",
"POKEY",
"PC Beeper",
"WonderSwan",
"Atari Lynx"
};
const char* ssgEnvTypes[8]={
"Down Down Down", "Down.", "Down Up Down Up", "Down UP", "Up Up Up", "Up.", "Up Down Up Down", "Up DOWN"
};
@ -156,6 +129,10 @@ const char* mikeyFeedbackBits[11] = {
"0", "1", "2", "3", "4", "5", "7", "10", "11", "int", NULL
};
const char* x1_010EnvBits[8]={
"enable", "oneshot", "split L/R", "HinvR", "VinvR", "HinvL", "VinvL", NULL
};
const char* oneBit[2]={
"on", NULL
};
@ -791,9 +768,9 @@ void FurnaceGUI::drawInsEdit() {
} else {
DivInstrument* ins=e->song.ins[curIns];
ImGui::InputText("Name",&ins->name);
if (ins->type<0 || ins->type>23) ins->type=DIV_INS_FM;
if (ins->type<0 || ins->type>=DIV_INS_MAX) ins->type=DIV_INS_FM;
int insType=ins->type;
if (ImGui::Combo("Type",&insType,insTypes,24,24)) {
if (ImGui::Combo("Type",&insType,insTypes,DIV_INS_MAX,DIV_INS_MAX)) {
ins->type=(DivInstrumentType)insType;
}
@ -1355,7 +1332,7 @@ void FurnaceGUI::drawInsEdit() {
float loopIndicator[256];
const char* volumeLabel="Volume";
int volMax=(ins->type==DIV_INS_PCE || ins->type==DIV_INS_AY8930)?31:15;
int volMax=15;
int volMin=0;
if (ins->type==DIV_INS_C64) {
if (ins->c64.volIsCutoff) {
@ -1368,6 +1345,12 @@ void FurnaceGUI::drawInsEdit() {
}
}
}
if ((ins->type==DIV_INS_PCE || ins->type==DIV_INS_AY8930)) {
volMax=31;
}
if (ins->type==DIV_INS_VERA) {
volMax=63;
}
if (ins->type==DIV_INS_AMIGA) {
volMax=64;
}
@ -1381,7 +1364,7 @@ void FurnaceGUI::drawInsEdit() {
bool arpMode=ins->std.arpMacroMode;
const char* dutyLabel="Duty/Noise";
int dutyMax=(ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930)?31:3;
int dutyMax=3;
if (ins->type==DIV_INS_C64) {
dutyLabel="Duty";
if (ins->c64.dutyIsAbs) {
@ -1393,6 +1376,9 @@ void FurnaceGUI::drawInsEdit() {
if (ins->type==DIV_INS_FM) {
dutyMax=32;
}
if ((ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930)) {
dutyMax=31;
}
if (ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_FM) {
dutyLabel="Noise Freq";
}
@ -1416,9 +1402,13 @@ void FurnaceGUI::drawInsEdit() {
if (ins->type==DIV_INS_OPLL || ins->type==DIV_INS_OPL) {
dutyMax=0;
}
if (ins->type==DIV_INS_VERA) {
dutyLabel="Duty";
dutyMax=63;
}
bool dutyIsRel=(ins->type==DIV_INS_C64 && !ins->c64.dutyIsAbs);
int waveMax=(ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930)?3:63;
int waveMax=(ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_VERA)?3:63;
bool bitMode=false;
if (ins->type==DIV_INS_C64 || ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_SAA1099) {
bitMode=true;
@ -1435,11 +1425,18 @@ void FurnaceGUI::drawInsEdit() {
int ex1Max=(ins->type==DIV_INS_AY8930)?8:0;
int ex2Max=(ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930)?4:0;
bool ex2Bit=true;
if (ins->type==DIV_INS_C64) {
ex1Max=4;
ex2Max=15;
}
if (ins->type==DIV_INS_X1_010) {
dutyMax=0;
ex1Max=7;
ex2Max=63;
ex2Bit=false;
}
if (ins->type==DIV_INS_SAA1099) ex1Max=8;
if (settings.macroView==0) { // modern view
@ -1464,6 +1461,8 @@ void FurnaceGUI::drawInsEdit() {
NORMAL_MACRO(ins->std.ex1Macro,ins->std.ex1MacroLen,ins->std.ex1MacroLoop,ins->std.ex1MacroRel,0,ex1Max,"ex1","Filter Mode",64,ins->std.ex1MacroOpen,true,filtModeBits,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[4],0,ex1Max,NULL,false);
} else if (ins->type==DIV_INS_SAA1099) {
NORMAL_MACRO(ins->std.ex1Macro,ins->std.ex1MacroLen,ins->std.ex1MacroLoop,ins->std.ex1MacroRel,0,ex1Max,"ex1","Envelope",160,ins->std.ex1MacroOpen,true,saaEnvBits,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[4],0,ex1Max,NULL,false);
} else if (ins->type==DIV_INS_X1_010) {
NORMAL_MACRO(ins->std.ex1Macro,ins->std.ex1MacroLen,ins->std.ex1MacroLoop,ins->std.ex1MacroRel,0,ex1Max,"ex1","Envelope Mode",160,ins->std.ex1MacroOpen,true,x1_010EnvBits,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[4],0,ex1Max,NULL,false);
} else {
NORMAL_MACRO(ins->std.ex1Macro,ins->std.ex1MacroLen,ins->std.ex1MacroLoop,ins->std.ex1MacroRel,0,ex1Max,"ex1","Duty",160,ins->std.ex1MacroOpen,false,NULL,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[4],0,ex1Max,NULL,false);
}
@ -1472,13 +1471,13 @@ void FurnaceGUI::drawInsEdit() {
if (ins->type==DIV_INS_C64) {
NORMAL_MACRO(ins->std.ex2Macro,ins->std.ex2MacroLen,ins->std.ex2MacroLoop,ins->std.ex2MacroRel,0,ex2Max,"ex2","Resonance",64,ins->std.ex2MacroOpen,false,NULL,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[5],0,ex2Max,NULL,false);
} else {
NORMAL_MACRO(ins->std.ex2Macro,ins->std.ex2MacroLen,ins->std.ex2MacroLoop,ins->std.ex2MacroRel,0,ex2Max,"ex2","Envelope",64,ins->std.ex2MacroOpen,true,ayEnvBits,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[5],0,ex2Max,NULL,false);
NORMAL_MACRO(ins->std.ex2Macro,ins->std.ex2MacroLen,ins->std.ex2MacroLoop,ins->std.ex2MacroRel,0,ex2Max,"ex2","Envelope",ex2Bit?64:160,ins->std.ex2MacroOpen,ex2Bit,ayEnvBits,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[5],0,ex2Max,NULL,false);
}
}
if (ins->type==DIV_INS_C64) {
NORMAL_MACRO(ins->std.ex3Macro,ins->std.ex3MacroLen,ins->std.ex3MacroLoop,ins->std.ex3MacroRel,0,2,"ex3","Special",32,ins->std.ex3MacroOpen,true,c64SpecialBits,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[6],0,2,NULL,false);
}
if (ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930) {
if (ins->type==DIV_INS_AY || ins->type==DIV_INS_AY8930 || ins->type==DIV_INS_X1_010) {
NORMAL_MACRO(ins->std.ex3Macro,ins->std.ex3MacroLen,ins->std.ex3MacroLoop,ins->std.ex3MacroRel,0,15,"ex3","AutoEnv Num",96,ins->std.ex3MacroOpen,false,NULL,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[6],0,15,NULL,false);
NORMAL_MACRO(ins->std.algMacro,ins->std.algMacroLen,ins->std.algMacroLoop,ins->std.algMacroRel,0,15,"alg","AutoEnv Den",96,ins->std.algMacroOpen,false,NULL,false,NULL,0,0,0,NULL,uiColors[GUI_COLOR_MACRO_OTHER],mmlString[7],0,15,NULL,false);
}
@ -1759,7 +1758,6 @@ void FurnaceGUI::drawWaveList() {
nextWindow=GUI_WINDOW_NOTHING;
}
if (!waveListOpen) return;
float wavePreview[256];
if (ImGui::Begin("Wavetables",&waveListOpen)) {
if (ImGui::Button(ICON_FA_PLUS "##WaveAdd")) {
doAction(GUI_ACTION_WAVE_LIST_ADD);
@ -1790,25 +1788,7 @@ void FurnaceGUI::drawWaveList() {
}
ImGui::Separator();
if (ImGui::BeginTable("WaveListScroll",1,ImGuiTableFlags_ScrollY)) {
for (int i=0; i<(int)e->song.wave.size(); i++) {
DivWavetable* wave=e->song.wave[i];
for (int i=0; i<wave->len; i++) {
wavePreview[i]=wave->data[i];
}
if (wave->len>0) wavePreview[wave->len]=wave->data[wave->len-1];
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (ImGui::Selectable(fmt::sprintf("%d##_WAVE%d\n",i,i).c_str(),curWave==i)) {
curWave=i;
}
if (ImGui::IsItemHovered()) {
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
waveEditOpen=true;
}
}
ImGui::SameLine();
PlotNoLerp(fmt::sprintf("##_WAVEP%d",i).c_str(),wavePreview,wave->len+1,0,NULL,0,wave->max);
}
actualWaveList();
ImGui::EndTable();
}
}
@ -1857,6 +1837,7 @@ void FurnaceGUI::drawWaveEdit() {
modified=true;
}
for (int i=0; i<wave->len; i++) {
if (wave->data[i]>wave->max) wave->data[i]=wave->max;
wavePreview[i]=wave->data[i];
}
if (wave->len>0) wavePreview[wave->len]=wave->data[wave->len-1];

View file

@ -830,22 +830,8 @@ void FurnaceGUI::drawPattern() {
ImGui::PopStyleVar();
if (patternOpen) {
if (!inhibitMenu && ImGui::IsItemClicked(ImGuiMouseButton_Right)) ImGui::OpenPopup("patternActionMenu");
if (ImGui::BeginPopup("patternActionMenu",ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings)) {
char id[4096];
ImGui::Selectable("cut");
ImGui::Selectable("copy");
ImGui::Selectable("paste");
if (ImGui::BeginMenu("change instrument...")) {
if (e->song.ins.empty()) {
ImGui::Text("no instruments available");
}
for (size_t i=0; i<e->song.ins.size(); i++) {
snprintf(id,4095,"%.2X: %s",(int)i,e->song.ins[i]->name.c_str());
if (ImGui::Selectable(id)) { // TODO
}
}
ImGui::EndMenu();
}
if (ImGui::BeginPopup("patternActionMenu",ImGuiWindowFlags_NoMove|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings)) {
editOptions(false);
ImGui::EndPopup();
}
}

View file

@ -157,6 +157,11 @@ void FurnaceGUI::drawSettings() {
settings.stepOnDelete=stepOnDeleteB;
}
bool stepOnInsertB=settings.stepOnInsert;
if (ImGui::Checkbox("Move cursor by edit step on insert (push)",&stepOnInsertB)) {
settings.stepOnInsert=stepOnInsertB;
}
bool allowEditDockingB=settings.allowEditDocking;
if (ImGui::Checkbox("Allow docking editors",&allowEditDockingB)) {
settings.allowEditDocking=allowEditDockingB;
@ -177,6 +182,11 @@ void FurnaceGUI::drawSettings() {
settings.restartOnFlagChange=restartOnFlagChangeB;
}
bool sysFileDialogB=settings.sysFileDialog;
if (ImGui::Checkbox("Use system file picker",&sysFileDialogB)) {
settings.sysFileDialog=sysFileDialogB;
}
ImGui::Text("Wrap pattern cursor horizontally:");
if (ImGui::RadioButton("No##wrapH0",settings.wrapHorizontal==0)) {
settings.wrapHorizontal=0;
@ -206,6 +216,7 @@ void FurnaceGUI::drawSettings() {
if (ImGui::RadioButton("Move by Edit Step##cmk1",settings.scrollStep==1)) {
settings.scrollStep=1;
}
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Audio")) {
@ -397,6 +408,11 @@ void FurnaceGUI::drawSettings() {
settings.macroView=macroViewB;
}
bool unifiedDataViewB=settings.unifiedDataView;
if (ImGui::Checkbox("Unified instrument/wavetable/sample list",&unifiedDataViewB)) {
settings.unifiedDataView=unifiedDataViewB;
}
bool chipNamesB=settings.chipNames;
if (ImGui::Checkbox("Use chip names instead of system names",&chipNamesB)) {
settings.chipNames=chipNamesB;
@ -492,6 +508,8 @@ void FurnaceGUI::drawSettings() {
UI_COLOR_CONFIG(GUI_COLOR_INSTR_BEEPER,"PC Beeper");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_SWAN,"WonderSwan");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_MIKEY,"Lynx");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_VERA,"VERA");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_X1_010,"X1-010");
UI_COLOR_CONFIG(GUI_COLOR_INSTR_UNKNOWN,"Other/Unknown");
ImGui::TreePop();
}
@ -853,7 +871,7 @@ void FurnaceGUI::syncSettings() {
settings.audioRate=e->getConfInt("audioRate",44100);
settings.arcadeCore=e->getConfInt("arcadeCore",0);
settings.ym2612Core=e->getConfInt("ym2612Core",0);
settings.saaCore=e->getConfInt("saaCore",0);
settings.saaCore=e->getConfInt("saaCore",1);
settings.mainFont=e->getConfInt("mainFont",0);
settings.patFont=e->getConfInt("patFont",0);
settings.mainFontPath=e->getConfString("mainFontPath","");
@ -883,6 +901,9 @@ void FurnaceGUI::syncSettings() {
settings.guiColorsBase=e->getConfInt("guiColorsBase",0);
settings.avoidRaisingPattern=e->getConfInt("avoidRaisingPattern",0);
settings.insFocusesPattern=e->getConfInt("insFocusesPattern",1);
settings.stepOnInsert=e->getConfInt("stepOnInsert",0);
settings.unifiedDataView=e->getConfInt("unifiedDataView",0);
settings.sysFileDialog=e->getConfInt("sysFileDialog",1);
clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.patFontSize,2,96);
@ -920,6 +941,9 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.guiColorsBase,0,1);
clampSetting(settings.avoidRaisingPattern,0,1);
clampSetting(settings.insFocusesPattern,0,1);
clampSetting(settings.stepOnInsert,0,1);
clampSetting(settings.unifiedDataView,0,1);
clampSetting(settings.sysFileDialog,0,1);
// keybinds
LOAD_KEYBIND(GUI_ACTION_OPEN,FURKMOD_CMD|SDLK_o);
@ -1118,6 +1142,9 @@ void FurnaceGUI::commitSettings() {
e->setConf("guiColorsBase",settings.guiColorsBase);
e->setConf("avoidRaisingPattern",settings.avoidRaisingPattern);
e->setConf("insFocusesPattern",settings.insFocusesPattern);
e->setConf("stepOnInsert",settings.stepOnInsert);
e->setConf("unifiedDataView",settings.unifiedDataView);
e->setConf("sysFileDialog",settings.sysFileDialog);
PUT_UI_COLOR(GUI_COLOR_BACKGROUND);
PUT_UI_COLOR(GUI_COLOR_FRAME_BACKGROUND);
@ -1159,6 +1186,8 @@ void FurnaceGUI::commitSettings() {
PUT_UI_COLOR(GUI_COLOR_INSTR_BEEPER);
PUT_UI_COLOR(GUI_COLOR_INSTR_SWAN);
PUT_UI_COLOR(GUI_COLOR_INSTR_MIKEY);
PUT_UI_COLOR(GUI_COLOR_INSTR_VERA);
PUT_UI_COLOR(GUI_COLOR_INSTR_X1_010);
PUT_UI_COLOR(GUI_COLOR_INSTR_UNKNOWN);
PUT_UI_COLOR(GUI_COLOR_CHANNEL_FM);
PUT_UI_COLOR(GUI_COLOR_CHANNEL_PULSE);