From a7ded3325a13295add97b4fb327274873f65435b Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 9 Sep 2023 17:12:49 -0500 Subject: [PATCH] warn user if we cannot play --- src/engine/engine.cpp | 8 ++++++-- src/engine/engine.h | 8 ++++---- src/gui/gui.cpp | 8 ++++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index ad25b6eea..2e32f2408 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -1701,7 +1701,7 @@ unsigned int DivEngine::convertPanLinearToSplit(int val, unsigned char bits, int return (panL<midiOut->send(TAMidiMessage(TA_MIDI_MACHINE_PLAY,0,0)); } + bool didItPlay=playing; BUSY_END; + return didItPlay; } -void DivEngine::playToRow(int row) { +bool DivEngine::playToRow(int row) { BUSY_BEGIN_SOFT; sPreview.sample=-1; sPreview.wave=-1; @@ -1802,7 +1804,9 @@ void DivEngine::playToRow(int row) { for (int i=0; isetOrder(curOrder); if (row>0) { - e->playToRow(row); + if (!e->playToRow(row)) { + showError("the song is over!"); + } } else { - e->play(); + if (!e->play()) { + showError("the song is over!"); + } } curNibble=false; orderNibble=false;