Merge branch 'master' of https://github.com/BlastBrothers/furnace
This commit is contained in:
commit
8c7dd59e53
|
@ -14,7 +14,7 @@ set(CMAKE_CXX_STANDARD 14)
|
||||||
|
|
||||||
set(CMAKE_PROJECT_VERSION_MAJOR 0)
|
set(CMAKE_PROJECT_VERSION_MAJOR 0)
|
||||||
set(CMAKE_PROJECT_VERSION_MINOR 5)
|
set(CMAKE_PROJECT_VERSION_MINOR 5)
|
||||||
set(CMAKE_PROJECT_VERSION_PATCH 6)
|
set(CMAKE_PROJECT_VERSION_PATCH 7)
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(BUILD_GUI_DEFAULT OFF)
|
set(BUILD_GUI_DEFAULT OFF)
|
||||||
|
|
|
@ -150,6 +150,8 @@ size | description
|
||||||
| - 0xa5: OPL3 4-op (YMF262) - 12 channels
|
| - 0xa5: OPL3 4-op (YMF262) - 12 channels
|
||||||
| - 0xa6: OPL3 4-op + drums (YMF262) - 14 channels
|
| - 0xa6: OPL3 4-op + drums (YMF262) - 14 channels
|
||||||
| - 0xa7: OPLL drums (YM2413) - 11 channels
|
| - 0xa7: OPLL drums (YM2413) - 11 channels
|
||||||
|
| - 0xa8: Atari Lynx - 4 channels
|
||||||
|
| - 0xe0: QSound - 16 channels
|
||||||
32 | sound chip volumes
|
32 | sound chip volumes
|
||||||
| - signed char, 64=1.0, 127=~2.0
|
| - signed char, 64=1.0, 127=~2.0
|
||||||
32 | sound chip panning
|
32 | sound chip panning
|
||||||
|
|
|
@ -15,17 +15,17 @@
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleLongVersionString</key>
|
<key>CFBundleLongVersionString</key>
|
||||||
<string>0.5.6</string>
|
<string>0.5.7</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>Furnace</string>
|
<string>Furnace</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.5.6</string>
|
<string>0.5.7</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>0.5.6</string>
|
<string>0.5.7</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string></string>
|
<string></string>
|
||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
|
|
|
@ -743,6 +743,7 @@ void DivEngine::getCommandStream(std::vector<DivCommand>& where) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::playSub(bool preserveDrift, int goalRow) {
|
void DivEngine::playSub(bool preserveDrift, int goalRow) {
|
||||||
|
for (int i=0; i<song.systemLen; i++) disCont[i].dispatch->setSkipRegisterWrites(false);
|
||||||
reset();
|
reset();
|
||||||
if (preserveDrift && curOrder==0) return;
|
if (preserveDrift && curOrder==0) return;
|
||||||
bool oldRepeatPattern=repeatPattern;
|
bool oldRepeatPattern=repeatPattern;
|
||||||
|
@ -767,11 +768,11 @@ void DivEngine::playSub(bool preserveDrift, int goalRow) {
|
||||||
playing=true;
|
playing=true;
|
||||||
for (int i=0; i<song.systemLen; i++) disCont[i].dispatch->setSkipRegisterWrites(true);
|
for (int i=0; i<song.systemLen; i++) disCont[i].dispatch->setSkipRegisterWrites(true);
|
||||||
while (playing && curOrder<goal) {
|
while (playing && curOrder<goal) {
|
||||||
if (nextTick(preserveDrift)) break;
|
if (nextTick(preserveDrift)) return;
|
||||||
}
|
}
|
||||||
int oldOrder=curOrder;
|
int oldOrder=curOrder;
|
||||||
while (playing && curRow<goalRow) {
|
while (playing && curRow<goalRow) {
|
||||||
if (nextTick(preserveDrift)) break;
|
if (nextTick(preserveDrift)) return;
|
||||||
if (oldOrder!=curOrder) break;
|
if (oldOrder!=curOrder) break;
|
||||||
}
|
}
|
||||||
for (int i=0; i<song.systemLen; i++) disCont[i].dispatch->setSkipRegisterWrites(false);
|
for (int i=0; i<song.systemLen; i++) disCont[i].dispatch->setSkipRegisterWrites(false);
|
||||||
|
@ -804,8 +805,8 @@ int DivEngine::calcBaseFreq(double clock, double divider, int note, bool period)
|
||||||
int DivEngine::calcFreq(int base, int pitch, bool period, int octave) {
|
int DivEngine::calcFreq(int base, int pitch, bool period, int octave) {
|
||||||
if (song.linearPitch) {
|
if (song.linearPitch) {
|
||||||
return period?
|
return period?
|
||||||
round(base*pow(2,-(double)pitch/(12.0*128.0))/(98.0+globalPitch*6.0)*98.0):
|
base*pow(2,-(double)pitch/(12.0*128.0))/(98.0+globalPitch*6.0)*98.0:
|
||||||
(round(base*pow(2,(double)pitch/(12.0*128.0))*(98+globalPitch*6))/98);
|
(base*pow(2,(double)pitch/(12.0*128.0))*(98+globalPitch*6))/98;
|
||||||
}
|
}
|
||||||
return period?
|
return period?
|
||||||
base-pitch:
|
base-pitch:
|
||||||
|
@ -1195,8 +1196,24 @@ int DivEngine::addInstrument(int refChan) {
|
||||||
return insCount;
|
return insCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum DivInsFormats {
|
||||||
|
DIV_INSFORMAT_DMP,
|
||||||
|
DIV_INSFORMAT_TFI,
|
||||||
|
DIV_INSFORMAT_VGI,
|
||||||
|
DIV_INSFORMAT_FTI,
|
||||||
|
DIV_INSFORMAT_BTI
|
||||||
|
};
|
||||||
|
|
||||||
bool DivEngine::addInstrumentFromFile(const char *path) {
|
bool DivEngine::addInstrumentFromFile(const char *path) {
|
||||||
warnings="";
|
warnings="";
|
||||||
|
|
||||||
|
const char* pathRedux=strrchr(path,DIR_SEPARATOR);
|
||||||
|
if (pathRedux==NULL) {
|
||||||
|
pathRedux="Instrument";
|
||||||
|
} else {
|
||||||
|
pathRedux++;
|
||||||
|
}
|
||||||
|
|
||||||
FILE* f=ps_fopen(path,"rb");
|
FILE* f=ps_fopen(path,"rb");
|
||||||
if (f==NULL) {
|
if (f==NULL) {
|
||||||
lastError=strerror(errno);
|
lastError=strerror(errno);
|
||||||
|
@ -1273,7 +1290,32 @@ bool DivEngine::addInstrumentFromFile(const char *path) {
|
||||||
delete[] buf;
|
delete[] buf;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else { // read as .dmp
|
} else { // read as a different format
|
||||||
|
const char* ext=strrchr(path,'.');
|
||||||
|
DivInsFormats format=DIV_INSFORMAT_DMP;
|
||||||
|
if (ext!=NULL) {
|
||||||
|
String extS;
|
||||||
|
for (; *ext; ext++) {
|
||||||
|
char i=*ext;
|
||||||
|
if (i>='A' && i<='Z') {
|
||||||
|
i+='a'-'A';
|
||||||
|
}
|
||||||
|
extS+=i;
|
||||||
|
}
|
||||||
|
if (extS==String(".dmp")) {
|
||||||
|
format=DIV_INSFORMAT_DMP;
|
||||||
|
} else if (extS==String(".tfi")) {
|
||||||
|
format=DIV_INSFORMAT_TFI;
|
||||||
|
} else if (extS==String(".vgi")) {
|
||||||
|
format=DIV_INSFORMAT_VGI;
|
||||||
|
} else if (extS==String(".fti")) {
|
||||||
|
format=DIV_INSFORMAT_FTI;
|
||||||
|
} else if (extS==String(".bti")) {
|
||||||
|
format=DIV_INSFORMAT_BTI;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch (format) {
|
||||||
|
case DIV_INSFORMAT_DMP: {
|
||||||
// this is a ridiculous mess
|
// this is a ridiculous mess
|
||||||
unsigned char version=0;
|
unsigned char version=0;
|
||||||
unsigned char sys=0;
|
unsigned char sys=0;
|
||||||
|
@ -1295,6 +1337,8 @@ bool DivEngine::addInstrumentFromFile(const char *path) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ins->name=pathRedux;
|
||||||
|
|
||||||
if (version>=11) { // 1.0
|
if (version>=11) { // 1.0
|
||||||
try {
|
try {
|
||||||
sys=reader.readC();
|
sys=reader.readC();
|
||||||
|
@ -1519,6 +1563,84 @@ bool DivEngine::addInstrumentFromFile(const char *path) {
|
||||||
delete[] buf;
|
delete[] buf;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case DIV_INSFORMAT_TFI:
|
||||||
|
try {
|
||||||
|
reader.seek(0,SEEK_SET);
|
||||||
|
|
||||||
|
ins->type=DIV_INS_FM;
|
||||||
|
ins->name=pathRedux;
|
||||||
|
|
||||||
|
ins->fm.alg=reader.readC();
|
||||||
|
ins->fm.fb=reader.readC();
|
||||||
|
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
DivInstrumentFM::Operator& op=ins->fm.op[i];
|
||||||
|
|
||||||
|
op.mult=reader.readC();
|
||||||
|
op.dt=reader.readC();
|
||||||
|
op.tl=reader.readC();
|
||||||
|
op.rs=reader.readC();
|
||||||
|
op.ar=reader.readC();
|
||||||
|
op.dr=reader.readC();
|
||||||
|
op.d2r=reader.readC();
|
||||||
|
op.rr=reader.readC();
|
||||||
|
op.sl=reader.readC();
|
||||||
|
op.ssgEnv=reader.readC();
|
||||||
|
}
|
||||||
|
} catch (EndOfFileException e) {
|
||||||
|
lastError="premature end of file";
|
||||||
|
logE("premature end of file!\n");
|
||||||
|
delete ins;
|
||||||
|
delete[] buf;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_INSFORMAT_VGI:
|
||||||
|
try {
|
||||||
|
reader.seek(0,SEEK_SET);
|
||||||
|
|
||||||
|
ins->type=DIV_INS_FM;
|
||||||
|
ins->name=pathRedux;
|
||||||
|
|
||||||
|
ins->fm.alg=reader.readC();
|
||||||
|
ins->fm.fb=reader.readC();
|
||||||
|
unsigned char fmsams=reader.readC();
|
||||||
|
ins->fm.fms=fmsams&7;
|
||||||
|
ins->fm.ams=fmsams>>4;
|
||||||
|
|
||||||
|
for (int i=0; i<4; i++) {
|
||||||
|
DivInstrumentFM::Operator& op=ins->fm.op[i];
|
||||||
|
|
||||||
|
op.mult=reader.readC();
|
||||||
|
op.dt=reader.readC();
|
||||||
|
op.tl=reader.readC();
|
||||||
|
op.rs=reader.readC();
|
||||||
|
op.ar=reader.readC();
|
||||||
|
op.dr=reader.readC();
|
||||||
|
if (op.dr&0x80) {
|
||||||
|
op.am=1;
|
||||||
|
op.dr&=0x7f;
|
||||||
|
}
|
||||||
|
op.d2r=reader.readC();
|
||||||
|
op.rr=reader.readC();
|
||||||
|
op.sl=reader.readC();
|
||||||
|
op.ssgEnv=reader.readC();
|
||||||
|
}
|
||||||
|
} catch (EndOfFileException e) {
|
||||||
|
lastError="premature end of file";
|
||||||
|
logE("premature end of file!\n");
|
||||||
|
delete ins;
|
||||||
|
delete[] buf;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIV_INSFORMAT_FTI:
|
||||||
|
break;
|
||||||
|
case DIV_INSFORMAT_BTI:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (reader.tell()<reader.size()) {
|
if (reader.tell()<reader.size()) {
|
||||||
addWarning("https://github.com/tildearrow/furnace/issues/84");
|
addWarning("https://github.com/tildearrow/furnace/issues/84");
|
||||||
|
@ -1828,19 +1950,24 @@ void DivEngine::deepCloneOrder(bool where) {
|
||||||
warnings="";
|
warnings="";
|
||||||
isBusy.lock();
|
isBusy.lock();
|
||||||
for (int i=0; i<chans; i++) {
|
for (int i=0; i<chans; i++) {
|
||||||
|
bool didNotFind=true;
|
||||||
|
logD("channel %d\n",i);
|
||||||
order[i]=song.orders.ord[i][curOrder];
|
order[i]=song.orders.ord[i][curOrder];
|
||||||
// find free slot
|
// find free slot
|
||||||
for (int j=0; j<128; j++) {
|
for (int j=0; j<128; j++) {
|
||||||
|
logD("finding free slot in %d...\n",j);
|
||||||
if (song.pat[i].data[j]==NULL) {
|
if (song.pat[i].data[j]==NULL) {
|
||||||
int origOrd=order[i];
|
int origOrd=order[i];
|
||||||
order[i]=j;
|
order[i]=j;
|
||||||
DivPattern* oldPat=song.pat[i].getPattern(origOrd,false);
|
DivPattern* oldPat=song.pat[i].getPattern(origOrd,false);
|
||||||
DivPattern* pat=song.pat[i].getPattern(j,true);
|
DivPattern* pat=song.pat[i].getPattern(j,true);
|
||||||
memcpy(pat->data,oldPat->data,256*32*sizeof(short));
|
memcpy(pat->data,oldPat->data,256*32*sizeof(short));
|
||||||
|
logD("found at %d\n",j);
|
||||||
|
didNotFind=false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (order[i]==song.orders.ord[i][curOrder]) {
|
if (didNotFind) {
|
||||||
addWarning(fmt::sprintf("no free patterns in channel %d!",i));
|
addWarning(fmt::sprintf("no free patterns in channel %d!",i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,8 @@
|
||||||
warnings+=(String("\n")+x); \
|
warnings+=(String("\n")+x); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DIV_VERSION "0.5.7pre3"
|
#define DIV_VERSION "0.5.7pre4"
|
||||||
#define DIV_ENGINE_VERSION 51
|
#define DIV_ENGINE_VERSION 52
|
||||||
|
|
||||||
enum DivStatusView {
|
enum DivStatusView {
|
||||||
DIV_STATUS_NOTHING=0,
|
DIV_STATUS_NOTHING=0,
|
||||||
|
|
|
@ -171,7 +171,7 @@ void DivPlatformC64::tick() {
|
||||||
if (!chan[i].resetMask && !isMuted[i]) {
|
if (!chan[i].resetMask && !isMuted[i]) {
|
||||||
rWrite(i*7+5,0);
|
rWrite(i*7+5,0);
|
||||||
rWrite(i*7+6,0);
|
rWrite(i*7+6,0);
|
||||||
rWrite(i*7+4,(isMuted[i]?0:(chan[i].wave<<4))|8|(chan[i].ring<<2)|(chan[i].sync<<1));
|
rWrite(i*7+4,(isMuted[i]?8:(chan[i].wave<<4))|8|(chan[i].ring<<2)|(chan[i].sync<<1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -246,8 +246,8 @@ int DivPlatformC64::dispatch(DivCommand c) {
|
||||||
filtCut=ins->c64.cut;
|
filtCut=ins->c64.cut;
|
||||||
filtRes=ins->c64.res;
|
filtRes=ins->c64.res;
|
||||||
filtControl=ins->c64.lp|(ins->c64.bp<<1)|(ins->c64.hp<<2)|(ins->c64.ch3off<<3);
|
filtControl=ins->c64.lp|(ins->c64.bp<<1)|(ins->c64.hp<<2)|(ins->c64.ch3off<<3);
|
||||||
updateFilter();
|
|
||||||
}
|
}
|
||||||
|
updateFilter();
|
||||||
}
|
}
|
||||||
if (chan[c.chan].insChanged) {
|
if (chan[c.chan].insChanged) {
|
||||||
chan[c.chan].insChanged=false;
|
chan[c.chan].insChanged=false;
|
||||||
|
|
|
@ -977,7 +977,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop) {
|
||||||
writeLoop=true;
|
writeLoop=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nextTick()) {
|
if (nextTick() || !playing) {
|
||||||
done=true;
|
done=true;
|
||||||
if (!loop) {
|
if (!loop) {
|
||||||
for (int i=0; i<song.systemLen; i++) {
|
for (int i=0; i<song.systemLen; i++) {
|
||||||
|
@ -991,6 +991,11 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop) {
|
||||||
w->writeC(i);
|
w->writeC(i);
|
||||||
loopSample[i]=-1;
|
loopSample[i]=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!playing) {
|
||||||
|
writeLoop=false;
|
||||||
|
loopPos=-1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// get register dumps
|
// get register dumps
|
||||||
for (int i=0; i<song.systemLen; i++) {
|
for (int i=0; i<song.systemLen; i++) {
|
||||||
|
@ -1126,8 +1131,13 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop) {
|
||||||
w->writeI(gd3Off-0x14);
|
w->writeI(gd3Off-0x14);
|
||||||
w->writeI(tickCount);
|
w->writeI(tickCount);
|
||||||
if (loop) {
|
if (loop) {
|
||||||
|
if (loopPos==-1) {
|
||||||
|
w->writeI(0);
|
||||||
|
w->writeI(0);
|
||||||
|
} else {
|
||||||
w->writeI(loopPos-0x1c);
|
w->writeI(loopPos-0x1c);
|
||||||
w->writeI(tickCount-loopTick-1);
|
w->writeI(tickCount-loopTick-1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
w->writeI(0);
|
w->writeI(0);
|
||||||
w->writeI(0);
|
w->writeI(0);
|
||||||
|
|
|
@ -3820,7 +3820,7 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
|
||||||
ImGuiFileDialog::Instance()->OpenModal("FileDialog","Save File","DefleMask 1.0/legacy module{.dmf}",workingDir,1,nullptr,ImGuiFileDialogFlags_ConfirmOverwrite);
|
ImGuiFileDialog::Instance()->OpenModal("FileDialog","Save File","DefleMask 1.0/legacy module{.dmf}",workingDir,1,nullptr,ImGuiFileDialogFlags_ConfirmOverwrite);
|
||||||
break;
|
break;
|
||||||
case GUI_FILE_INS_OPEN:
|
case GUI_FILE_INS_OPEN:
|
||||||
ImGuiFileDialog::Instance()->OpenModal("FileDialog","Load Instrument","compatible files{.fui,.dmp},.*",workingDir);
|
ImGuiFileDialog::Instance()->OpenModal("FileDialog","Load Instrument","compatible files{.fui,.dmp,.tfi,.vgi},.*",workingDir);
|
||||||
break;
|
break;
|
||||||
case GUI_FILE_INS_SAVE:
|
case GUI_FILE_INS_SAVE:
|
||||||
ImGuiFileDialog::Instance()->OpenModal("FileDialog","Save Instrument","Furnace instrument{.fui}",workingDir,1,nullptr,ImGuiFileDialogFlags_ConfirmOverwrite);
|
ImGuiFileDialog::Instance()->OpenModal("FileDialog","Save Instrument","Furnace instrument{.fui}",workingDir,1,nullptr,ImGuiFileDialogFlags_ConfirmOverwrite);
|
||||||
|
@ -5486,6 +5486,11 @@ bool FurnaceGUI::init() {
|
||||||
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".otf",ImVec4(0.3f,1.0f,0.6f,1.0f),ICON_FA_FONT);
|
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".otf",ImVec4(0.3f,1.0f,0.6f,1.0f),ICON_FA_FONT);
|
||||||
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".ttc",ImVec4(0.3f,1.0f,0.6f,1.0f),ICON_FA_FONT);
|
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".ttc",ImVec4(0.3f,1.0f,0.6f,1.0f),ICON_FA_FONT);
|
||||||
|
|
||||||
|
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".tfi",ImVec4(1.0f,0.5f,0.5f,1.0f),ICON_FA_FILE);
|
||||||
|
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".vgi",ImVec4(1.0f,0.5f,0.5f,1.0f),ICON_FA_FILE);
|
||||||
|
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".fti",ImVec4(1.0f,0.5f,0.5f,1.0f),ICON_FA_FILE);
|
||||||
|
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtension,".bti",ImVec4(1.0f,0.5f,0.5f,1.0f),ICON_FA_FILE);
|
||||||
|
|
||||||
updateWindowTitle();
|
updateWindowTitle();
|
||||||
|
|
||||||
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
||||||
|
@ -5574,6 +5579,8 @@ FurnaceGUI::FurnaceGUI():
|
||||||
loopRow(-1),
|
loopRow(-1),
|
||||||
loopEnd(-1),
|
loopEnd(-1),
|
||||||
isClipping(0),
|
isClipping(0),
|
||||||
|
extraChannelButtons(0),
|
||||||
|
patNameTarget(-1),
|
||||||
editControlsOpen(true),
|
editControlsOpen(true),
|
||||||
ordersOpen(true),
|
ordersOpen(true),
|
||||||
insListOpen(true),
|
insListOpen(true),
|
||||||
|
@ -5598,13 +5605,13 @@ FurnaceGUI::FurnaceGUI():
|
||||||
selecting(false),
|
selecting(false),
|
||||||
curNibble(false),
|
curNibble(false),
|
||||||
orderNibble(false),
|
orderNibble(false),
|
||||||
extraChannelButtons(false),
|
|
||||||
followOrders(true),
|
followOrders(true),
|
||||||
followPattern(true),
|
followPattern(true),
|
||||||
changeAllOrders(false),
|
changeAllOrders(false),
|
||||||
collapseWindow(false),
|
collapseWindow(false),
|
||||||
demandScrollX(false),
|
demandScrollX(false),
|
||||||
fancyPattern(false),
|
fancyPattern(false),
|
||||||
|
wantPatName(false),
|
||||||
curWindow(GUI_WINDOW_NOTHING),
|
curWindow(GUI_WINDOW_NOTHING),
|
||||||
nextWindow(GUI_WINDOW_NOTHING),
|
nextWindow(GUI_WINDOW_NOTHING),
|
||||||
wavePreviewOn(false),
|
wavePreviewOn(false),
|
||||||
|
|
|
@ -516,14 +516,14 @@ class FurnaceGUI {
|
||||||
char finalLayoutPath[4096];
|
char finalLayoutPath[4096];
|
||||||
|
|
||||||
int curIns, curWave, curSample, curOctave, oldRow, oldOrder, oldOrder1, editStep, exportLoops, soloChan, soloTimeout, orderEditMode, orderCursor;
|
int curIns, curWave, curSample, curOctave, oldRow, oldOrder, oldOrder1, editStep, exportLoops, soloChan, soloTimeout, orderEditMode, orderCursor;
|
||||||
int loopOrder, loopRow, loopEnd, isClipping;
|
int loopOrder, loopRow, loopEnd, isClipping, extraChannelButtons, patNameTarget;
|
||||||
bool editControlsOpen, ordersOpen, insListOpen, songInfoOpen, patternOpen, insEditOpen;
|
bool editControlsOpen, ordersOpen, insListOpen, songInfoOpen, patternOpen, insEditOpen;
|
||||||
bool waveListOpen, waveEditOpen, sampleListOpen, sampleEditOpen, aboutOpen, settingsOpen;
|
bool waveListOpen, waveEditOpen, sampleListOpen, sampleEditOpen, aboutOpen, settingsOpen;
|
||||||
bool mixerOpen, debugOpen, oscOpen, volMeterOpen, statsOpen, compatFlagsOpen;
|
bool mixerOpen, debugOpen, oscOpen, volMeterOpen, statsOpen, compatFlagsOpen;
|
||||||
bool pianoOpen, notesOpen, channelsOpen;
|
bool pianoOpen, notesOpen, channelsOpen;
|
||||||
SelectionPoint selStart, selEnd, cursor;
|
SelectionPoint selStart, selEnd, cursor;
|
||||||
bool selecting, curNibble, orderNibble, extraChannelButtons, followOrders, followPattern, changeAllOrders;
|
bool selecting, curNibble, orderNibble, followOrders, followPattern, changeAllOrders;
|
||||||
bool collapseWindow, demandScrollX, fancyPattern;
|
bool collapseWindow, demandScrollX, fancyPattern, wantPatName;
|
||||||
FurnaceGUIWindows curWindow, nextWindow;
|
FurnaceGUIWindows curWindow, nextWindow;
|
||||||
float peak[2];
|
float peak[2];
|
||||||
float patChanX[DIV_MAX_CHANS+1];
|
float patChanX[DIV_MAX_CHANS+1];
|
||||||
|
|
|
@ -17,10 +17,12 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <imgui.h>
|
||||||
#define _USE_MATH_DEFINES
|
#define _USE_MATH_DEFINES
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
#include "IconsFontAwesome4.h"
|
#include "IconsFontAwesome4.h"
|
||||||
|
#include "misc/cpp/imgui_stdlib.h"
|
||||||
#include "guiConst.h"
|
#include "guiConst.h"
|
||||||
#include <fmt/printf.h>
|
#include <fmt/printf.h>
|
||||||
|
|
||||||
|
@ -376,8 +378,8 @@ void FurnaceGUI::drawPattern() {
|
||||||
}
|
}
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
if (ImGui::Selectable(extraChannelButtons?" --##ExtraChannelButtons":" ++##ExtraChannelButtons",false,ImGuiSelectableFlags_NoPadWithHalfSpacing,ImVec2(0.0f,lineHeight+1.0f*dpiScale))) {
|
if (ImGui::Selectable((extraChannelButtons==2)?" --##ExtraChannelButtons":" ++##ExtraChannelButtons",false,ImGuiSelectableFlags_NoPadWithHalfSpacing,ImVec2(0.0f,lineHeight+1.0f*dpiScale))) {
|
||||||
extraChannelButtons=!extraChannelButtons;
|
if (++extraChannelButtons>2) extraChannelButtons=0;
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) {
|
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) {
|
||||||
fancyPattern=!fancyPattern;
|
fancyPattern=!fancyPattern;
|
||||||
|
@ -448,7 +450,34 @@ void FurnaceGUI::drawPattern() {
|
||||||
if (settings.soloAction!=2) if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) {
|
if (settings.soloAction!=2) if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) {
|
||||||
e->toggleSolo(i);
|
e->toggleSolo(i);
|
||||||
}
|
}
|
||||||
if (extraChannelButtons) {
|
if (extraChannelButtons==2) {
|
||||||
|
DivPattern* pat=e->song.pat[i].getPattern(e->song.orders.ord[i][ord],true);
|
||||||
|
ImGui::PushFont(mainFont);
|
||||||
|
if (patNameTarget==i) {
|
||||||
|
snprintf(chanID,2048,"##PatNameI%d_%d",i,ord);
|
||||||
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x-(8.0f*dpiScale));
|
||||||
|
ImGui::SetCursorPosX(ImGui::GetCursorPosX()+4.0f*dpiScale);
|
||||||
|
ImGui::InputText(chanID,&pat->name);
|
||||||
|
if (wantPatName) {
|
||||||
|
wantPatName=false;
|
||||||
|
ImGui::SetItemDefaultFocus();
|
||||||
|
ImGui::SetKeyboardFocusHere(-1);
|
||||||
|
} else {
|
||||||
|
if (!ImGui::IsItemActive()) {
|
||||||
|
patNameTarget=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
snprintf(chanID,2048," %s##PatName%d",pat->name.c_str(),i);
|
||||||
|
if (ImGui::Selectable(chanID,true,ImGuiSelectableFlags_NoPadWithHalfSpacing,ImVec2(0.0f,lineHeight+1.0f*dpiScale))) {
|
||||||
|
patNameTarget=i;
|
||||||
|
wantPatName=true;
|
||||||
|
snprintf(chanID,2048,"##PatNameI%d_%d",i,ord);
|
||||||
|
ImGui::SetActiveID(ImGui::GetID(chanID),ImGui::GetCurrentWindow());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::PopFont();
|
||||||
|
} else if (extraChannelButtons==1) {
|
||||||
snprintf(chanID,2048,"%c##_HCH%d",e->song.chanCollapse[i]?'+':'-',i);
|
snprintf(chanID,2048,"%c##_HCH%d",e->song.chanCollapse[i]?'+':'-',i);
|
||||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX()+4.0f*dpiScale);
|
ImGui::SetCursorPosX(ImGui::GetCursorPosX()+4.0f*dpiScale);
|
||||||
if (ImGui::SmallButton(chanID)) {
|
if (ImGui::SmallButton(chanID)) {
|
||||||
|
|
Loading…
Reference in New Issue