GUI: better
This commit is contained in:
parent
083f870930
commit
b105dd535f
|
@ -2166,6 +2166,13 @@ int DivEngine::getRow() {
|
||||||
return prevRow;
|
return prevRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DivEngine::getPlayPos(int& order, int& row) {
|
||||||
|
playPosLock.lock();
|
||||||
|
order=prevOrder;
|
||||||
|
row=prevRow;
|
||||||
|
playPosLock.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
int DivEngine::getElapsedBars() {
|
int DivEngine::getElapsedBars() {
|
||||||
return elapsedBars;
|
return elapsedBars;
|
||||||
}
|
}
|
||||||
|
|
|
@ -446,7 +446,7 @@ class DivEngine {
|
||||||
// bitfield
|
// bitfield
|
||||||
unsigned char walked[8192];
|
unsigned char walked[8192];
|
||||||
bool isMuted[DIV_MAX_CHANS];
|
bool isMuted[DIV_MAX_CHANS];
|
||||||
std::mutex isBusy, saveLock;
|
std::mutex isBusy, saveLock, playPosLock;
|
||||||
String configPath;
|
String configPath;
|
||||||
String configFile;
|
String configFile;
|
||||||
String lastError;
|
String lastError;
|
||||||
|
@ -848,6 +848,9 @@ class DivEngine {
|
||||||
// get current row
|
// get current row
|
||||||
int getRow();
|
int getRow();
|
||||||
|
|
||||||
|
// synchronous get order/row
|
||||||
|
void getPlayPos(int& order, int& row);
|
||||||
|
|
||||||
// get beat/bar
|
// get beat/bar
|
||||||
int getElapsedBars();
|
int getElapsedBars();
|
||||||
int getElapsedBeats();
|
int getElapsedBeats();
|
||||||
|
|
|
@ -1164,8 +1164,10 @@ void DivEngine::nextRow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stepPlay) {
|
if (!stepPlay) {
|
||||||
|
playPosLock.lock();
|
||||||
prevOrder=curOrder;
|
prevOrder=curOrder;
|
||||||
prevRow=curRow;
|
prevRow=curRow;
|
||||||
|
playPosLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<chans; i++) {
|
for (int i=0; i<chans; i++) {
|
||||||
|
@ -1403,8 +1405,10 @@ bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) {
|
||||||
endOfSong=false;
|
endOfSong=false;
|
||||||
if (stepPlay==2) {
|
if (stepPlay==2) {
|
||||||
stepPlay=1;
|
stepPlay=1;
|
||||||
|
playPosLock.lock();
|
||||||
prevOrder=curOrder;
|
prevOrder=curOrder;
|
||||||
prevRow=curRow;
|
prevRow=curRow;
|
||||||
|
playPosLock.unlock();
|
||||||
}
|
}
|
||||||
nextRow();
|
nextRow();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -3922,6 +3922,17 @@ bool FurnaceGUI::loop() {
|
||||||
curWindow=GUI_WINDOW_NOTHING;
|
curWindow=GUI_WINDOW_NOTHING;
|
||||||
editOptsVisible=false;
|
editOptsVisible=false;
|
||||||
|
|
||||||
|
int nextPlayOrder=0;
|
||||||
|
int nextOldRow=0;
|
||||||
|
e->getPlayPos(nextPlayOrder,nextOldRow);
|
||||||
|
playOrder=nextPlayOrder;
|
||||||
|
if (followPattern) {
|
||||||
|
curOrder=playOrder;
|
||||||
|
}
|
||||||
|
if (e->isPlaying()) {
|
||||||
|
oldRow=nextOldRow;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mobileUI) {
|
if (!mobileUI) {
|
||||||
ImGui::BeginMainMenuBar();
|
ImGui::BeginMainMenuBar();
|
||||||
if (ImGui::BeginMenu(settings.capitalMenuBar?"File":"file")) {
|
if (ImGui::BeginMenu(settings.capitalMenuBar?"File":"file")) {
|
||||||
|
@ -4459,16 +4470,6 @@ bool FurnaceGUI::loop() {
|
||||||
|
|
||||||
MEASURE(calcChanOsc,calcChanOsc());
|
MEASURE(calcChanOsc,calcChanOsc());
|
||||||
|
|
||||||
e->synchronized([this]() {
|
|
||||||
playOrder=e->getOrder();
|
|
||||||
if (followPattern) {
|
|
||||||
curOrder=playOrder;
|
|
||||||
}
|
|
||||||
if (e->isPlaying()) {
|
|
||||||
oldRow=e->getRow();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (mobileUI) {
|
if (mobileUI) {
|
||||||
globalWinFlags=ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoBringToFrontOnFocus;
|
globalWinFlags=ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoBringToFrontOnFocus;
|
||||||
//globalWinFlags=ImGuiWindowFlags_NoTitleBar;
|
//globalWinFlags=ImGuiWindowFlags_NoTitleBar;
|
||||||
|
|
Loading…
Reference in a new issue