This commit is contained in:
cam900 2022-12-12 14:42:56 +09:00
commit 84990c759e
15 changed files with 520 additions and 89 deletions

View File

@ -3970,6 +3970,7 @@ void ImGui::UpdateMouseMovingWindowNewFrame()
{ {
MarkIniSettingsDirty(moving_window); MarkIniSettingsDirty(moving_window);
SetWindowPos(moving_window, pos, ImGuiCond_Always); SetWindowPos(moving_window, pos, ImGuiCond_Always);
g.InertialScrollInhibited=true;
if (moving_window->ViewportOwned) // Synchronize viewport immediately because some overlays may relies on clipping rectangle before we Begin() into the window. if (moving_window->ViewportOwned) // Synchronize viewport immediately because some overlays may relies on clipping rectangle before we Begin() into the window.
{ {
moving_window->Viewport->Pos = pos; moving_window->Viewport->Pos = pos;
@ -6025,6 +6026,7 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
if (size_target.x != FLT_MAX) if (size_target.x != FLT_MAX)
{ {
window->SizeFull = size_target; window->SizeFull = size_target;
g.InertialScrollInhibited=true;
MarkIniSettingsDirty(window); MarkIniSettingsDirty(window);
} }
if (pos_target.x != FLT_MAX) if (pos_target.x != FLT_MAX)

View File

@ -22,7 +22,7 @@
#include "sound/c64_fp/siddefs-fp.h" #include "sound/c64_fp/siddefs-fp.h"
#include <math.h> #include <math.h>
#define rWrite(a,v) if (!skipRegisterWrites) {if (isFP) {sid_fp.write(a,v);} else {sid.write(a,v);}; regPool[(a)&0x1f]=v; if (dumpWrites) {addWrite(a,v);} } #define rWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
#define CHIP_FREQBASE 524288 #define CHIP_FREQBASE 524288
@ -66,6 +66,16 @@ const char** DivPlatformC64::getRegisterSheet() {
void DivPlatformC64::acquire(short* bufL, short* bufR, size_t start, size_t len) { void DivPlatformC64::acquire(short* bufL, short* bufR, size_t start, size_t len) {
int dcOff=isFP?0:sid.get_dc(0); int dcOff=isFP?0:sid.get_dc(0);
for (size_t i=start; i<start+len; i++) { for (size_t i=start; i<start+len; i++) {
if (!writes.empty()) {
QueuedWrite w=writes.front();
if (isFP) {
sid_fp.write(w.addr,w.val);
} else {
sid.write(w.addr,w.val);
};
regPool[w.addr&0x1f]=w.val;
writes.pop();
}
if (isFP) { if (isFP) {
sid_fp.clock(4,&bufL[i]); sid_fp.clock(4,&bufL[i]);
if (++writeOscBuf>=4) { if (++writeOscBuf>=4) {
@ -483,6 +493,7 @@ float DivPlatformC64::getPostAmp() {
} }
void DivPlatformC64::reset() { void DivPlatformC64::reset() {
while (!writes.empty()) writes.pop();
for (int i=0; i<3; i++) { for (int i=0; i<3; i++) {
chan[i]=DivPlatformC64::Channel(); chan[i]=DivPlatformC64::Channel();
chan[i].std.setEngine(parent); chan[i].std.setEngine(parent);

View File

@ -21,6 +21,7 @@
#define _C64_H #define _C64_H
#include "../dispatch.h" #include "../dispatch.h"
#include <queue>
#include "../macroInt.h" #include "../macroInt.h"
#include "sound/c64/sid.h" #include "sound/c64/sid.h"
#include "sound/c64_fp/SID.h" #include "sound/c64_fp/SID.h"
@ -73,6 +74,12 @@ class DivPlatformC64: public DivDispatch {
Channel chan[3]; Channel chan[3];
DivDispatchOscBuffer* oscBuf[3]; DivDispatchOscBuffer* oscBuf[3];
bool isMuted[3]; bool isMuted[3];
struct QueuedWrite {
unsigned char addr;
unsigned char val;
QueuedWrite(unsigned char a, unsigned char v): addr(a), val(v) {}
};
std::queue<QueuedWrite> writes;
unsigned char filtControl, filtRes, vol; unsigned char filtControl, filtRes, vol;
unsigned char writeOscBuf; unsigned char writeOscBuf;

View File

@ -160,7 +160,7 @@ void DivPlatformSMS::tick(bool sysTick) {
if (!chan[i].inPorta) { if (!chan[i].inPorta) {
// TODO: add compatibility flag. this is horrible. // TODO: add compatibility flag. this is horrible.
int areYouSerious=parent->calcArp(chan[i].note,chan[i].std.arp.val); int areYouSerious=parent->calcArp(chan[i].note,chan[i].std.arp.val);
while (areYouSerious>0x60) areYouSerious-=12; if (!easyNoise) while (areYouSerious>0x60) areYouSerious-=12;
chan[i].baseFreq=NOTE_SN(i,areYouSerious); chan[i].baseFreq=NOTE_SN(i,areYouSerious);
chan[i].actualNote=areYouSerious; chan[i].actualNote=areYouSerious;
chan[i].freqChanged=true; chan[i].freqChanged=true;

View File

@ -47,6 +47,9 @@ void FurnaceGUI::drawInsList(bool asChild) {
if (ImGui::Button(ICON_FA_PLUS "##InsAdd")) { if (ImGui::Button(ICON_FA_PLUS "##InsAdd")) {
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_ADD); if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_ADD);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Add");
}
if (settings.unifiedDataView) { if (settings.unifiedDataView) {
if (ImGui::BeginPopupContextItem("UnifiedAdd",ImGuiMouseButton_Left)) { if (ImGui::BeginPopupContextItem("UnifiedAdd",ImGuiMouseButton_Left)) {
if (ImGui::MenuItem("instrument")) { if (ImGui::MenuItem("instrument")) {
@ -70,6 +73,9 @@ void FurnaceGUI::drawInsList(bool asChild) {
if (ImGui::Button(ICON_FA_FILES_O "##InsClone")) { if (ImGui::Button(ICON_FA_FILES_O "##InsClone")) {
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_DUPLICATE); if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_DUPLICATE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Duplicate");
}
if (settings.unifiedDataView) { if (settings.unifiedDataView) {
if (ImGui::BeginPopupContextItem("UnifiedClone",ImGuiMouseButton_Left)) { if (ImGui::BeginPopupContextItem("UnifiedClone",ImGuiMouseButton_Left)) {
if (ImGui::MenuItem("instrument")) { if (ImGui::MenuItem("instrument")) {
@ -88,6 +94,9 @@ void FurnaceGUI::drawInsList(bool asChild) {
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##InsLoad")) { if (ImGui::Button(ICON_FA_FOLDER_OPEN "##InsLoad")) {
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_OPEN); if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_OPEN);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Open");
}
if (settings.unifiedDataView) { if (settings.unifiedDataView) {
if (ImGui::BeginPopupContextItem("UnifiedLoad",ImGuiMouseButton_Left)) { if (ImGui::BeginPopupContextItem("UnifiedLoad",ImGuiMouseButton_Left)) {
if (ImGui::MenuItem("instrument")) { if (ImGui::MenuItem("instrument")) {
@ -127,6 +136,9 @@ void FurnaceGUI::drawInsList(bool asChild) {
if (ImGui::Button(ICON_FA_FLOPPY_O "##InsSave")) { if (ImGui::Button(ICON_FA_FLOPPY_O "##InsSave")) {
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_SAVE); if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_SAVE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Save");
}
if (settings.unifiedDataView) { if (settings.unifiedDataView) {
if (ImGui::BeginPopupContextItem("UnifiedSave",ImGuiMouseButton_Left)) { if (ImGui::BeginPopupContextItem("UnifiedSave",ImGuiMouseButton_Left)) {
if (ImGui::MenuItem("instrument")) { if (ImGui::MenuItem("instrument")) {
@ -166,15 +178,24 @@ void FurnaceGUI::drawInsList(bool asChild) {
if (ImGui::ArrowButton("InsUp",ImGuiDir_Up)) { if (ImGui::ArrowButton("InsUp",ImGuiDir_Up)) {
doAction(GUI_ACTION_INS_LIST_MOVE_UP); doAction(GUI_ACTION_INS_LIST_MOVE_UP);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Move up");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::ArrowButton("InsDown",ImGuiDir_Down)) { if (ImGui::ArrowButton("InsDown",ImGuiDir_Down)) {
doAction(GUI_ACTION_INS_LIST_MOVE_DOWN); doAction(GUI_ACTION_INS_LIST_MOVE_DOWN);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Move down");
}
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_TIMES "##InsDelete")) { if (ImGui::Button(ICON_FA_TIMES "##InsDelete")) {
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_DELETE); if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_DELETE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Delete");
}
if (settings.unifiedDataView) { if (settings.unifiedDataView) {
if (ImGui::BeginPopupContextItem("UnifiedDelete",ImGuiMouseButton_Left)) { if (ImGui::BeginPopupContextItem("UnifiedDelete",ImGuiMouseButton_Left)) {
if (ImGui::MenuItem("instrument")) { if (ImGui::MenuItem("instrument")) {
@ -521,14 +542,23 @@ void FurnaceGUI::drawWaveList(bool asChild) {
if (ImGui::Button(ICON_FA_PLUS "##WaveAdd")) { if (ImGui::Button(ICON_FA_PLUS "##WaveAdd")) {
doAction(GUI_ACTION_WAVE_LIST_ADD); doAction(GUI_ACTION_WAVE_LIST_ADD);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Add");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_FILES_O "##WaveClone")) { if (ImGui::Button(ICON_FA_FILES_O "##WaveClone")) {
doAction(GUI_ACTION_WAVE_LIST_DUPLICATE); doAction(GUI_ACTION_WAVE_LIST_DUPLICATE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Duplicate");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##WaveLoad")) { if (ImGui::Button(ICON_FA_FOLDER_OPEN "##WaveLoad")) {
doAction(GUI_ACTION_WAVE_LIST_OPEN); doAction(GUI_ACTION_WAVE_LIST_OPEN);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Open");
}
if (ImGui::BeginPopupContextItem("WaveOpenOpt")) { if (ImGui::BeginPopupContextItem("WaveOpenOpt")) {
if (ImGui::MenuItem("replace...")) { if (ImGui::MenuItem("replace...")) {
doAction((curWave>=0 && curWave<(int)e->song.wave.size())?GUI_ACTION_WAVE_LIST_OPEN_REPLACE:GUI_ACTION_WAVE_LIST_OPEN); doAction((curWave>=0 && curWave<(int)e->song.wave.size())?GUI_ACTION_WAVE_LIST_OPEN_REPLACE:GUI_ACTION_WAVE_LIST_OPEN);
@ -539,6 +569,9 @@ void FurnaceGUI::drawWaveList(bool asChild) {
if (ImGui::Button(ICON_FA_FLOPPY_O "##WaveSave")) { if (ImGui::Button(ICON_FA_FLOPPY_O "##WaveSave")) {
doAction(GUI_ACTION_WAVE_LIST_SAVE); doAction(GUI_ACTION_WAVE_LIST_SAVE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Save");
}
if (!settings.unifiedDataView) { if (!settings.unifiedDataView) {
if (ImGui::BeginPopupContextItem("WaveSaveFormats",ImGuiMouseButton_Right)) { if (ImGui::BeginPopupContextItem("WaveSaveFormats",ImGuiMouseButton_Right)) {
if (ImGui::MenuItem("save as .dmw...")) { if (ImGui::MenuItem("save as .dmw...")) {
@ -554,14 +587,23 @@ void FurnaceGUI::drawWaveList(bool asChild) {
if (ImGui::ArrowButton("WaveUp",ImGuiDir_Up)) { if (ImGui::ArrowButton("WaveUp",ImGuiDir_Up)) {
doAction(GUI_ACTION_WAVE_LIST_MOVE_UP); doAction(GUI_ACTION_WAVE_LIST_MOVE_UP);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Move up");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::ArrowButton("WaveDown",ImGuiDir_Down)) { if (ImGui::ArrowButton("WaveDown",ImGuiDir_Down)) {
doAction(GUI_ACTION_WAVE_LIST_MOVE_DOWN); doAction(GUI_ACTION_WAVE_LIST_MOVE_DOWN);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Move down");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_TIMES "##WaveDelete")) { if (ImGui::Button(ICON_FA_TIMES "##WaveDelete")) {
doAction(GUI_ACTION_WAVE_LIST_DELETE); doAction(GUI_ACTION_WAVE_LIST_DELETE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Delete");
}
ImGui::Separator(); ImGui::Separator();
if (ImGui::BeginTable("WaveListScroll",1,ImGuiTableFlags_ScrollY)) { if (ImGui::BeginTable("WaveListScroll",1,ImGuiTableFlags_ScrollY)) {
actualWaveList(); actualWaveList();
@ -598,14 +640,23 @@ void FurnaceGUI::drawSampleList(bool asChild) {
if (ImGui::Button(ICON_FA_FILE "##SampleAdd")) { if (ImGui::Button(ICON_FA_FILE "##SampleAdd")) {
doAction(GUI_ACTION_SAMPLE_LIST_ADD); doAction(GUI_ACTION_SAMPLE_LIST_ADD);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Add");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_FILES_O "##SampleClone")) { if (ImGui::Button(ICON_FA_FILES_O "##SampleClone")) {
doAction(GUI_ACTION_SAMPLE_LIST_DUPLICATE); doAction(GUI_ACTION_SAMPLE_LIST_DUPLICATE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Duplicate");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##SampleLoad")) { if (ImGui::Button(ICON_FA_FOLDER_OPEN "##SampleLoad")) {
doAction(GUI_ACTION_SAMPLE_LIST_OPEN); doAction(GUI_ACTION_SAMPLE_LIST_OPEN);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Open");
}
if (ImGui::BeginPopupContextItem("SampleOpenOpt")) { if (ImGui::BeginPopupContextItem("SampleOpenOpt")) {
if (ImGui::MenuItem("replace...")) { if (ImGui::MenuItem("replace...")) {
doAction((curSample>=0 && curSample<(int)e->song.sample.size())?GUI_ACTION_SAMPLE_LIST_OPEN_REPLACE:GUI_ACTION_SAMPLE_LIST_OPEN); doAction((curSample>=0 && curSample<(int)e->song.sample.size())?GUI_ACTION_SAMPLE_LIST_OPEN_REPLACE:GUI_ACTION_SAMPLE_LIST_OPEN);
@ -623,26 +674,44 @@ void FurnaceGUI::drawSampleList(bool asChild) {
if (ImGui::Button(ICON_FA_FLOPPY_O "##SampleSave")) { if (ImGui::Button(ICON_FA_FLOPPY_O "##SampleSave")) {
doAction(GUI_ACTION_SAMPLE_LIST_SAVE); doAction(GUI_ACTION_SAMPLE_LIST_SAVE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Save");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::ArrowButton("SampleUp",ImGuiDir_Up)) { if (ImGui::ArrowButton("SampleUp",ImGuiDir_Up)) {
doAction(GUI_ACTION_SAMPLE_LIST_MOVE_UP); doAction(GUI_ACTION_SAMPLE_LIST_MOVE_UP);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Move up");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::ArrowButton("SampleDown",ImGuiDir_Down)) { if (ImGui::ArrowButton("SampleDown",ImGuiDir_Down)) {
doAction(GUI_ACTION_SAMPLE_LIST_MOVE_DOWN); doAction(GUI_ACTION_SAMPLE_LIST_MOVE_DOWN);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Move down");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_TIMES "##SampleDelete")) { if (ImGui::Button(ICON_FA_TIMES "##SampleDelete")) {
doAction(GUI_ACTION_SAMPLE_LIST_DELETE); doAction(GUI_ACTION_SAMPLE_LIST_DELETE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Delete");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_VOLUME_UP "##PreviewSampleL")) { if (ImGui::Button(ICON_FA_VOLUME_UP "##PreviewSampleL")) {
doAction(GUI_ACTION_SAMPLE_LIST_PREVIEW); doAction(GUI_ACTION_SAMPLE_LIST_PREVIEW);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Preview");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_VOLUME_OFF "##StopSampleL")) { if (ImGui::Button(ICON_FA_VOLUME_OFF "##StopSampleL")) {
doAction(GUI_ACTION_SAMPLE_LIST_STOP_PREVIEW); doAction(GUI_ACTION_SAMPLE_LIST_STOP_PREVIEW);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Stop preview");
}
ImGui::Separator(); ImGui::Separator();
if (ImGui::BeginTable("SampleListScroll",1,ImGuiTableFlags_ScrollY)) { if (ImGui::BeginTable("SampleListScroll",1,ImGuiTableFlags_ScrollY)) {
actualSampleList(); actualSampleList();

View File

@ -174,6 +174,9 @@ void FurnaceGUI::doAction(int what) {
case GUI_ACTION_PANIC: case GUI_ACTION_PANIC:
e->syncReset(); e->syncReset();
break; break;
case GUI_ACTION_CLEAR:
showWarning("Are you sure you want to clear... (cannot be undone!)",GUI_WARN_CLEAR);
break;
case GUI_ACTION_WINDOW_EDIT_CONTROLS: case GUI_ACTION_WINDOW_EDIT_CONTROLS:
nextWindow=GUI_WINDOW_EDIT_CONTROLS; nextWindow=GUI_WINDOW_EDIT_CONTROLS;
@ -554,6 +557,10 @@ void FurnaceGUI::doAction(int what) {
break; break;
case GUI_ACTION_PAT_LATCH: // TODO case GUI_ACTION_PAT_LATCH: // TODO
break; break;
case GUI_ACTION_PAT_SCROLL_MODE: // TODO
break;
case GUI_ACTION_PAT_CLEAR_LATCH: // TODO
break;
case GUI_ACTION_INS_LIST_ADD: case GUI_ACTION_INS_LIST_ADD:
curIns=e->addInstrument(cursor.xCoarse); curIns=e->addInstrument(cursor.xCoarse);

View File

@ -23,17 +23,146 @@
// 0: all directions // 0: all directions
// 1: half // 1: half
// 2: quarter // 2: half
float mobileButtonAngles[3][8]={ // 3: quarter
const float mobileButtonAngles[4][8]={
{0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875}, {0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875},
{0.8, 0.933333, 0.066667, 0.2, 0.8, 0.933333, 0.066667, 0.2}, {0.8333, 0.0, 0.1667, 0.8, 0.9, 0.0, 0.1, 0.2},
{0.75, 0.833333, 0.916667, 0.0, 0.75, 0.833333, 0.916667, 0.0} {0.0833, 0.25, 0.4167, 0.45, 0.35, 0.25, 0.15, 0.05},
{0.25, 0.125, 0.0, 0.25, 0.1875, 0.125, 0.0625, 0.0}
}; };
float mobileButtonDistances[3][8]={ const float mobileButtonDistances[4][8]={
{1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}, {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0},
{1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0}, {0.8, 0.75, 0.8, 1.5, 1.5, 1.5, 1.5, 1.5},
{1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0} {0.8, 0.75, 0.8, 1.5, 1.5, 1.5, 1.5, 1.5},
{0.9, 1.0, 0.9, 1.78, 1.82, 1.95, 1.82, 1.78}
};
const char* mobileButtonLabels[32]={
// page 1
"cut",
"copy",
"paste",
"delete",
"select\nall",
"piano",
"undo",
"redo",
// page 2
"paste\nmix",
"paste\nmix bg",
"paste\nins",
"paste\nins bg",
"paste\nflood",
"paste\noverflow",
"transpose\nnotes",
"transpose\nvalues",
// page 3
"change\nins",
"find/\nreplace",
"collapse",
"expand",
"flip",
"invert",
"interpolate",
"scale",
// page 4
"fade",
"randomize",
"opmask",
"scroll\nmode",
"input\nlatch",
"set\nlatch",
"clear\nlatch",
"clear"
};
const int mobileButtonActions[32]={
// page 1
GUI_ACTION_PAT_CUT,
GUI_ACTION_PAT_COPY,
GUI_ACTION_PAT_PASTE,
GUI_ACTION_PAT_DELETE,
GUI_ACTION_PAT_SELECT_ALL,
0,
GUI_ACTION_UNDO,
GUI_ACTION_REDO,
// page 2
GUI_ACTION_PAT_PASTE_MIX,
GUI_ACTION_PAT_PASTE_MIX_BG,
0,
0,
GUI_ACTION_PAT_PASTE_FLOOD,
GUI_ACTION_PAT_PASTE_OVERFLOW,
0,
0,
// page 3
0,
GUI_ACTION_WINDOW_FIND,
GUI_ACTION_PAT_COLLAPSE_ROWS,
GUI_ACTION_PAT_EXPAND_ROWS,
GUI_ACTION_PAT_FLIP_SELECTION,
GUI_ACTION_PAT_INVERT_VALUES,
GUI_ACTION_PAT_INTERPOLATE,
0,
// page 4
GUI_ACTION_PAT_FADE,
0,
0,
GUI_ACTION_PAT_SCROLL_MODE,
0,
GUI_ACTION_PAT_LATCH,
GUI_ACTION_PAT_CLEAR_LATCH,
GUI_ACTION_CLEAR
};
const bool mobileButtonPersist[32]={
// page 1
false,
false,
false,
false,
true,
true,
true,
true,
// page 2
false,
false,
false,
false,
false,
false,
false,
false,
// page 3
false,
false,
false,
false,
false,
false,
false,
false,
// page 4
false,
false,
false,
true,
false,
false,
false,
false,
}; };
void FurnaceGUI::drawMobileControls() { void FurnaceGUI::drawMobileControls() {
@ -92,16 +221,19 @@ void FurnaceGUI::drawMobileControls() {
} }
} }
if (curWindowLast==GUI_WINDOW_PATTERN) {
if (mobileEditAnim>0.0f) { if (mobileEditAnim>0.0f) {
ImGui::SetNextWindowPos(ImVec2(0.0f,0.0f)); ImGui::SetNextWindowPos(ImVec2(0.0f,0.0f));
ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH)); ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH));
} else { } else {
ImGui::SetNextWindowPos(ImVec2(mobileEditButtonPos.x*canvasW, mobileEditButtonPos.y*canvasH)); ImGui::SetNextWindowPos(ImVec2((mobileEditButtonPos.x+(portrait?0:(mobileMenuPos*0.65)))*canvasW,(mobileEditButtonPos.y-(portrait?(mobileMenuPos*0.65):0))*canvasH));
ImGui::SetNextWindowSize(portrait?ImVec2(0.16*canvasW,0.16*canvasW):ImVec2(0.16*canvasH,0.16*canvasH)); ImGui::SetNextWindowSize(portrait?ImVec2(0.16*canvasW,0.16*canvasW):ImVec2(0.16*canvasH,0.16*canvasH));
} }
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,ImVec2(0.0f,0.0f)); ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,ImVec2(0.0f,0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding,mobileEditButtonSize.x);
if (ImGui::Begin("MobileEdit",NULL,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground|ImGuiWindowFlags_NoDecoration)) { if (ImGui::Begin("MobileEdit",NULL,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground|ImGuiWindowFlags_NoDecoration)) {
bool mobileEditWas=mobileEdit;
if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && mobileEdit) { if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && mobileEdit) {
mobileEdit=false; mobileEdit=false;
} }
@ -114,6 +246,37 @@ void FurnaceGUI::drawMobileControls() {
int buttonLayout=0; int buttonLayout=0;
ImVec2 scaledButtonPos=ImVec2(
mobileEditButtonPos.x+((mobileEditButtonSize.x*0.5)/(float)canvasW),
mobileEditButtonPos.y+((mobileEditButtonSize.y*0.5)/(float)canvasH)
);
if (scaledButtonPos.x>0.25 &&
scaledButtonPos.x<0.75 &&
scaledButtonPos.y>0.2 &&
scaledButtonPos.y<0.8) {
buttonLayout=0;
} else if (scaledButtonPos.x>0.4 && scaledButtonPos.x<0.6) {
buttonLayout=2;
} else if (scaledButtonPos.y>0.25 && scaledButtonPos.y<0.75) {
buttonLayout=1;
} else {
buttonLayout=3;
}
switch (buttonLayout) {
case 1:
if (mobileEditButtonPos.x>0.5) buttonMirrorX=-1.0f;
break;
case 2:
if (mobileEditButtonPos.y>0.5) buttonMirrorY=-1.0f;
break;
case 3:
if (mobileEditButtonPos.x>0.5) buttonMirrorX=-1.0f;
if (mobileEditButtonPos.y>0.5) buttonMirrorY=-1.0f;
break;
}
for (int i=0; i<8; i++) { for (int i=0; i<8; i++) {
float anim=(mobileEditAnim*1.5)-(float)i*0.05; float anim=(mobileEditAnim*1.5)-(float)i*0.05;
if (anim<0.0f) anim=0.0f; if (anim<0.0f) anim=0.0f;
@ -127,7 +290,14 @@ void FurnaceGUI::drawMobileControls() {
(mobileEditButtonPos.x*canvasW)+cos(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorX*anim, (mobileEditButtonPos.x*canvasW)+cos(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorX*anim,
(mobileEditButtonPos.y*canvasH)+sin(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorY*anim (mobileEditButtonPos.y*canvasH)+sin(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorY*anim
)); ));
ImGui::Button(fmt::sprintf("%d",i+1).c_str(),mobileEditButtonSize); if (ImGui::Button(mobileButtonLabels[i+mobileEditPage*8],mobileEditButtonSize)) {
if (mobileButtonActions[i+mobileEditPage*8]) {
doAction(mobileButtonActions[i+mobileEditPage*8]);
}
if (mobileButtonPersist[i+mobileEditPage*8]) {
if (mobileMenuPos<=0.0) mobileEdit=true;
}
}
curButtonPos++; curButtonPos++;
} }
@ -138,18 +308,22 @@ void FurnaceGUI::drawMobileControls() {
mobileEditButtonSize=ImVec2(avail,avail); mobileEditButtonSize=ImVec2(avail,avail);
} }
if (ImGui::Button("Edit",mobileEditButtonSize)) { if (ImGui::Button(ICON_FA_PENCIL "##Edit",mobileEditButtonSize)) {
// click // click
if (mobileEditWas) {
if (++mobileEditPage>3) mobileEditPage=0;
}
if (ImGui::GetIO().MouseDragMaxDistanceSqr[ImGuiMouseButton_Left]<=ImGui::GetIO().ConfigInertialScrollToleranceSqr) { if (ImGui::GetIO().MouseDragMaxDistanceSqr[ImGuiMouseButton_Left]<=ImGui::GetIO().ConfigInertialScrollToleranceSqr) {
mobileEdit=true; if (mobileMenuPos<=0.0) mobileEdit=true;
} }
} }
if (ImGui::IsItemClicked() && !mobileEdit) { if (ImGui::IsItemClicked() && !mobileEdit && mobileMenuPos<=0.0) {
dragMobileEditButton=true; dragMobileEditButton=true;
} }
} }
ImGui::End(); ImGui::End();
ImGui::PopStyleVar(); ImGui::PopStyleVar(2);
}
ImGui::SetNextWindowPos(portrait?ImVec2(0.0f,((1.0-mobileMenuPos*0.65)*canvasH)-(0.16*canvasW)):ImVec2(0.5*canvasW*mobileMenuPos,0.0f)); ImGui::SetNextWindowPos(portrait?ImVec2(0.0f,((1.0-mobileMenuPos*0.65)*canvasH)-(0.16*canvasW)):ImVec2(0.5*canvasW*mobileMenuPos,0.0f));
ImGui::SetNextWindowSize(portrait?ImVec2(canvasW,0.16*canvasW):ImVec2(0.16*canvasH,canvasH)); ImGui::SetNextWindowSize(portrait?ImVec2(canvasW,0.16*canvasW):ImVec2(0.16*canvasH,canvasH));
@ -446,11 +620,17 @@ void FurnaceGUI::drawEditControls() {
if (ImGui::Button(ICON_FA_PLAY "##Play")) { if (ImGui::Button(ICON_FA_PLAY "##Play")) {
play(); play();
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Play");
}
popToggleColors(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_STOP "##Stop")) { if (ImGui::Button(ICON_FA_STOP "##Stop")) {
stop(); stop();
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Stop");
}
ImGui::SameLine(); ImGui::SameLine();
ImGui::Checkbox("Edit",&edit); ImGui::Checkbox("Edit",&edit);
ImGui::SameLine(); ImGui::SameLine();
@ -474,6 +654,9 @@ void FurnaceGUI::drawEditControls() {
e->stepOne(cursor.y); e->stepOne(cursor.y);
pendingStepUpdate=true; pendingStepUpdate=true;
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Step one row");
}
ImGui::SameLine(); ImGui::SameLine();
pushToggleColors(noteInputPoly); pushToggleColors(noteInputPoly);
@ -481,6 +664,9 @@ void FurnaceGUI::drawEditControls() {
noteInputPoly=!noteInputPoly; noteInputPoly=!noteInputPoly;
e->setAutoNotePoly(noteInputPoly); e->setAutoNotePoly(noteInputPoly);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Polyphony");
}
popToggleColors(); popToggleColors();
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
@ -491,17 +677,26 @@ void FurnaceGUI::drawEditControls() {
if (ImGui::Button(ICON_FA_STOP "##Stop")) { if (ImGui::Button(ICON_FA_STOP "##Stop")) {
stop(); stop();
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Stop");
}
ImGui::SameLine(); ImGui::SameLine();
pushToggleColors(e->isPlaying()); pushToggleColors(e->isPlaying());
if (ImGui::Button(ICON_FA_PLAY "##Play")) { if (ImGui::Button(ICON_FA_PLAY "##Play")) {
play(); play();
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Play");
}
popToggleColors(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) { if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
e->stepOne(cursor.y); e->stepOne(cursor.y);
pendingStepUpdate=true; pendingStepUpdate=true;
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Step one row");
}
ImGui::SameLine(); ImGui::SameLine();
bool repeatPattern=e->getRepeatPattern(); bool repeatPattern=e->getRepeatPattern();
@ -509,6 +704,9 @@ void FurnaceGUI::drawEditControls() {
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) {
e->setRepeatPattern(!repeatPattern); e->setRepeatPattern(!repeatPattern);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Repeat pattern");
}
popToggleColors(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
@ -516,6 +714,9 @@ void FurnaceGUI::drawEditControls() {
if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) { if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) {
edit=!edit; edit=!edit;
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Edit");
}
popToggleColors(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
@ -524,6 +725,9 @@ void FurnaceGUI::drawEditControls() {
if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) { if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) {
e->setMetronome(!metro); e->setMetronome(!metro);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Metronome");
}
popToggleColors(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
@ -566,6 +770,9 @@ void FurnaceGUI::drawEditControls() {
noteInputPoly=!noteInputPoly; noteInputPoly=!noteInputPoly;
e->setAutoNotePoly(noteInputPoly); e->setAutoNotePoly(noteInputPoly);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Polyphony");
}
popToggleColors(); popToggleColors();
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
@ -578,26 +785,41 @@ void FurnaceGUI::drawEditControls() {
if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) { if (ImGui::Button(ICON_FA_PLAY "##Play",buttonSize)) {
play(); play();
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Play");
}
popToggleColors(); popToggleColors();
if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) { if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) {
stop(); stop();
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Stop");
}
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne",buttonSize)) { if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne",buttonSize)) {
e->stepOne(cursor.y); e->stepOne(cursor.y);
pendingStepUpdate=true; pendingStepUpdate=true;
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Step one row");
}
bool repeatPattern=e->getRepeatPattern(); bool repeatPattern=e->getRepeatPattern();
pushToggleColors(repeatPattern); pushToggleColors(repeatPattern);
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) {
e->setRepeatPattern(!repeatPattern); e->setRepeatPattern(!repeatPattern);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Repeat pattern");
}
popToggleColors(); popToggleColors();
pushToggleColors(edit); pushToggleColors(edit);
if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) { if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) {
edit=!edit; edit=!edit;
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Edit");
}
popToggleColors(); popToggleColors();
bool metro=e->getMetronome(); bool metro=e->getMetronome();
@ -605,9 +827,15 @@ void FurnaceGUI::drawEditControls() {
if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) { if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) {
e->setMetronome(!metro); e->setMetronome(!metro);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Metronome");
}
popToggleColors(); popToggleColors();
ImGui::Text("Oct."); ImGui::Text("Oct.");
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Octave");
}
float avail=ImGui::GetContentRegionAvail().x; float avail=ImGui::GetContentRegionAvail().x;
ImGui::SetNextItemWidth(avail); ImGui::SetNextItemWidth(avail);
if (ImGui::InputInt("##Octave",&curOctave,0,0)) { if (ImGui::InputInt("##Octave",&curOctave,0,0)) {
@ -632,15 +860,24 @@ void FurnaceGUI::drawEditControls() {
} }
ImGui::Text("Foll."); ImGui::Text("Foll.");
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Follow");
}
pushToggleColors(followOrders); pushToggleColors(followOrders);
if (ImGui::Button("Ord##FollowOrders",buttonSize)) { handleUnimportant if (ImGui::Button("Ord##FollowOrders",buttonSize)) { handleUnimportant
followOrders=!followOrders; followOrders=!followOrders;
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Orders");
}
popToggleColors(); popToggleColors();
pushToggleColors(followPattern); pushToggleColors(followPattern);
if (ImGui::Button("Pat##FollowPattern",buttonSize)) { handleUnimportant if (ImGui::Button("Pat##FollowPattern",buttonSize)) { handleUnimportant
followPattern=!followPattern; followPattern=!followPattern;
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Pattern");
}
popToggleColors(); popToggleColors();
pushToggleColors(noteInputPoly); pushToggleColors(noteInputPoly);
@ -648,6 +885,9 @@ void FurnaceGUI::drawEditControls() {
noteInputPoly=!noteInputPoly; noteInputPoly=!noteInputPoly;
e->setAutoNotePoly(noteInputPoly); e->setAutoNotePoly(noteInputPoly);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Polyphony");
}
popToggleColors(); popToggleColors();
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
@ -660,33 +900,51 @@ void FurnaceGUI::drawEditControls() {
if (ImGui::Button(ICON_FA_STOP "##Stop")) { if (ImGui::Button(ICON_FA_STOP "##Stop")) {
stop(); stop();
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Stop");
}
popToggleColors(); popToggleColors();
} else { } else {
if (ImGui::Button(ICON_FA_PLAY "##Play")) { if (ImGui::Button(ICON_FA_PLAY "##Play")) {
play(oldRow); play(oldRow);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Play");
}
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_PLAY_CIRCLE "##PlayAgain")) { if (ImGui::Button(ICON_FA_PLAY_CIRCLE "##PlayAgain")) {
e->setRepeatPattern(false); e->setRepeatPattern(false);
play(); play();
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Play from the beginning of this pattern");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_STEP_FORWARD "##PlayRepeat")) { if (ImGui::Button(ICON_FA_STEP_FORWARD "##PlayRepeat")) {
e->setRepeatPattern(true); e->setRepeatPattern(true);
play(); play();
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Repeat from the beginning of this pattern");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) { if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
e->stepOne(cursor.y); e->stepOne(cursor.y);
pendingStepUpdate=true; pendingStepUpdate=true;
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Step one row");
}
ImGui::SameLine(); ImGui::SameLine();
pushToggleColors(edit); pushToggleColors(edit);
if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) { if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) {
edit=!edit; edit=!edit;
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Edit");
}
popToggleColors(); popToggleColors();
bool metro=e->getMetronome(); bool metro=e->getMetronome();
@ -695,6 +953,9 @@ void FurnaceGUI::drawEditControls() {
if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) { if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) {
e->setMetronome(!metro); e->setMetronome(!metro);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Metronome");
}
popToggleColors(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
@ -703,6 +964,9 @@ void FurnaceGUI::drawEditControls() {
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) { if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) {
e->setRepeatPattern(!repeatPattern); e->setRepeatPattern(!repeatPattern);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Repeat pattern");
}
popToggleColors(); popToggleColors();
ImGui::SameLine(); ImGui::SameLine();
@ -711,6 +975,9 @@ void FurnaceGUI::drawEditControls() {
noteInputPoly=!noteInputPoly; noteInputPoly=!noteInputPoly;
e->setAutoNotePoly(noteInputPoly); e->setAutoNotePoly(noteInputPoly);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Polyphony");
}
popToggleColors(); popToggleColors();
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;

View File

@ -1040,13 +1040,13 @@ void FurnaceGUI::noteInput(int num, int key, int vol) {
prepareUndo(GUI_UNDO_PATTERN_EDIT); prepareUndo(GUI_UNDO_PATTERN_EDIT);
if (key==100) { // note off if (key==GUI_NOTE_OFF) { // note off
pat->data[cursor.y][0]=100; pat->data[cursor.y][0]=100;
pat->data[cursor.y][1]=0; pat->data[cursor.y][1]=0;
} else if (key==101) { // note off + env release } else if (key==GUI_NOTE_OFF_RELEASE) { // note off + env release
pat->data[cursor.y][0]=101; pat->data[cursor.y][0]=101;
pat->data[cursor.y][1]=0; pat->data[cursor.y][1]=0;
} else if (key==102) { // env release only } else if (key==GUI_NOTE_RELEASE) { // env release only
pat->data[cursor.y][0]=102; pat->data[cursor.y][0]=102;
pat->data[cursor.y][1]=0; pat->data[cursor.y][1]=0;
} else { } else {
@ -3627,7 +3627,7 @@ bool FurnaceGUI::loop() {
editOptions(true); editOptions(true);
ImGui::Separator(); ImGui::Separator();
if (ImGui::MenuItem("clear...")) { if (ImGui::MenuItem("clear...")) {
showWarning("Are you sure you want to clear... (cannot be undone!)",GUI_WARN_CLEAR); doAction(GUI_ACTION_CLEAR);
} }
ImGui::EndMenu(); ImGui::EndMenu();
} }
@ -3782,7 +3782,6 @@ bool FurnaceGUI::loop() {
globalWinFlags=ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoBringToFrontOnFocus; globalWinFlags=ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoBringToFrontOnFocus;
//globalWinFlags=ImGuiWindowFlags_NoTitleBar; //globalWinFlags=ImGuiWindowFlags_NoTitleBar;
// scene handling goes here! // scene handling goes here!
pianoOpen=true;
drawMobileControls(); drawMobileControls();
switch (mobScene) { switch (mobScene) {
case GUI_SCENE_ORDERS: case GUI_SCENE_ORDERS:
@ -3824,6 +3823,9 @@ bool FurnaceGUI::loop() {
drawPattern(); drawPattern();
drawPiano(); drawPiano();
drawMobileOrderSel(); drawMobileOrderSel();
globalWinFlags=0;
drawFindReplace();
break; break;
} }
@ -5150,7 +5152,11 @@ bool FurnaceGUI::init() {
volMeterOpen=e->getConfBool("volMeterOpen",true); volMeterOpen=e->getConfBool("volMeterOpen",true);
statsOpen=e->getConfBool("statsOpen",false); statsOpen=e->getConfBool("statsOpen",false);
compatFlagsOpen=e->getConfBool("compatFlagsOpen",false); compatFlagsOpen=e->getConfBool("compatFlagsOpen",false);
#ifdef IS_MOBILE
pianoOpen=e->getConfBool("pianoOpen",true);
#else
pianoOpen=e->getConfBool("pianoOpen",false); pianoOpen=e->getConfBool("pianoOpen",false);
#endif
notesOpen=e->getConfBool("notesOpen",false); notesOpen=e->getConfBool("notesOpen",false);
channelsOpen=e->getConfBool("channelsOpen",false); channelsOpen=e->getConfBool("channelsOpen",false);
patManagerOpen=e->getConfBool("patManagerOpen",false); patManagerOpen=e->getConfBool("patManagerOpen",false);
@ -5666,6 +5672,7 @@ FurnaceGUI::FurnaceGUI():
macroPointSize(16), macroPointSize(16),
waveEditStyle(0), waveEditStyle(0),
displayInsTypeListMakeInsSample(-1), displayInsTypeListMakeInsSample(-1),
mobileEditPage(0),
mobileMenuPos(0.0f), mobileMenuPos(0.0f),
autoButtonSize(0.0f), autoButtonSize(0.0f),
mobileEditAnim(0.0f), mobileEditAnim(0.0f),
@ -5979,8 +5986,8 @@ FurnaceGUI::FurnaceGUI():
pianoOptionsSet(false), pianoOptionsSet(false),
pianoOffset(6), pianoOffset(6),
pianoOffsetEdit(9), pianoOffsetEdit(9),
pianoView(2), pianoView(PIANO_LAYOUT_AUTOMATIC),
pianoInputPadMode(2), pianoInputPadMode(PIANO_INPUT_PAD_SPLIT_AUTO),
#else #else
pianoOctaves(7), pianoOctaves(7),
pianoOctavesEdit(4), pianoOctavesEdit(4),
@ -5988,8 +5995,8 @@ FurnaceGUI::FurnaceGUI():
pianoSharePosition(true), pianoSharePosition(true),
pianoOffset(6), pianoOffset(6),
pianoOffsetEdit(6), pianoOffsetEdit(6),
pianoView(0), pianoView(PIANO_LAYOUT_STANDARD),
pianoInputPadMode(0), pianoInputPadMode(PIANO_INPUT_PAD_DISABLE),
#endif #endif
hasACED(false), hasACED(false),
waveGenBaseShape(0), waveGenBaseShape(0),

View File

@ -421,6 +421,7 @@ enum FurnaceGUIActions {
GUI_ACTION_FULLSCREEN, GUI_ACTION_FULLSCREEN,
GUI_ACTION_TX81Z_REQUEST, GUI_ACTION_TX81Z_REQUEST,
GUI_ACTION_PANIC, GUI_ACTION_PANIC,
GUI_ACTION_CLEAR,
GUI_ACTION_WINDOW_EDIT_CONTROLS, GUI_ACTION_WINDOW_EDIT_CONTROLS,
GUI_ACTION_WINDOW_ORDERS, GUI_ACTION_WINDOW_ORDERS,
@ -520,6 +521,8 @@ enum FurnaceGUIActions {
GUI_ACTION_PAT_COLLAPSE_SONG, GUI_ACTION_PAT_COLLAPSE_SONG,
GUI_ACTION_PAT_EXPAND_SONG, GUI_ACTION_PAT_EXPAND_SONG,
GUI_ACTION_PAT_LATCH, GUI_ACTION_PAT_LATCH,
GUI_ACTION_PAT_SCROLL_MODE,
GUI_ACTION_PAT_CLEAR_LATCH,
GUI_ACTION_PAT_MAX, GUI_ACTION_PAT_MAX,
GUI_ACTION_INS_LIST_MIN, GUI_ACTION_INS_LIST_MIN,
@ -653,6 +656,12 @@ enum PasteMode {
GUI_PASTE_MODE_INS_BG GUI_PASTE_MODE_INS_BG
}; };
enum NoteCtrl {
GUI_NOTE_OFF=100,
GUI_NOTE_OFF_RELEASE=101,
GUI_NOTE_RELEASE=102
};
#define FURKMOD_CTRL (1U<<31) #define FURKMOD_CTRL (1U<<31)
#define FURKMOD_SHIFT (1<<29) #define FURKMOD_SHIFT (1<<29)
#define FURKMOD_META (1<<28) #define FURKMOD_META (1<<28)
@ -1096,6 +1105,7 @@ class FurnaceGUI {
int macroPointSize; int macroPointSize;
int waveEditStyle; int waveEditStyle;
int displayInsTypeListMakeInsSample; int displayInsTypeListMakeInsSample;
int mobileEditPage;
float mobileMenuPos, autoButtonSize, mobileEditAnim; float mobileMenuPos, autoButtonSize, mobileEditAnim;
ImVec2 mobileEditButtonPos, mobileEditButtonSize; ImVec2 mobileEditButtonPos, mobileEditButtonSize;
const int* curSysSection; const int* curSysSection;
@ -1677,6 +1687,21 @@ class FurnaceGUI {
bool followLog; bool followLog;
// piano // piano
enum PianoLayoutMode {
PIANO_LAYOUT_STANDARD = 0,
PIANO_LAYOUT_CONTINUOUS,
PIANO_LAYOUT_AUTOMATIC,
PIANO_LAYOUT_MAX
};
enum PianoInputPadMode {
PIANO_INPUT_PAD_DISABLE = 0,
PIANO_INPUT_PAD_REPLACE,
PIANO_INPUT_PAD_SPLIT_AUTO,
PIANO_INPUT_PAD_SPLIT_VISIBLE,
PIANO_INPUT_PAD_MAX
};
int pianoOctaves, pianoOctavesEdit; int pianoOctaves, pianoOctavesEdit;
bool pianoOptions, pianoSharePosition, pianoOptionsSet; bool pianoOptions, pianoSharePosition, pianoOptionsSet;
float pianoKeyHit[180]; float pianoKeyHit[180];

View File

@ -483,6 +483,7 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={
D("FULLSCREEN", "Toggle full-screen", SDLK_F11), D("FULLSCREEN", "Toggle full-screen", SDLK_F11),
D("TX81Z_REQUEST", "Request voice from TX81Z", 0), D("TX81Z_REQUEST", "Request voice from TX81Z", 0),
D("PANIC", "Panic", SDLK_F12), D("PANIC", "Panic", SDLK_F12),
D("CLEAR", "Clear song data", 0),
D("WINDOW_EDIT_CONTROLS", "Edit Controls", 0), D("WINDOW_EDIT_CONTROLS", "Edit Controls", 0),
D("WINDOW_ORDERS", "Orders", 0), D("WINDOW_ORDERS", "Orders", 0),
@ -582,6 +583,8 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={
D("PAT_COLLAPSE_SONG", "Collapse song", 0), D("PAT_COLLAPSE_SONG", "Collapse song", 0),
D("PAT_EXPAND_SONG", "Expand song", 0), D("PAT_EXPAND_SONG", "Expand song", 0),
D("PAT_LATCH", "Set note input latch", 0), D("PAT_LATCH", "Set note input latch", 0),
D("PAT_SCROLL_MODE", "Change mobile scroll mode", 0),
D("PAT_CLEAR_LATCH", "Clear note input latch", 0),
D("PAT_MAX", "", NOT_AN_ACTION), D("PAT_MAX", "", NOT_AN_ACTION),
D("INS_LIST_MIN", "---Instrument list", NOT_AN_ACTION), D("INS_LIST_MIN", "---Instrument list", NOT_AN_ACTION),

View File

@ -2166,10 +2166,16 @@ void FurnaceGUI::drawInsEdit() {
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##IELoad")) { if (ImGui::Button(ICON_FA_FOLDER_OPEN "##IELoad")) {
doAction(GUI_ACTION_INS_LIST_OPEN_REPLACE); doAction(GUI_ACTION_INS_LIST_OPEN_REPLACE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Open");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_FLOPPY_O "##IESave")) { if (ImGui::Button(ICON_FA_FLOPPY_O "##IESave")) {
doAction(GUI_ACTION_INS_LIST_SAVE); doAction(GUI_ACTION_INS_LIST_SAVE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Save");
}
if (ImGui::BeginPopupContextItem("InsSaveFormats",ImGuiMouseButton_Right)) { if (ImGui::BeginPopupContextItem("InsSaveFormats",ImGuiMouseButton_Right)) {
if (ImGui::MenuItem("save in legacy format...")) { if (ImGui::MenuItem("save in legacy format...")) {
doAction(GUI_ACTION_INS_LIST_SAVE_OLD); doAction(GUI_ACTION_INS_LIST_SAVE_OLD);

View File

@ -63,7 +63,7 @@ void FurnaceGUI::drawPiano() {
if (ImGui::BeginTable("PianoLayout",((pianoOptions && (!mobileUI || !portrait))?2:1),ImGuiTableFlags_BordersInnerV)) { if (ImGui::BeginTable("PianoLayout",((pianoOptions && (!mobileUI || !portrait))?2:1),ImGuiTableFlags_BordersInnerV)) {
int& off=(e->isPlaying() || pianoSharePosition)?pianoOffset:pianoOffsetEdit; int& off=(e->isPlaying() || pianoSharePosition)?pianoOffset:pianoOffsetEdit;
int& oct=(e->isPlaying() || pianoSharePosition)?pianoOctaves:pianoOctavesEdit; int& oct=(e->isPlaying() || pianoSharePosition)?pianoOctaves:pianoOctavesEdit;
bool view=(pianoView==2)?(!e->isPlaying()):pianoView; bool view=(pianoView==PIANO_LAYOUT_AUTOMATIC)?(!e->isPlaying()):pianoView;
if (pianoOptions && (!mobileUI || !portrait)) { if (pianoOptions && (!mobileUI || !portrait)) {
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed);
} }
@ -76,11 +76,11 @@ void FurnaceGUI::drawPiano() {
ImVec2 optionSize=ImVec2((mobileUI && portrait)?((ImGui::GetContentRegionAvail().x-ImGui::GetStyle().ItemSpacing.x*5.0f)/6.0f):(1.2f*optionSizeY),optionSizeY); ImVec2 optionSize=ImVec2((mobileUI && portrait)?((ImGui::GetContentRegionAvail().x-ImGui::GetStyle().ItemSpacing.x*5.0f)/6.0f):(1.2f*optionSizeY),optionSizeY);
if (pianoOptionsSet) { if (pianoOptionsSet) {
if (ImGui::Button("OFF##PianoNOff",optionSize)) { if (ImGui::Button("OFF##PianoNOff",optionSize)) {
if (edit) noteInput(0,100); if (edit) noteInput(0,GUI_NOTE_OFF);
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("===##PianoNRel",optionSize)) { if (ImGui::Button("===##PianoNRel",optionSize)) {
if (edit) noteInput(0,101); if (edit) noteInput(0,GUI_NOTE_OFF_RELEASE);
} }
} else { } else {
if (ImGui::Button(ICON_FA_ARROW_LEFT "##PianoLeft",optionSize)) { if (ImGui::Button(ICON_FA_ARROW_LEFT "##PianoLeft",optionSize)) {
@ -95,29 +95,32 @@ void FurnaceGUI::drawPiano() {
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Button(ICON_FA_ELLIPSIS_V "##PianoOptions",optionSize); ImGui::Button(ICON_FA_ELLIPSIS_V "##PianoOptions",optionSize);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Options");
}
if (ImGui::BeginPopupContextItem("PianoOptions",ImGuiPopupFlags_MouseButtonLeft)) { if (ImGui::BeginPopupContextItem("PianoOptions",ImGuiPopupFlags_MouseButtonLeft)) {
ImGui::Text("Key layout:"); ImGui::Text("Key layout:");
if (ImGui::RadioButton("Automatic",pianoView==2)) { if (ImGui::RadioButton("Automatic",pianoView==PIANO_LAYOUT_AUTOMATIC)) {
pianoView=2; pianoView=PIANO_LAYOUT_AUTOMATIC;
} }
if (ImGui::RadioButton("Standard",pianoView==0)) { if (ImGui::RadioButton("Standard",pianoView==PIANO_LAYOUT_STANDARD)) {
pianoView=0; pianoView=PIANO_LAYOUT_STANDARD;
} }
if (ImGui::RadioButton("Continuous",pianoView==1)) { if (ImGui::RadioButton("Continuous",pianoView==PIANO_LAYOUT_CONTINUOUS)) {
pianoView=1; pianoView=PIANO_LAYOUT_CONTINUOUS;
} }
ImGui::Text("Value input pad:"); ImGui::Text("Value input pad:");
if (ImGui::RadioButton("Disabled",pianoInputPadMode==0)) { if (ImGui::RadioButton("Disabled",pianoInputPadMode==PIANO_INPUT_PAD_DISABLE)) {
pianoInputPadMode=0; pianoInputPadMode=PIANO_INPUT_PAD_DISABLE;
} }
if (ImGui::RadioButton("Replace piano",pianoInputPadMode==1)) { if (ImGui::RadioButton("Replace piano",pianoInputPadMode==PIANO_INPUT_PAD_REPLACE)) {
pianoInputPadMode=1; pianoInputPadMode=PIANO_INPUT_PAD_REPLACE;
} }
if (ImGui::RadioButton("Split (automatic)",pianoInputPadMode==2)) { if (ImGui::RadioButton("Split (automatic)",pianoInputPadMode==PIANO_INPUT_PAD_SPLIT_AUTO)) {
pianoInputPadMode=2; pianoInputPadMode=PIANO_INPUT_PAD_SPLIT_AUTO;
} }
if (ImGui::RadioButton("Split (always visible)",pianoInputPadMode==3)) { if (ImGui::RadioButton("Split (always visible)",pianoInputPadMode==PIANO_INPUT_PAD_SPLIT_VISIBLE)) {
pianoInputPadMode=3; pianoInputPadMode=PIANO_INPUT_PAD_SPLIT_VISIBLE;
} }
ImGui::Checkbox("Share play/edit offset/range",&pianoSharePosition); ImGui::Checkbox("Share play/edit offset/range",&pianoSharePosition);
ImGui::EndPopup(); ImGui::EndPopup();
@ -129,7 +132,7 @@ void FurnaceGUI::drawPiano() {
if (pianoOptionsSet) { if (pianoOptionsSet) {
if (ImGui::Button("REL##PianoNMRel",optionSize)) { if (ImGui::Button("REL##PianoNMRel",optionSize)) {
if (edit) noteInput(0,102); if (edit) noteInput(0,GUI_NOTE_RELEASE);
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_TIMES "##PianoDelP",optionSize)) { if (ImGui::Button(ICON_FA_TIMES "##PianoDelP",optionSize)) {
@ -158,7 +161,7 @@ void FurnaceGUI::drawPiano() {
} }
ImGui::TableNextColumn(); ImGui::TableNextColumn();
if (pianoInputPadMode==1 && cursor.xFine>0 && curWindow==GUI_WINDOW_PATTERN) { if (pianoInputPadMode==PIANO_INPUT_PAD_REPLACE && cursor.xFine>0 && curWindow==GUI_WINDOW_PATTERN) {
ImVec2 buttonSize=ImGui::GetContentRegionAvail(); ImVec2 buttonSize=ImGui::GetContentRegionAvail();
if (ImGui::BeginTable("InputPadP",8,ImGuiTableFlags_SizingFixedSame)) { if (ImGui::BeginTable("InputPadP",8,ImGuiTableFlags_SizingFixedSame)) {
ImGui::TableNextRow(); ImGui::TableNextRow();
@ -431,7 +434,7 @@ void FurnaceGUI::drawPiano() {
ImGui::End(); ImGui::End();
// draw input pad if necessary // draw input pad if necessary
if (curWindow==GUI_WINDOW_PATTERN && ((pianoInputPadMode==2 && cursor.xFine>0) || pianoInputPadMode==3)) { if (curWindow==GUI_WINDOW_PATTERN && ((pianoInputPadMode==PIANO_INPUT_PAD_SPLIT_AUTO && cursor.xFine>0) || pianoInputPadMode==PIANO_INPUT_PAD_SPLIT_VISIBLE)) {
if (ImGui::Begin("Input Pad",NULL,ImGuiWindowFlags_NoTitleBar)) { if (ImGui::Begin("Input Pad",NULL,ImGuiWindowFlags_NoTitleBar)) {
ImGui::BeginDisabled(cursor.xFine==0); ImGui::BeginDisabled(cursor.xFine==0);
if (ImGui::BeginTable("InputPad",3,ImGuiTableFlags_Borders)) { if (ImGui::BeginTable("InputPad",3,ImGuiTableFlags_Borders)) {

View File

@ -118,10 +118,16 @@ void FurnaceGUI::drawSampleEdit() {
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##SELoad")) { if (ImGui::Button(ICON_FA_FOLDER_OPEN "##SELoad")) {
doAction(GUI_ACTION_SAMPLE_LIST_OPEN_REPLACE); doAction(GUI_ACTION_SAMPLE_LIST_OPEN_REPLACE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Open");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_FLOPPY_O "##SESave")) { if (ImGui::Button(ICON_FA_FLOPPY_O "##SESave")) {
doAction(GUI_ACTION_SAMPLE_LIST_SAVE); doAction(GUI_ACTION_SAMPLE_LIST_SAVE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Save");
}
ImGui::SameLine(); ImGui::SameLine();

View File

@ -50,10 +50,16 @@ void FurnaceGUI::drawSubSongs() {
if (ImGui::SmallButton(ICON_FA_ARROW_UP "##SubUp")) { if (ImGui::SmallButton(ICON_FA_ARROW_UP "##SubUp")) {
e->moveSubSongUp(i); e->moveSubSongUp(i);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Move up");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::SmallButton(ICON_FA_ARROW_DOWN "##SubDown")) { if (ImGui::SmallButton(ICON_FA_ARROW_DOWN "##SubDown")) {
e->moveSubSongDown(i); e->moveSubSongDown(i);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Move down");
}
ImGui::PopID(); ImGui::PopID();
} }
ImGui::EndTable(); ImGui::EndTable();
@ -79,6 +85,9 @@ void FurnaceGUI::drawSubSongs() {
MARK_MODIFIED; MARK_MODIFIED;
} }
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Add");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_MINUS "##SubSongDel")) { if (ImGui::Button(ICON_FA_MINUS "##SubSongDel")) {
if (e->song.subsong.size()<=1) { if (e->song.subsong.size()<=1) {
@ -87,6 +96,9 @@ void FurnaceGUI::drawSubSongs() {
showWarning("are you sure you want to remove this subsong?",GUI_WARN_SUBSONG_DEL); showWarning("are you sure you want to remove this subsong?",GUI_WARN_SUBSONG_DEL);
} }
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Remove");
}
ImGui::Text("Name"); ImGui::Text("Name");
ImGui::SameLine(); ImGui::SameLine();

View File

@ -241,10 +241,16 @@ void FurnaceGUI::drawWaveEdit() {
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##WELoad")) { if (ImGui::Button(ICON_FA_FOLDER_OPEN "##WELoad")) {
doAction(GUI_ACTION_WAVE_LIST_OPEN_REPLACE); doAction(GUI_ACTION_WAVE_LIST_OPEN_REPLACE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Open");
}
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_FLOPPY_O "##WESave")) { if (ImGui::Button(ICON_FA_FLOPPY_O "##WESave")) {
doAction(GUI_ACTION_WAVE_LIST_SAVE); doAction(GUI_ACTION_WAVE_LIST_SAVE);
} }
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Save");
}
if (ImGui::BeginPopupContextItem("WaveSaveFormats",ImGuiMouseButton_Right)) { if (ImGui::BeginPopupContextItem("WaveSaveFormats",ImGuiMouseButton_Right)) {
if (ImGui::MenuItem("save as .dmw...")) { if (ImGui::MenuItem("save as .dmw...")) {
doAction(GUI_ACTION_WAVE_LIST_SAVE_DMW); doAction(GUI_ACTION_WAVE_LIST_SAVE_DMW);