GUI: add ability to view Hz as base tempo

This commit is contained in:
tildearrow 2022-03-15 23:43:24 -05:00
parent 02e9edbad9
commit 790c4345d9
2 changed files with 7 additions and 3 deletions

View file

@ -1084,11 +1084,14 @@ void FurnaceGUI::drawSongInfo() {
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::Text("Tick Rate"); if (ImGui::Selectable(tempoView?"Base Tempo##TempoOrHz":"Tick Rate##TempoOrHz")) {
tempoView=!tempoView;
}
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::SetNextItemWidth(avail); ImGui::SetNextItemWidth(avail);
float setHz=e->song.hz; float setHz=tempoView?e->song.hz*2.5:e->song.hz;
if (ImGui::InputFloat("##Rate",&setHz,1.0f,1.0f,"%g")) { if (ImGui::InputFloat("##Rate",&setHz,1.0f,1.0f,"%g")) {
if (tempoView) setHz/=2.5;
if (setHz<10) setHz=10; if (setHz<10) setHz=10;
if (setHz>999) setHz=999; if (setHz>999) setHz=999;
e->setSongRate(setHz,setHz<52); e->setSongRate(setHz,setHz<52);
@ -7105,6 +7108,7 @@ FurnaceGUI::FurnaceGUI():
fancyPattern(false), fancyPattern(false),
wantPatName(false), wantPatName(false),
firstFrame(true), firstFrame(true),
tempoView(false),
curWindow(GUI_WINDOW_NOTHING), curWindow(GUI_WINDOW_NOTHING),
nextWindow(GUI_WINDOW_NOTHING), nextWindow(GUI_WINDOW_NOTHING),
nextDesc(NULL), nextDesc(NULL),

View file

@ -604,7 +604,7 @@ class FurnaceGUI {
bool pianoOpen, notesOpen, channelsOpen, regViewOpen; bool pianoOpen, notesOpen, channelsOpen, regViewOpen;
SelectionPoint selStart, selEnd, cursor; SelectionPoint selStart, selEnd, cursor;
bool selecting, curNibble, orderNibble, followOrders, followPattern, changeAllOrders; bool selecting, curNibble, orderNibble, followOrders, followPattern, changeAllOrders;
bool collapseWindow, demandScrollX, fancyPattern, wantPatName, firstFrame; bool collapseWindow, demandScrollX, fancyPattern, wantPatName, firstFrame, tempoView;
FurnaceGUIWindows curWindow, nextWindow; FurnaceGUIWindows curWindow, nextWindow;
float peak[2]; float peak[2];
float patChanX[DIV_MAX_CHANS+1]; float patChanX[DIV_MAX_CHANS+1];