prepare for Furnace Pro
This commit is contained in:
parent
fe7ba3c56b
commit
6fe8bea50e
17 changed files with 693 additions and 167 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#include "imgui.h"
|
||||
#include "misc/cpp/imgui_stdlib.h"
|
||||
#include "intConst.h"
|
||||
#include "../ta-log.h"
|
||||
|
||||
void FurnaceGUI::drawSpeed(bool asChild) {
|
||||
if (nextWindow==GUI_WINDOW_SPEED) {
|
||||
|
|
@ -72,144 +73,148 @@ void FurnaceGUI::drawSpeed(bool asChild) {
|
|||
}
|
||||
}
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
if (keepGrooveAlive || e->curSubSong->speeds.len>2) {
|
||||
if (ImGui::SmallButton("Groove")) {
|
||||
e->lockEngine([this]() {
|
||||
e->curSubSong->speeds.len=1;
|
||||
});
|
||||
if (e->isPlaying()) play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("click for one speed");
|
||||
}
|
||||
} else if (e->curSubSong->speeds.len>1) {
|
||||
if (ImGui::SmallButton("Speeds")) {
|
||||
e->lockEngine([this]() {
|
||||
e->curSubSong->speeds.len=4;
|
||||
e->curSubSong->speeds.val[2]=e->curSubSong->speeds.val[0];
|
||||
e->curSubSong->speeds.val[3]=e->curSubSong->speeds.val[1];
|
||||
});
|
||||
if (e->isPlaying()) play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("click for groove pattern");
|
||||
}
|
||||
if (dejarteArriba) {
|
||||
ImGui::TextWrapped("UNREGISTERED\nRegister to unlock all Speed settings.");
|
||||
} else {
|
||||
if (ImGui::SmallButton("Speed")) {
|
||||
e->lockEngine([this]() {
|
||||
e->curSubSong->speeds.len=2;
|
||||
e->curSubSong->speeds.val[1]=e->curSubSong->speeds.val[0];
|
||||
});
|
||||
if (e->isPlaying()) play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("click for two (alternating) speeds");
|
||||
}
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
if (keepGrooveAlive || e->curSubSong->speeds.len>2) {
|
||||
int intVersion[256];
|
||||
unsigned char intVersionLen=e->curSubSong->speeds.len;
|
||||
unsigned char ignoredLoop=0;
|
||||
unsigned char ignoredRel=0;
|
||||
memset(intVersion,0,sizeof(int));
|
||||
for (int i=0; i<16; i++) {
|
||||
intVersion[i]=e->curSubSong->speeds.val[i];
|
||||
}
|
||||
if (intVersionLen>16) intVersionLen=16;
|
||||
|
||||
keepGrooveAlive=false;
|
||||
|
||||
ImGui::SetNextItemWidth(avail);
|
||||
if (ImGui::InputText("##SpeedG",&grooveString)) {
|
||||
decodeMMLStr(grooveString,intVersion,intVersionLen,ignoredLoop,1,255,ignoredRel);
|
||||
if (intVersionLen<1) {
|
||||
intVersionLen=1;
|
||||
intVersion[0]=6;
|
||||
}
|
||||
if (intVersionLen>16) intVersionLen=16;
|
||||
e->lockEngine([this,intVersion,intVersionLen]() {
|
||||
e->curSubSong->speeds.len=intVersionLen;
|
||||
for (int i=0; i<16; i++) {
|
||||
e->curSubSong->speeds.val[i]=intVersion[i];
|
||||
}
|
||||
});
|
||||
if (e->isPlaying()) play();
|
||||
MARK_MODIFIED;
|
||||
}
|
||||
if (!ImGui::IsItemActive()) {
|
||||
encodeMMLStr(grooveString,intVersion,intVersionLen,-1,-1,false);
|
||||
} else {
|
||||
keepGrooveAlive=true;
|
||||
}
|
||||
} else {
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##Speed1",ImGuiDataType_U8,&e->curSubSong->speeds.val[0],&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (e->curSubSong->speeds.val[0]<1) e->curSubSong->speeds.val[0]=1;
|
||||
if (e->isPlaying()) play();
|
||||
}
|
||||
if (e->curSubSong->speeds.len>1) {
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##Speed2",ImGuiDataType_U8,&e->curSubSong->speeds.val[1],&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (e->curSubSong->speeds.val[1]<1) e->curSubSong->speeds.val[1]=1;
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
if (keepGrooveAlive || e->curSubSong->speeds.len>2) {
|
||||
if (ImGui::SmallButton("Groove")) {
|
||||
e->lockEngine([this]() {
|
||||
e->curSubSong->speeds.len=1;
|
||||
});
|
||||
if (e->isPlaying()) play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("click for one speed");
|
||||
}
|
||||
} else if (e->curSubSong->speeds.len>1) {
|
||||
if (ImGui::SmallButton("Speeds")) {
|
||||
e->lockEngine([this]() {
|
||||
e->curSubSong->speeds.len=4;
|
||||
e->curSubSong->speeds.val[2]=e->curSubSong->speeds.val[0];
|
||||
e->curSubSong->speeds.val[3]=e->curSubSong->speeds.val[1];
|
||||
});
|
||||
if (e->isPlaying()) play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("click for groove pattern");
|
||||
}
|
||||
} else {
|
||||
if (ImGui::SmallButton("Speed")) {
|
||||
e->lockEngine([this]() {
|
||||
e->curSubSong->speeds.len=2;
|
||||
e->curSubSong->speeds.val[1]=e->curSubSong->speeds.val[0];
|
||||
});
|
||||
if (e->isPlaying()) play();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("click for two (alternating) speeds");
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
if (keepGrooveAlive || e->curSubSong->speeds.len>2) {
|
||||
int intVersion[256];
|
||||
unsigned char intVersionLen=e->curSubSong->speeds.len;
|
||||
unsigned char ignoredLoop=0;
|
||||
unsigned char ignoredRel=0;
|
||||
memset(intVersion,0,sizeof(int));
|
||||
for (int i=0; i<16; i++) {
|
||||
intVersion[i]=e->curSubSong->speeds.val[i];
|
||||
}
|
||||
if (intVersionLen>16) intVersionLen=16;
|
||||
|
||||
if (!basicMode) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("Virtual Tempo");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##VTempoN",ImGuiDataType_S16,&e->curSubSong->virtualTempoN,&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (e->curSubSong->virtualTempoN<1) e->curSubSong->virtualTempoN=1;
|
||||
if (e->curSubSong->virtualTempoN>255) e->curSubSong->virtualTempoN=255;
|
||||
keepGrooveAlive=false;
|
||||
|
||||
ImGui::SetNextItemWidth(avail);
|
||||
if (ImGui::InputText("##SpeedG",&grooveString)) {
|
||||
decodeMMLStr(grooveString,intVersion,intVersionLen,ignoredLoop,1,255,ignoredRel);
|
||||
if (intVersionLen<1) {
|
||||
intVersionLen=1;
|
||||
intVersion[0]=6;
|
||||
}
|
||||
if (intVersionLen>16) intVersionLen=16;
|
||||
e->lockEngine([this,intVersion,intVersionLen]() {
|
||||
e->curSubSong->speeds.len=intVersionLen;
|
||||
for (int i=0; i<16; i++) {
|
||||
e->curSubSong->speeds.val[i]=intVersion[i];
|
||||
}
|
||||
});
|
||||
if (e->isPlaying()) play();
|
||||
MARK_MODIFIED;
|
||||
}
|
||||
if (!ImGui::IsItemActive()) {
|
||||
encodeMMLStr(grooveString,intVersion,intVersionLen,-1,-1,false);
|
||||
} else {
|
||||
keepGrooveAlive=true;
|
||||
}
|
||||
} else {
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##Speed1",ImGuiDataType_U8,&e->curSubSong->speeds.val[0],&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (e->curSubSong->speeds.val[0]<1) e->curSubSong->speeds.val[0]=1;
|
||||
if (e->isPlaying()) play();
|
||||
}
|
||||
if (e->curSubSong->speeds.len>1) {
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##Speed2",ImGuiDataType_U8,&e->curSubSong->speeds.val[1],&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (e->curSubSong->speeds.val[1]<1) e->curSubSong->speeds.val[1]=1;
|
||||
if (e->isPlaying()) play();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Numerator");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##VTempoD",ImGuiDataType_S16,&e->curSubSong->virtualTempoD,&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (e->curSubSong->virtualTempoD<1) e->curSubSong->virtualTempoD=1;
|
||||
if (e->curSubSong->virtualTempoD>255) e->curSubSong->virtualTempoD=255;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Denominator (set to base tempo)");
|
||||
|
||||
if (!basicMode) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("Virtual Tempo");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##VTempoN",ImGuiDataType_S16,&e->curSubSong->virtualTempoN,&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (e->curSubSong->virtualTempoN<1) e->curSubSong->virtualTempoN=1;
|
||||
if (e->curSubSong->virtualTempoN>255) e->curSubSong->virtualTempoN=255;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Numerator");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##VTempoD",ImGuiDataType_S16,&e->curSubSong->virtualTempoD,&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (e->curSubSong->virtualTempoD<1) e->curSubSong->virtualTempoD=1;
|
||||
if (e->curSubSong->virtualTempoD>255) e->curSubSong->virtualTempoD=255;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Denominator (set to base tempo)");
|
||||
}
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("Divider");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
unsigned char realTB=e->curSubSong->timeBase+1;
|
||||
if (ImGui::InputScalar("##TimeBase",ImGuiDataType_U8,&realTB,&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (realTB<1) realTB=1;
|
||||
if (realTB>16) realTB=16;
|
||||
e->curSubSong->timeBase=realTB-1;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("%.2f BPM",calcBPM(e->curSubSong->speeds,e->curSubSong->hz,e->curSubSong->virtualTempoN,e->curSubSong->virtualTempoD));
|
||||
}
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("Divider");
|
||||
ImGui::Text("Highlight");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
unsigned char realTB=e->curSubSong->timeBase+1;
|
||||
if (ImGui::InputScalar("##TimeBase",ImGuiDataType_U8,&realTB,&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
if (realTB<1) realTB=1;
|
||||
if (realTB>16) realTB=16;
|
||||
e->curSubSong->timeBase=realTB-1;
|
||||
if (ImGui::InputScalar("##Highlight1",ImGuiDataType_U8,&e->curSubSong->hilightA,&_ONE,&_THREE)) {
|
||||
MARK_MODIFIED;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("%.2f BPM",calcBPM(e->curSubSong->speeds,e->curSubSong->hz,e->curSubSong->virtualTempoN,e->curSubSong->virtualTempoD));
|
||||
}
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("Highlight");
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##Highlight1",ImGuiDataType_U8,&e->curSubSong->hilightA,&_ONE,&_THREE)) {
|
||||
MARK_MODIFIED;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##Highlight2",ImGuiDataType_U8,&e->curSubSong->hilightB,&_ONE,&_THREE)) {
|
||||
MARK_MODIFIED;
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
if (ImGui::InputScalar("##Highlight2",ImGuiDataType_U8,&e->curSubSong->hilightB,&_ONE,&_THREE)) {
|
||||
MARK_MODIFIED;
|
||||
}
|
||||
}
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue