Merge branch 'master' of https://github.com/tildearrow/furnace
This commit is contained in:
commit
84990c759e
|
@ -3970,6 +3970,7 @@ void ImGui::UpdateMouseMovingWindowNewFrame()
|
|||
{
|
||||
MarkIniSettingsDirty(moving_window);
|
||||
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.
|
||||
{
|
||||
moving_window->Viewport->Pos = pos;
|
||||
|
@ -6025,6 +6026,7 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
|
|||
if (size_target.x != FLT_MAX)
|
||||
{
|
||||
window->SizeFull = size_target;
|
||||
g.InertialScrollInhibited=true;
|
||||
MarkIniSettingsDirty(window);
|
||||
}
|
||||
if (pos_target.x != FLT_MAX)
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "sound/c64_fp/siddefs-fp.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
|
||||
|
||||
|
@ -66,6 +66,16 @@ const char** DivPlatformC64::getRegisterSheet() {
|
|||
void DivPlatformC64::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
int dcOff=isFP?0:sid.get_dc(0);
|
||||
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) {
|
||||
sid_fp.clock(4,&bufL[i]);
|
||||
if (++writeOscBuf>=4) {
|
||||
|
@ -483,6 +493,7 @@ float DivPlatformC64::getPostAmp() {
|
|||
}
|
||||
|
||||
void DivPlatformC64::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
for (int i=0; i<3; i++) {
|
||||
chan[i]=DivPlatformC64::Channel();
|
||||
chan[i].std.setEngine(parent);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define _C64_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include <queue>
|
||||
#include "../macroInt.h"
|
||||
#include "sound/c64/sid.h"
|
||||
#include "sound/c64_fp/SID.h"
|
||||
|
@ -73,6 +74,12 @@ class DivPlatformC64: public DivDispatch {
|
|||
Channel chan[3];
|
||||
DivDispatchOscBuffer* oscBuf[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 writeOscBuf;
|
||||
|
|
|
@ -160,7 +160,7 @@ void DivPlatformSMS::tick(bool sysTick) {
|
|||
if (!chan[i].inPorta) {
|
||||
// TODO: add compatibility flag. this is horrible.
|
||||
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].actualNote=areYouSerious;
|
||||
chan[i].freqChanged=true;
|
||||
|
|
|
@ -47,6 +47,9 @@ void FurnaceGUI::drawInsList(bool asChild) {
|
|||
if (ImGui::Button(ICON_FA_PLUS "##InsAdd")) {
|
||||
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_ADD);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Add");
|
||||
}
|
||||
if (settings.unifiedDataView) {
|
||||
if (ImGui::BeginPopupContextItem("UnifiedAdd",ImGuiMouseButton_Left)) {
|
||||
if (ImGui::MenuItem("instrument")) {
|
||||
|
@ -70,6 +73,9 @@ void FurnaceGUI::drawInsList(bool asChild) {
|
|||
if (ImGui::Button(ICON_FA_FILES_O "##InsClone")) {
|
||||
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_DUPLICATE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Duplicate");
|
||||
}
|
||||
if (settings.unifiedDataView) {
|
||||
if (ImGui::BeginPopupContextItem("UnifiedClone",ImGuiMouseButton_Left)) {
|
||||
if (ImGui::MenuItem("instrument")) {
|
||||
|
@ -88,6 +94,9 @@ void FurnaceGUI::drawInsList(bool asChild) {
|
|||
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##InsLoad")) {
|
||||
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_OPEN);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Open");
|
||||
}
|
||||
if (settings.unifiedDataView) {
|
||||
if (ImGui::BeginPopupContextItem("UnifiedLoad",ImGuiMouseButton_Left)) {
|
||||
if (ImGui::MenuItem("instrument")) {
|
||||
|
@ -127,6 +136,9 @@ void FurnaceGUI::drawInsList(bool asChild) {
|
|||
if (ImGui::Button(ICON_FA_FLOPPY_O "##InsSave")) {
|
||||
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_SAVE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Save");
|
||||
}
|
||||
if (settings.unifiedDataView) {
|
||||
if (ImGui::BeginPopupContextItem("UnifiedSave",ImGuiMouseButton_Left)) {
|
||||
if (ImGui::MenuItem("instrument")) {
|
||||
|
@ -166,15 +178,24 @@ void FurnaceGUI::drawInsList(bool asChild) {
|
|||
if (ImGui::ArrowButton("InsUp",ImGuiDir_Up)) {
|
||||
doAction(GUI_ACTION_INS_LIST_MOVE_UP);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Move up");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::ArrowButton("InsDown",ImGuiDir_Down)) {
|
||||
doAction(GUI_ACTION_INS_LIST_MOVE_DOWN);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Move down");
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_TIMES "##InsDelete")) {
|
||||
if (!settings.unifiedDataView) doAction(GUI_ACTION_INS_LIST_DELETE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Delete");
|
||||
}
|
||||
if (settings.unifiedDataView) {
|
||||
if (ImGui::BeginPopupContextItem("UnifiedDelete",ImGuiMouseButton_Left)) {
|
||||
if (ImGui::MenuItem("instrument")) {
|
||||
|
@ -521,14 +542,23 @@ void FurnaceGUI::drawWaveList(bool asChild) {
|
|||
if (ImGui::Button(ICON_FA_PLUS "##WaveAdd")) {
|
||||
doAction(GUI_ACTION_WAVE_LIST_ADD);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Add");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_FILES_O "##WaveClone")) {
|
||||
doAction(GUI_ACTION_WAVE_LIST_DUPLICATE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Duplicate");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##WaveLoad")) {
|
||||
doAction(GUI_ACTION_WAVE_LIST_OPEN);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Open");
|
||||
}
|
||||
if (ImGui::BeginPopupContextItem("WaveOpenOpt")) {
|
||||
if (ImGui::MenuItem("replace...")) {
|
||||
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")) {
|
||||
doAction(GUI_ACTION_WAVE_LIST_SAVE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Save");
|
||||
}
|
||||
if (!settings.unifiedDataView) {
|
||||
if (ImGui::BeginPopupContextItem("WaveSaveFormats",ImGuiMouseButton_Right)) {
|
||||
if (ImGui::MenuItem("save as .dmw...")) {
|
||||
|
@ -554,14 +587,23 @@ void FurnaceGUI::drawWaveList(bool asChild) {
|
|||
if (ImGui::ArrowButton("WaveUp",ImGuiDir_Up)) {
|
||||
doAction(GUI_ACTION_WAVE_LIST_MOVE_UP);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Move up");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::ArrowButton("WaveDown",ImGuiDir_Down)) {
|
||||
doAction(GUI_ACTION_WAVE_LIST_MOVE_DOWN);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Move down");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_TIMES "##WaveDelete")) {
|
||||
doAction(GUI_ACTION_WAVE_LIST_DELETE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Delete");
|
||||
}
|
||||
ImGui::Separator();
|
||||
if (ImGui::BeginTable("WaveListScroll",1,ImGuiTableFlags_ScrollY)) {
|
||||
actualWaveList();
|
||||
|
@ -598,14 +640,23 @@ void FurnaceGUI::drawSampleList(bool asChild) {
|
|||
if (ImGui::Button(ICON_FA_FILE "##SampleAdd")) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_ADD);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Add");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_FILES_O "##SampleClone")) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_DUPLICATE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Duplicate");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##SampleLoad")) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_OPEN);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Open");
|
||||
}
|
||||
if (ImGui::BeginPopupContextItem("SampleOpenOpt")) {
|
||||
if (ImGui::MenuItem("replace...")) {
|
||||
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")) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_SAVE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Save");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::ArrowButton("SampleUp",ImGuiDir_Up)) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_MOVE_UP);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Move up");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::ArrowButton("SampleDown",ImGuiDir_Down)) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_MOVE_DOWN);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Move down");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_TIMES "##SampleDelete")) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_DELETE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Delete");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_VOLUME_UP "##PreviewSampleL")) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_PREVIEW);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Preview");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_VOLUME_OFF "##StopSampleL")) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_STOP_PREVIEW);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Stop preview");
|
||||
}
|
||||
ImGui::Separator();
|
||||
if (ImGui::BeginTable("SampleListScroll",1,ImGuiTableFlags_ScrollY)) {
|
||||
actualSampleList();
|
||||
|
|
|
@ -174,6 +174,9 @@ void FurnaceGUI::doAction(int what) {
|
|||
case GUI_ACTION_PANIC:
|
||||
e->syncReset();
|
||||
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:
|
||||
nextWindow=GUI_WINDOW_EDIT_CONTROLS;
|
||||
|
@ -554,6 +557,10 @@ void FurnaceGUI::doAction(int what) {
|
|||
break;
|
||||
case GUI_ACTION_PAT_LATCH: // TODO
|
||||
break;
|
||||
case GUI_ACTION_PAT_SCROLL_MODE: // TODO
|
||||
break;
|
||||
case GUI_ACTION_PAT_CLEAR_LATCH: // TODO
|
||||
break;
|
||||
|
||||
case GUI_ACTION_INS_LIST_ADD:
|
||||
curIns=e->addInstrument(cursor.xCoarse);
|
||||
|
|
|
@ -23,17 +23,146 @@
|
|||
|
||||
// 0: all directions
|
||||
// 1: half
|
||||
// 2: quarter
|
||||
float mobileButtonAngles[3][8]={
|
||||
// 2: half
|
||||
// 3: quarter
|
||||
const float mobileButtonAngles[4][8]={
|
||||
{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.75, 0.833333, 0.916667, 0.0, 0.75, 0.833333, 0.916667, 0.0}
|
||||
{0.8333, 0.0, 0.1667, 0.8, 0.9, 0.0, 0.1, 0.2},
|
||||
{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, 2.0, 2.0, 2.0, 2.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},
|
||||
{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() {
|
||||
|
@ -92,64 +221,109 @@ void FurnaceGUI::drawMobileControls() {
|
|||
}
|
||||
}
|
||||
|
||||
if (mobileEditAnim>0.0f) {
|
||||
ImGui::SetNextWindowPos(ImVec2(0.0f,0.0f));
|
||||
ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH));
|
||||
} else {
|
||||
ImGui::SetNextWindowPos(ImVec2(mobileEditButtonPos.x*canvasW, mobileEditButtonPos.y*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));
|
||||
if (ImGui::Begin("MobileEdit",NULL,ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground|ImGuiWindowFlags_NoDecoration)) {
|
||||
if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && mobileEdit) {
|
||||
mobileEdit=false;
|
||||
}
|
||||
|
||||
if (curWindowLast==GUI_WINDOW_PATTERN) {
|
||||
if (mobileEditAnim>0.0f) {
|
||||
int curButtonPos=0;
|
||||
float buttonDir, buttonDist;
|
||||
float buttonMirrorX=1.0f;
|
||||
float buttonMirrorY=1.0f;
|
||||
|
||||
int buttonLayout=0;
|
||||
|
||||
for (int i=0; i<8; i++) {
|
||||
float anim=(mobileEditAnim*1.5)-(float)i*0.05;
|
||||
if (anim<0.0f) anim=0.0f;
|
||||
if (anim>1.0f) anim=1.0f;
|
||||
anim=5*anim-7*pow(anim,2.0f)+3*pow(anim,3.0f);
|
||||
|
||||
buttonDir=mobileButtonAngles[buttonLayout][curButtonPos];
|
||||
buttonDist=mobileButtonDistances[buttonLayout][curButtonPos]*mobileEditButtonSize.x*1.6f;
|
||||
|
||||
ImGui::SetCursorPos(ImVec2(
|
||||
(mobileEditButtonPos.x*canvasW)+cos(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorX*anim,
|
||||
(mobileEditButtonPos.y*canvasH)+sin(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorY*anim
|
||||
));
|
||||
ImGui::Button(fmt::sprintf("%d",i+1).c_str(),mobileEditButtonSize);
|
||||
|
||||
curButtonPos++;
|
||||
}
|
||||
|
||||
ImGui::SetCursorPos(ImVec2(mobileEditButtonPos.x*canvasW,mobileEditButtonPos.y*canvasH));
|
||||
ImGui::SetNextWindowPos(ImVec2(0.0f,0.0f));
|
||||
ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH));
|
||||
} else {
|
||||
float avail=portrait?ImGui::GetContentRegionAvail().y:ImGui::GetContentRegionAvail().x;
|
||||
mobileEditButtonSize=ImVec2(avail,avail);
|
||||
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));
|
||||
}
|
||||
|
||||
if (ImGui::Button("Edit",mobileEditButtonSize)) {
|
||||
// click
|
||||
if (ImGui::GetIO().MouseDragMaxDistanceSqr[ImGuiMouseButton_Left]<=ImGui::GetIO().ConfigInertialScrollToleranceSqr) {
|
||||
mobileEdit=true;
|
||||
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)) {
|
||||
bool mobileEditWas=mobileEdit;
|
||||
if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && mobileEdit) {
|
||||
mobileEdit=false;
|
||||
}
|
||||
|
||||
if (mobileEditAnim>0.0f) {
|
||||
int curButtonPos=0;
|
||||
float buttonDir, buttonDist;
|
||||
float buttonMirrorX=1.0f;
|
||||
float buttonMirrorY=1.0f;
|
||||
|
||||
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++) {
|
||||
float anim=(mobileEditAnim*1.5)-(float)i*0.05;
|
||||
if (anim<0.0f) anim=0.0f;
|
||||
if (anim>1.0f) anim=1.0f;
|
||||
anim=5*anim-7*pow(anim,2.0f)+3*pow(anim,3.0f);
|
||||
|
||||
buttonDir=mobileButtonAngles[buttonLayout][curButtonPos];
|
||||
buttonDist=mobileButtonDistances[buttonLayout][curButtonPos]*mobileEditButtonSize.x*1.6f;
|
||||
|
||||
ImGui::SetCursorPos(ImVec2(
|
||||
(mobileEditButtonPos.x*canvasW)+cos(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorX*anim,
|
||||
(mobileEditButtonPos.y*canvasH)+sin(buttonDir*2.0*M_PI)*buttonDist*buttonMirrorY*anim
|
||||
));
|
||||
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++;
|
||||
}
|
||||
|
||||
ImGui::SetCursorPos(ImVec2(mobileEditButtonPos.x*canvasW,mobileEditButtonPos.y*canvasH));
|
||||
} else {
|
||||
float avail=portrait?ImGui::GetContentRegionAvail().y:ImGui::GetContentRegionAvail().x;
|
||||
mobileEditButtonSize=ImVec2(avail,avail);
|
||||
}
|
||||
|
||||
if (ImGui::Button(ICON_FA_PENCIL "##Edit",mobileEditButtonSize)) {
|
||||
// click
|
||||
if (mobileEditWas) {
|
||||
if (++mobileEditPage>3) mobileEditPage=0;
|
||||
}
|
||||
if (ImGui::GetIO().MouseDragMaxDistanceSqr[ImGuiMouseButton_Left]<=ImGui::GetIO().ConfigInertialScrollToleranceSqr) {
|
||||
if (mobileMenuPos<=0.0) mobileEdit=true;
|
||||
}
|
||||
}
|
||||
if (ImGui::IsItemClicked() && !mobileEdit && mobileMenuPos<=0.0) {
|
||||
dragMobileEditButton=true;
|
||||
}
|
||||
}
|
||||
if (ImGui::IsItemClicked() && !mobileEdit) {
|
||||
dragMobileEditButton=true;
|
||||
}
|
||||
ImGui::End();
|
||||
ImGui::PopStyleVar(2);
|
||||
}
|
||||
ImGui::End();
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
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));
|
||||
|
@ -446,11 +620,17 @@ void FurnaceGUI::drawEditControls() {
|
|||
if (ImGui::Button(ICON_FA_PLAY "##Play")) {
|
||||
play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Play");
|
||||
}
|
||||
popToggleColors();
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_STOP "##Stop")) {
|
||||
stop();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Stop");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Checkbox("Edit",&edit);
|
||||
ImGui::SameLine();
|
||||
|
@ -474,6 +654,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
e->stepOne(cursor.y);
|
||||
pendingStepUpdate=true;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Step one row");
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
pushToggleColors(noteInputPoly);
|
||||
|
@ -481,6 +664,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
noteInputPoly=!noteInputPoly;
|
||||
e->setAutoNotePoly(noteInputPoly);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Polyphony");
|
||||
}
|
||||
popToggleColors();
|
||||
}
|
||||
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
|
||||
|
@ -491,17 +677,26 @@ void FurnaceGUI::drawEditControls() {
|
|||
if (ImGui::Button(ICON_FA_STOP "##Stop")) {
|
||||
stop();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Stop");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
pushToggleColors(e->isPlaying());
|
||||
if (ImGui::Button(ICON_FA_PLAY "##Play")) {
|
||||
play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Play");
|
||||
}
|
||||
popToggleColors();
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
||||
e->stepOne(cursor.y);
|
||||
pendingStepUpdate=true;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Step one row");
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
bool repeatPattern=e->getRepeatPattern();
|
||||
|
@ -509,6 +704,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) {
|
||||
e->setRepeatPattern(!repeatPattern);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Repeat pattern");
|
||||
}
|
||||
popToggleColors();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
@ -516,6 +714,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) {
|
||||
edit=!edit;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Edit");
|
||||
}
|
||||
popToggleColors();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
@ -524,6 +725,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) {
|
||||
e->setMetronome(!metro);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Metronome");
|
||||
}
|
||||
popToggleColors();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
@ -566,6 +770,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
noteInputPoly=!noteInputPoly;
|
||||
e->setAutoNotePoly(noteInputPoly);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Polyphony");
|
||||
}
|
||||
popToggleColors();
|
||||
}
|
||||
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)) {
|
||||
play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Play");
|
||||
}
|
||||
popToggleColors();
|
||||
if (ImGui::Button(ICON_FA_STOP "##Stop",buttonSize)) {
|
||||
stop();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Stop");
|
||||
}
|
||||
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne",buttonSize)) {
|
||||
e->stepOne(cursor.y);
|
||||
pendingStepUpdate=true;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Step one row");
|
||||
}
|
||||
|
||||
bool repeatPattern=e->getRepeatPattern();
|
||||
pushToggleColors(repeatPattern);
|
||||
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern",buttonSize)) {
|
||||
e->setRepeatPattern(!repeatPattern);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Repeat pattern");
|
||||
}
|
||||
popToggleColors();
|
||||
|
||||
pushToggleColors(edit);
|
||||
if (ImGui::Button(ICON_FA_CIRCLE "##Edit",buttonSize)) {
|
||||
edit=!edit;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Edit");
|
||||
}
|
||||
popToggleColors();
|
||||
|
||||
bool metro=e->getMetronome();
|
||||
|
@ -605,9 +827,15 @@ void FurnaceGUI::drawEditControls() {
|
|||
if (ImGui::Button(ICON_FA_BELL_O "##Metronome",buttonSize)) {
|
||||
e->setMetronome(!metro);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Metronome");
|
||||
}
|
||||
popToggleColors();
|
||||
|
||||
ImGui::Text("Oct.");
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Octave");
|
||||
}
|
||||
float avail=ImGui::GetContentRegionAvail().x;
|
||||
ImGui::SetNextItemWidth(avail);
|
||||
if (ImGui::InputInt("##Octave",&curOctave,0,0)) {
|
||||
|
@ -632,15 +860,24 @@ void FurnaceGUI::drawEditControls() {
|
|||
}
|
||||
|
||||
ImGui::Text("Foll.");
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Follow");
|
||||
}
|
||||
pushToggleColors(followOrders);
|
||||
if (ImGui::Button("Ord##FollowOrders",buttonSize)) { handleUnimportant
|
||||
followOrders=!followOrders;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Orders");
|
||||
}
|
||||
popToggleColors();
|
||||
pushToggleColors(followPattern);
|
||||
if (ImGui::Button("Pat##FollowPattern",buttonSize)) { handleUnimportant
|
||||
followPattern=!followPattern;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Pattern");
|
||||
}
|
||||
popToggleColors();
|
||||
|
||||
pushToggleColors(noteInputPoly);
|
||||
|
@ -648,6 +885,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
noteInputPoly=!noteInputPoly;
|
||||
e->setAutoNotePoly(noteInputPoly);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Polyphony");
|
||||
}
|
||||
popToggleColors();
|
||||
}
|
||||
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
|
||||
|
@ -660,33 +900,51 @@ void FurnaceGUI::drawEditControls() {
|
|||
if (ImGui::Button(ICON_FA_STOP "##Stop")) {
|
||||
stop();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Stop");
|
||||
}
|
||||
popToggleColors();
|
||||
} else {
|
||||
if (ImGui::Button(ICON_FA_PLAY "##Play")) {
|
||||
play(oldRow);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Play");
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_PLAY_CIRCLE "##PlayAgain")) {
|
||||
e->setRepeatPattern(false);
|
||||
play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Play from the beginning of this pattern");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_STEP_FORWARD "##PlayRepeat")) {
|
||||
e->setRepeatPattern(true);
|
||||
play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Repeat from the beginning of this pattern");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) {
|
||||
e->stepOne(cursor.y);
|
||||
pendingStepUpdate=true;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Step one row");
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
pushToggleColors(edit);
|
||||
if (ImGui::Button(ICON_FA_CIRCLE "##Edit")) {
|
||||
edit=!edit;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Edit");
|
||||
}
|
||||
popToggleColors();
|
||||
|
||||
bool metro=e->getMetronome();
|
||||
|
@ -695,6 +953,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
if (ImGui::Button(ICON_FA_BELL_O "##Metronome")) {
|
||||
e->setMetronome(!metro);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Metronome");
|
||||
}
|
||||
popToggleColors();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
@ -703,6 +964,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
if (ImGui::Button(ICON_FA_REPEAT "##RepeatPattern")) {
|
||||
e->setRepeatPattern(!repeatPattern);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Repeat pattern");
|
||||
}
|
||||
popToggleColors();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
@ -711,6 +975,9 @@ void FurnaceGUI::drawEditControls() {
|
|||
noteInputPoly=!noteInputPoly;
|
||||
e->setAutoNotePoly(noteInputPoly);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Polyphony");
|
||||
}
|
||||
popToggleColors();
|
||||
}
|
||||
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EDIT_CONTROLS;
|
||||
|
|
|
@ -1040,13 +1040,13 @@ void FurnaceGUI::noteInput(int num, int key, int vol) {
|
|||
|
||||
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][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][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][1]=0;
|
||||
} else {
|
||||
|
@ -3627,7 +3627,7 @@ bool FurnaceGUI::loop() {
|
|||
editOptions(true);
|
||||
ImGui::Separator();
|
||||
if (ImGui::MenuItem("clear...")) {
|
||||
showWarning("Are you sure you want to clear... (cannot be undone!)",GUI_WARN_CLEAR);
|
||||
doAction(GUI_ACTION_CLEAR);
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
@ -3782,7 +3782,6 @@ bool FurnaceGUI::loop() {
|
|||
globalWinFlags=ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoBringToFrontOnFocus;
|
||||
//globalWinFlags=ImGuiWindowFlags_NoTitleBar;
|
||||
// scene handling goes here!
|
||||
pianoOpen=true;
|
||||
drawMobileControls();
|
||||
switch (mobScene) {
|
||||
case GUI_SCENE_ORDERS:
|
||||
|
@ -3824,6 +3823,9 @@ bool FurnaceGUI::loop() {
|
|||
drawPattern();
|
||||
drawPiano();
|
||||
drawMobileOrderSel();
|
||||
|
||||
globalWinFlags=0;
|
||||
drawFindReplace();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -5150,7 +5152,11 @@ bool FurnaceGUI::init() {
|
|||
volMeterOpen=e->getConfBool("volMeterOpen",true);
|
||||
statsOpen=e->getConfBool("statsOpen",false);
|
||||
compatFlagsOpen=e->getConfBool("compatFlagsOpen",false);
|
||||
#ifdef IS_MOBILE
|
||||
pianoOpen=e->getConfBool("pianoOpen",true);
|
||||
#else
|
||||
pianoOpen=e->getConfBool("pianoOpen",false);
|
||||
#endif
|
||||
notesOpen=e->getConfBool("notesOpen",false);
|
||||
channelsOpen=e->getConfBool("channelsOpen",false);
|
||||
patManagerOpen=e->getConfBool("patManagerOpen",false);
|
||||
|
@ -5666,6 +5672,7 @@ FurnaceGUI::FurnaceGUI():
|
|||
macroPointSize(16),
|
||||
waveEditStyle(0),
|
||||
displayInsTypeListMakeInsSample(-1),
|
||||
mobileEditPage(0),
|
||||
mobileMenuPos(0.0f),
|
||||
autoButtonSize(0.0f),
|
||||
mobileEditAnim(0.0f),
|
||||
|
@ -5979,8 +5986,8 @@ FurnaceGUI::FurnaceGUI():
|
|||
pianoOptionsSet(false),
|
||||
pianoOffset(6),
|
||||
pianoOffsetEdit(9),
|
||||
pianoView(2),
|
||||
pianoInputPadMode(2),
|
||||
pianoView(PIANO_LAYOUT_AUTOMATIC),
|
||||
pianoInputPadMode(PIANO_INPUT_PAD_SPLIT_AUTO),
|
||||
#else
|
||||
pianoOctaves(7),
|
||||
pianoOctavesEdit(4),
|
||||
|
@ -5988,8 +5995,8 @@ FurnaceGUI::FurnaceGUI():
|
|||
pianoSharePosition(true),
|
||||
pianoOffset(6),
|
||||
pianoOffsetEdit(6),
|
||||
pianoView(0),
|
||||
pianoInputPadMode(0),
|
||||
pianoView(PIANO_LAYOUT_STANDARD),
|
||||
pianoInputPadMode(PIANO_INPUT_PAD_DISABLE),
|
||||
#endif
|
||||
hasACED(false),
|
||||
waveGenBaseShape(0),
|
||||
|
|
|
@ -421,6 +421,7 @@ enum FurnaceGUIActions {
|
|||
GUI_ACTION_FULLSCREEN,
|
||||
GUI_ACTION_TX81Z_REQUEST,
|
||||
GUI_ACTION_PANIC,
|
||||
GUI_ACTION_CLEAR,
|
||||
|
||||
GUI_ACTION_WINDOW_EDIT_CONTROLS,
|
||||
GUI_ACTION_WINDOW_ORDERS,
|
||||
|
@ -520,6 +521,8 @@ enum FurnaceGUIActions {
|
|||
GUI_ACTION_PAT_COLLAPSE_SONG,
|
||||
GUI_ACTION_PAT_EXPAND_SONG,
|
||||
GUI_ACTION_PAT_LATCH,
|
||||
GUI_ACTION_PAT_SCROLL_MODE,
|
||||
GUI_ACTION_PAT_CLEAR_LATCH,
|
||||
GUI_ACTION_PAT_MAX,
|
||||
|
||||
GUI_ACTION_INS_LIST_MIN,
|
||||
|
@ -653,6 +656,12 @@ enum PasteMode {
|
|||
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_SHIFT (1<<29)
|
||||
#define FURKMOD_META (1<<28)
|
||||
|
@ -1096,6 +1105,7 @@ class FurnaceGUI {
|
|||
int macroPointSize;
|
||||
int waveEditStyle;
|
||||
int displayInsTypeListMakeInsSample;
|
||||
int mobileEditPage;
|
||||
float mobileMenuPos, autoButtonSize, mobileEditAnim;
|
||||
ImVec2 mobileEditButtonPos, mobileEditButtonSize;
|
||||
const int* curSysSection;
|
||||
|
@ -1677,6 +1687,21 @@ class FurnaceGUI {
|
|||
bool followLog;
|
||||
|
||||
// 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;
|
||||
bool pianoOptions, pianoSharePosition, pianoOptionsSet;
|
||||
float pianoKeyHit[180];
|
||||
|
|
|
@ -483,6 +483,7 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={
|
|||
D("FULLSCREEN", "Toggle full-screen", SDLK_F11),
|
||||
D("TX81Z_REQUEST", "Request voice from TX81Z", 0),
|
||||
D("PANIC", "Panic", SDLK_F12),
|
||||
D("CLEAR", "Clear song data", 0),
|
||||
|
||||
D("WINDOW_EDIT_CONTROLS", "Edit Controls", 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_EXPAND_SONG", "Expand song", 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("INS_LIST_MIN", "---Instrument list", NOT_AN_ACTION),
|
||||
|
|
|
@ -2166,10 +2166,16 @@ void FurnaceGUI::drawInsEdit() {
|
|||
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##IELoad")) {
|
||||
doAction(GUI_ACTION_INS_LIST_OPEN_REPLACE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Open");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_FLOPPY_O "##IESave")) {
|
||||
doAction(GUI_ACTION_INS_LIST_SAVE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Save");
|
||||
}
|
||||
if (ImGui::BeginPopupContextItem("InsSaveFormats",ImGuiMouseButton_Right)) {
|
||||
if (ImGui::MenuItem("save in legacy format...")) {
|
||||
doAction(GUI_ACTION_INS_LIST_SAVE_OLD);
|
||||
|
|
|
@ -63,7 +63,7 @@ void FurnaceGUI::drawPiano() {
|
|||
if (ImGui::BeginTable("PianoLayout",((pianoOptions && (!mobileUI || !portrait))?2:1),ImGuiTableFlags_BordersInnerV)) {
|
||||
int& off=(e->isPlaying() || pianoSharePosition)?pianoOffset:pianoOffsetEdit;
|
||||
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)) {
|
||||
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);
|
||||
if (pianoOptionsSet) {
|
||||
if (ImGui::Button("OFF##PianoNOff",optionSize)) {
|
||||
if (edit) noteInput(0,100);
|
||||
if (edit) noteInput(0,GUI_NOTE_OFF);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("===##PianoNRel",optionSize)) {
|
||||
if (edit) noteInput(0,101);
|
||||
if (edit) noteInput(0,GUI_NOTE_OFF_RELEASE);
|
||||
}
|
||||
} else {
|
||||
if (ImGui::Button(ICON_FA_ARROW_LEFT "##PianoLeft",optionSize)) {
|
||||
|
@ -95,29 +95,32 @@ void FurnaceGUI::drawPiano() {
|
|||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Button(ICON_FA_ELLIPSIS_V "##PianoOptions",optionSize);
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Options");
|
||||
}
|
||||
if (ImGui::BeginPopupContextItem("PianoOptions",ImGuiPopupFlags_MouseButtonLeft)) {
|
||||
ImGui::Text("Key layout:");
|
||||
if (ImGui::RadioButton("Automatic",pianoView==2)) {
|
||||
pianoView=2;
|
||||
if (ImGui::RadioButton("Automatic",pianoView==PIANO_LAYOUT_AUTOMATIC)) {
|
||||
pianoView=PIANO_LAYOUT_AUTOMATIC;
|
||||
}
|
||||
if (ImGui::RadioButton("Standard",pianoView==0)) {
|
||||
pianoView=0;
|
||||
if (ImGui::RadioButton("Standard",pianoView==PIANO_LAYOUT_STANDARD)) {
|
||||
pianoView=PIANO_LAYOUT_STANDARD;
|
||||
}
|
||||
if (ImGui::RadioButton("Continuous",pianoView==1)) {
|
||||
pianoView=1;
|
||||
if (ImGui::RadioButton("Continuous",pianoView==PIANO_LAYOUT_CONTINUOUS)) {
|
||||
pianoView=PIANO_LAYOUT_CONTINUOUS;
|
||||
}
|
||||
ImGui::Text("Value input pad:");
|
||||
if (ImGui::RadioButton("Disabled",pianoInputPadMode==0)) {
|
||||
pianoInputPadMode=0;
|
||||
if (ImGui::RadioButton("Disabled",pianoInputPadMode==PIANO_INPUT_PAD_DISABLE)) {
|
||||
pianoInputPadMode=PIANO_INPUT_PAD_DISABLE;
|
||||
}
|
||||
if (ImGui::RadioButton("Replace piano",pianoInputPadMode==1)) {
|
||||
pianoInputPadMode=1;
|
||||
if (ImGui::RadioButton("Replace piano",pianoInputPadMode==PIANO_INPUT_PAD_REPLACE)) {
|
||||
pianoInputPadMode=PIANO_INPUT_PAD_REPLACE;
|
||||
}
|
||||
if (ImGui::RadioButton("Split (automatic)",pianoInputPadMode==2)) {
|
||||
pianoInputPadMode=2;
|
||||
if (ImGui::RadioButton("Split (automatic)",pianoInputPadMode==PIANO_INPUT_PAD_SPLIT_AUTO)) {
|
||||
pianoInputPadMode=PIANO_INPUT_PAD_SPLIT_AUTO;
|
||||
}
|
||||
if (ImGui::RadioButton("Split (always visible)",pianoInputPadMode==3)) {
|
||||
pianoInputPadMode=3;
|
||||
if (ImGui::RadioButton("Split (always visible)",pianoInputPadMode==PIANO_INPUT_PAD_SPLIT_VISIBLE)) {
|
||||
pianoInputPadMode=PIANO_INPUT_PAD_SPLIT_VISIBLE;
|
||||
}
|
||||
ImGui::Checkbox("Share play/edit offset/range",&pianoSharePosition);
|
||||
ImGui::EndPopup();
|
||||
|
@ -129,7 +132,7 @@ void FurnaceGUI::drawPiano() {
|
|||
|
||||
if (pianoOptionsSet) {
|
||||
if (ImGui::Button("REL##PianoNMRel",optionSize)) {
|
||||
if (edit) noteInput(0,102);
|
||||
if (edit) noteInput(0,GUI_NOTE_RELEASE);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_TIMES "##PianoDelP",optionSize)) {
|
||||
|
@ -158,7 +161,7 @@ void FurnaceGUI::drawPiano() {
|
|||
}
|
||||
|
||||
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();
|
||||
if (ImGui::BeginTable("InputPadP",8,ImGuiTableFlags_SizingFixedSame)) {
|
||||
ImGui::TableNextRow();
|
||||
|
@ -431,7 +434,7 @@ void FurnaceGUI::drawPiano() {
|
|||
ImGui::End();
|
||||
|
||||
// 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)) {
|
||||
ImGui::BeginDisabled(cursor.xFine==0);
|
||||
if (ImGui::BeginTable("InputPad",3,ImGuiTableFlags_Borders)) {
|
||||
|
|
|
@ -118,10 +118,16 @@ void FurnaceGUI::drawSampleEdit() {
|
|||
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##SELoad")) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_OPEN_REPLACE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Open");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_FLOPPY_O "##SESave")) {
|
||||
doAction(GUI_ACTION_SAMPLE_LIST_SAVE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Save");
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
|
|
|
@ -50,10 +50,16 @@ void FurnaceGUI::drawSubSongs() {
|
|||
if (ImGui::SmallButton(ICON_FA_ARROW_UP "##SubUp")) {
|
||||
e->moveSubSongUp(i);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Move up");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::SmallButton(ICON_FA_ARROW_DOWN "##SubDown")) {
|
||||
e->moveSubSongDown(i);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Move down");
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
ImGui::EndTable();
|
||||
|
@ -79,6 +85,9 @@ void FurnaceGUI::drawSubSongs() {
|
|||
MARK_MODIFIED;
|
||||
}
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Add");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_MINUS "##SubSongDel")) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Remove");
|
||||
}
|
||||
|
||||
ImGui::Text("Name");
|
||||
ImGui::SameLine();
|
||||
|
|
|
@ -241,10 +241,16 @@ void FurnaceGUI::drawWaveEdit() {
|
|||
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##WELoad")) {
|
||||
doAction(GUI_ACTION_WAVE_LIST_OPEN_REPLACE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Open");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_FLOPPY_O "##WESave")) {
|
||||
doAction(GUI_ACTION_WAVE_LIST_SAVE);
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Save");
|
||||
}
|
||||
if (ImGui::BeginPopupContextItem("WaveSaveFormats",ImGuiMouseButton_Right)) {
|
||||
if (ImGui::MenuItem("save as .dmw...")) {
|
||||
doAction(GUI_ACTION_WAVE_LIST_SAVE_DMW);
|
||||
|
|
Loading…
Reference in New Issue