Merge pull request #371 from BlastBrothers/compact-wave-editor
Compact wave editor
This commit is contained in:
commit
c171f3255a
|
@ -825,6 +825,7 @@ class FurnaceGUI {
|
||||||
int loadJapanese;
|
int loadJapanese;
|
||||||
int fmLayout;
|
int fmLayout;
|
||||||
int sampleLayout;
|
int sampleLayout;
|
||||||
|
int waveLayout;
|
||||||
int susPosition;
|
int susPosition;
|
||||||
int effectCursorDir;
|
int effectCursorDir;
|
||||||
int cursorPastePos;
|
int cursorPastePos;
|
||||||
|
@ -903,6 +904,7 @@ class FurnaceGUI {
|
||||||
loadJapanese(0),
|
loadJapanese(0),
|
||||||
fmLayout(0),
|
fmLayout(0),
|
||||||
sampleLayout(0),
|
sampleLayout(0),
|
||||||
|
waveLayout(0),
|
||||||
susPosition(0),
|
susPosition(0),
|
||||||
effectCursorDir(1),
|
effectCursorDir(1),
|
||||||
cursorPastePos(1),
|
cursorPastePos(1),
|
||||||
|
|
|
@ -990,6 +990,11 @@ void FurnaceGUI::drawSettings() {
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
|
bool waveLayoutB=settings.waveLayout;
|
||||||
|
if (ImGui::Checkbox("Use compact wave editor",&waveLayoutB)) {
|
||||||
|
settings.waveLayout=waveLayoutB;
|
||||||
|
}
|
||||||
|
|
||||||
bool sampleLayoutB=settings.sampleLayout;
|
bool sampleLayoutB=settings.sampleLayout;
|
||||||
if (ImGui::Checkbox("Use compact sample editor",&sampleLayoutB)) {
|
if (ImGui::Checkbox("Use compact sample editor",&sampleLayoutB)) {
|
||||||
settings.sampleLayout=sampleLayoutB;
|
settings.sampleLayout=sampleLayoutB;
|
||||||
|
@ -1656,6 +1661,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
settings.loadJapanese=e->getConfInt("loadJapanese",0);
|
settings.loadJapanese=e->getConfInt("loadJapanese",0);
|
||||||
settings.fmLayout=e->getConfInt("fmLayout",0);
|
settings.fmLayout=e->getConfInt("fmLayout",0);
|
||||||
settings.sampleLayout=e->getConfInt("sampleLayout",0);
|
settings.sampleLayout=e->getConfInt("sampleLayout",0);
|
||||||
|
settings.waveLayout=e->getConfInt("waveLayout",0);
|
||||||
settings.susPosition=e->getConfInt("susPosition",0);
|
settings.susPosition=e->getConfInt("susPosition",0);
|
||||||
settings.effectCursorDir=e->getConfInt("effectCursorDir",1);
|
settings.effectCursorDir=e->getConfInt("effectCursorDir",1);
|
||||||
settings.cursorPastePos=e->getConfInt("cursorPastePos",1);
|
settings.cursorPastePos=e->getConfInt("cursorPastePos",1);
|
||||||
|
@ -1733,6 +1739,7 @@ void FurnaceGUI::syncSettings() {
|
||||||
clampSetting(settings.frameBorders,0,1);
|
clampSetting(settings.frameBorders,0,1);
|
||||||
clampSetting(settings.effectDeletionAltersValue,0,1);
|
clampSetting(settings.effectDeletionAltersValue,0,1);
|
||||||
clampSetting(settings.sampleLayout,0,1);
|
clampSetting(settings.sampleLayout,0,1);
|
||||||
|
clampSetting(settings.waveLayout,0,1);
|
||||||
clampSetting(settings.separateFMColors,0,1);
|
clampSetting(settings.separateFMColors,0,1);
|
||||||
clampSetting(settings.insEditColorize,0,1);
|
clampSetting(settings.insEditColorize,0,1);
|
||||||
clampSetting(settings.metroVol,0,200);
|
clampSetting(settings.metroVol,0,200);
|
||||||
|
@ -1817,6 +1824,7 @@ void FurnaceGUI::commitSettings() {
|
||||||
e->setConf("loadJapanese",settings.loadJapanese);
|
e->setConf("loadJapanese",settings.loadJapanese);
|
||||||
e->setConf("fmLayout",settings.fmLayout);
|
e->setConf("fmLayout",settings.fmLayout);
|
||||||
e->setConf("sampleLayout",settings.sampleLayout);
|
e->setConf("sampleLayout",settings.sampleLayout);
|
||||||
|
e->setConf("waveLayout",settings.waveLayout);
|
||||||
e->setConf("susPosition",settings.susPosition);
|
e->setConf("susPosition",settings.susPosition);
|
||||||
e->setConf("effectCursorDir",settings.effectCursorDir);
|
e->setConf("effectCursorDir",settings.effectCursorDir);
|
||||||
e->setConf("cursorPastePos",settings.cursorPastePos);
|
e->setConf("cursorPastePos",settings.cursorPastePos);
|
||||||
|
|
|
@ -31,7 +31,7 @@ void FurnaceGUI::drawWaveEdit() {
|
||||||
}
|
}
|
||||||
if (!waveEditOpen) return;
|
if (!waveEditOpen) return;
|
||||||
float wavePreview[256];
|
float wavePreview[256];
|
||||||
ImGui::SetNextWindowSizeConstraints(ImVec2(450.0f*dpiScale,300.0f*dpiScale),ImVec2(scrW*dpiScale,scrH*dpiScale));
|
ImGui::SetNextWindowSizeConstraints(ImVec2(300.0f*dpiScale,300.0f*dpiScale),ImVec2(scrW*dpiScale,scrH*dpiScale));
|
||||||
if (ImGui::Begin("Wavetable Editor",&waveEditOpen,settings.allowEditDocking?0:ImGuiWindowFlags_NoDocking)) {
|
if (ImGui::Begin("Wavetable Editor",&waveEditOpen,settings.allowEditDocking?0:ImGuiWindowFlags_NoDocking)) {
|
||||||
if (curWave<0 || curWave>=(int)e->song.wave.size()) {
|
if (curWave<0 || curWave>=(int)e->song.wave.size()) {
|
||||||
ImGui::Text("no wavetable selected");
|
ImGui::Text("no wavetable selected");
|
||||||
|
@ -53,31 +53,34 @@ void FurnaceGUI::drawWaveEdit() {
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
||||||
DivWavetable* wave=e->song.wave[curWave];
|
DivWavetable* wave=e->song.wave[curWave];
|
||||||
ImGui::Text("Width");
|
|
||||||
if (ImGui::IsItemHovered()) {
|
if (!settings.waveLayout){
|
||||||
ImGui::SetTooltip("use a width of:\n- any on Amiga/N163\n- 32 on Game Boy, PC Engine and WonderSwan\n- 64 on FDS\n- 128 on X1-010\nany other widths will be scaled during playback.");
|
ImGui::Text("Width");
|
||||||
}
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::SameLine();
|
ImGui::SetTooltip("use a width of:\n- any on Amiga/N163\n- 32 on Game Boy, PC Engine and WonderSwan\n- 64 on FDS\n- 128 on X1-010\nany other widths will be scaled during playback.");
|
||||||
ImGui::SetNextItemWidth(128.0f*dpiScale);
|
}
|
||||||
if (ImGui::InputInt("##_WTW",&wave->len,1,2)) {
|
ImGui::SameLine();
|
||||||
if (wave->len>256) wave->len=256;
|
ImGui::SetNextItemWidth(128.0f*dpiScale);
|
||||||
if (wave->len<1) wave->len=1;
|
if (ImGui::InputInt("##_WTW",&wave->len,1,2)) {
|
||||||
e->notifyWaveChange(curWave);
|
if (wave->len>256) wave->len=256;
|
||||||
if (wavePreviewOn) e->previewWave(curWave,wavePreviewNote);
|
if (wave->len<1) wave->len=1;
|
||||||
MARK_MODIFIED;
|
e->notifyWaveChange(curWave);
|
||||||
}
|
if (wavePreviewOn) e->previewWave(curWave,wavePreviewNote);
|
||||||
ImGui::SameLine();
|
MARK_MODIFIED;
|
||||||
ImGui::Text("Height");
|
}
|
||||||
if (ImGui::IsItemHovered()) {
|
ImGui::SameLine();
|
||||||
ImGui::SetTooltip("use a height of:\n- 15 for Game Boy, WonderSwan, X1-010 Envelope shape and N163\n- 31 for PC Engine\n- 63 for FDS\n- 255 for X1-010\nany other heights will be scaled during playback.");
|
ImGui::Text("Height");
|
||||||
}
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::SameLine();
|
ImGui::SetTooltip("use a height of:\n- 15 for Game Boy, WonderSwan, X1-010 Envelope shape and N163\n- 31 for PC Engine\n- 63 for FDS\n- 255 for X1-010\nany other heights will be scaled during playback.");
|
||||||
ImGui::SetNextItemWidth(128.0f*dpiScale);
|
}
|
||||||
if (ImGui::InputInt("##_WTH",&wave->max,1,2)) {
|
ImGui::SameLine();
|
||||||
if (wave->max>255) wave->max=255;
|
ImGui::SetNextItemWidth(128.0f*dpiScale);
|
||||||
if (wave->max<1) wave->max=1;
|
if (ImGui::InputInt("##_WTH",&wave->max,1,2)) {
|
||||||
e->notifyWaveChange(curWave);
|
if (wave->max>255) wave->max=255;
|
||||||
MARK_MODIFIED;
|
if (wave->max<1) wave->max=1;
|
||||||
|
e->notifyWaveChange(curWave);
|
||||||
|
MARK_MODIFIED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::RadioButton("Dec",!waveHex)) {
|
if (ImGui::RadioButton("Dec",!waveHex)) {
|
||||||
|
@ -87,6 +90,42 @@ void FurnaceGUI::drawWaveEdit() {
|
||||||
if (ImGui::RadioButton("Hex",waveHex)) {
|
if (ImGui::RadioButton("Hex",waveHex)) {
|
||||||
waveHex=true;
|
waveHex=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings.waveLayout){
|
||||||
|
if (ImGui::BeginTable("WaveProps",2,ImGuiTableFlags_SizingStretchSame)) {
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::Text("Width");
|
||||||
|
if (ImGui::IsItemHovered()) {
|
||||||
|
ImGui::SetTooltip("use a width of:\n- any on Amiga/N163\n- 32 on Game Boy, PC Engine and WonderSwan\n- 64 on FDS\n- 128 on X1-010\nany other widths will be scaled during playback.");
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
|
if (ImGui::InputInt("##_WTW",&wave->len,1,2)) {
|
||||||
|
if (wave->len>256) wave->len=256;
|
||||||
|
if (wave->len<1) wave->len=1;
|
||||||
|
e->notifyWaveChange(curWave);
|
||||||
|
if (wavePreviewOn) e->previewWave(curWave,wavePreviewNote);
|
||||||
|
MARK_MODIFIED;
|
||||||
|
}
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Text("Height");
|
||||||
|
if (ImGui::IsItemHovered()) {
|
||||||
|
ImGui::SetTooltip("use a height of:\n- 15 for Game Boy, WonderSwan, X1-010 Envelope shape and N163\n- 31 for PC Engine\n- 63 for FDS\n- 255 for X1-010\nany other heights will be scaled during playback.");
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
|
if (ImGui::InputInt("##_WTH",&wave->max,1,2)) {
|
||||||
|
if (wave->max>255) wave->max=255;
|
||||||
|
if (wave->max<1) wave->max=1;
|
||||||
|
e->notifyWaveChange(curWave);
|
||||||
|
MARK_MODIFIED;
|
||||||
|
}
|
||||||
|
ImGui::EndTable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0; i<wave->len; i++) {
|
for (int i=0; i<wave->len; i++) {
|
||||||
if (wave->data[i]>wave->max) wave->data[i]=wave->max;
|
if (wave->data[i]>wave->max) wave->data[i]=wave->max;
|
||||||
wavePreview[i]=wave->data[i];
|
wavePreview[i]=wave->data[i];
|
||||||
|
|
Loading…
Reference in New Issue