From 4767248605dae3847530340062f2be78c59f2a33 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Sun, 12 Nov 2023 15:26:59 +0000 Subject: [PATCH] revert accidental refactor to isPlaying --- sdl2-hyper-sonic-drivers/examples/adl-example.cpp | 2 +- sdl2-hyper-sonic-drivers/examples/mid-example.h | 2 +- sdl2-hyper-sonic-drivers/examples/mt32-example.cpp | 2 +- .../src/HyperSonicDrivers/drivers/IAudioDriver.hpp | 2 +- .../src/HyperSonicDrivers/drivers/MIDDriver.cpp | 2 +- .../src/HyperSonicDrivers/drivers/MIDDriver.hpp | 2 +- .../src/HyperSonicDrivers/drivers/westwood/ADLDriver.cpp | 2 +- .../src/HyperSonicDrivers/drivers/westwood/ADLDriver.hpp | 2 +- .../test/HyperSonicDrivers/audio/sdl2/TestRenderer.cpp | 2 +- .../test/HyperSonicDrivers/drivers/TestIAudioDriver.cpp | 2 +- .../test/HyperSonicDrivers/drivers/TestMIDDriver.cpp | 6 +++--- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sdl2-hyper-sonic-drivers/examples/adl-example.cpp b/sdl2-hyper-sonic-drivers/examples/adl-example.cpp index f82e5800..eb84f565 100644 --- a/sdl2-hyper-sonic-drivers/examples/adl-example.cpp +++ b/sdl2-hyper-sonic-drivers/examples/adl-example.cpp @@ -62,7 +62,7 @@ void adl_test(const OplEmulator emu, const OplType type, std::shared_ptr auto start_time = std::chrono::system_clock::now(); midDrv.setMidi(midi); midDrv.play(0); - while (midDrv.isActive()) { + while (midDrv.isPlaying()) { utils::delayMillis(1000); } diff --git a/sdl2-hyper-sonic-drivers/examples/mt32-example.cpp b/sdl2-hyper-sonic-drivers/examples/mt32-example.cpp index 5158284c..3c4733b7 100644 --- a/sdl2-hyper-sonic-drivers/examples/mt32-example.cpp +++ b/sdl2-hyper-sonic-drivers/examples/mt32-example.cpp @@ -44,7 +44,7 @@ int main(int argc, char* argv[]) drivers::MIDDriver middrv(mt32, eChannelGroup::Music); middrv.setMidi(midi); middrv.play(0); - while (middrv.isActive()) + while (middrv.isPlaying()) { utils::delayMillis(100); } diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/IAudioDriver.hpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/IAudioDriver.hpp index 72b497f7..777c9980 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/IAudioDriver.hpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/IAudioDriver.hpp @@ -30,7 +30,7 @@ namespace HyperSonicDrivers::drivers // TODO: it might not be required //virtual void resume() = 0; - virtual bool isActive() const noexcept = 0; + virtual bool isPlaying() const noexcept = 0; // TODO: it might not be required //virtual bool isPaused() const noexcept = 0; diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.cpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.cpp index 98c417d5..e7074947 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.cpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.cpp @@ -234,7 +234,7 @@ namespace HyperSonicDrivers::drivers m_paused = false; } - bool MIDDriver::isActive() const noexcept + bool MIDDriver::isPlaying() const noexcept { return m_isPlaying; } diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.hpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.hpp index b69ee69c..a0950016 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.hpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/MIDDriver.hpp @@ -43,7 +43,7 @@ namespace HyperSonicDrivers::drivers void pause() noexcept; void resume() noexcept; - bool isActive() const noexcept override; + bool isPlaying() const noexcept override; bool isPaused() const noexcept; inline bool isTempoChanged() const noexcept { return m_midiTempoChanged; } diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.cpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.cpp index fbf631e1..6451c4c9 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.cpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.cpp @@ -253,7 +253,7 @@ namespace HyperSonicDrivers::drivers::westwood stopAllChannels(); } - bool ADLDriver::isActive() const noexcept + bool ADLDriver::isPlaying() const noexcept { bool res = false; for (int i = 0; i <= NUM_CHANNELS; i++) diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.hpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.hpp index fa3fb28c..aba97f91 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.hpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/westwood/ADLDriver.hpp @@ -56,7 +56,7 @@ namespace HyperSonicDrivers::drivers::westwood void play(const uint8_t track) noexcept override; void stop() noexcept override; - bool isActive() const noexcept override; + bool isPlaying() const noexcept override; private: void initDriver_(); void startSound_(const uint8_t track, const uint8_t volume); diff --git a/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/audio/sdl2/TestRenderer.cpp b/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/audio/sdl2/TestRenderer.cpp index 013ffc73..0b8f4e95 100644 --- a/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/audio/sdl2/TestRenderer.cpp +++ b/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/audio/sdl2/TestRenderer.cpp @@ -63,7 +63,7 @@ namespace HyperSonicDrivers::audio::sdl2 drv1.setADLFile(af); drv1.play(4); - while (drv1.isActive()) + while (drv1.isPlaying()) r.renderBuffer(opl); r.closeOutputFile(); diff --git a/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestIAudioDriver.cpp b/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestIAudioDriver.cpp index d442dcba..56213cd2 100644 --- a/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestIAudioDriver.cpp +++ b/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestIAudioDriver.cpp @@ -10,7 +10,7 @@ namespace HyperSonicDrivers::drivers IAudioDriverMock(const std::shared_ptr& device) : IAudioDriver(device) {} void play(const uint8_t track) noexcept override {}; void stop() noexcept override {}; - bool isActive() const noexcept override { return false; }; + bool isPlaying() const noexcept override { return false; }; }; TEST(IAudioDriver, cstor_nullptr) diff --git a/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestMIDDriver.cpp b/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestMIDDriver.cpp index 7dffd269..8b55a7e5 100644 --- a/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestMIDDriver.cpp +++ b/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestMIDDriver.cpp @@ -88,14 +88,14 @@ namespace HyperSonicDrivers::drivers MIDDriverMock middrv(device); middrv.setMidi(midi); middrv.play(0); - ASSERT_TRUE(middrv.isActive()); + ASSERT_TRUE(middrv.isPlaying()); auto start = utils::getMillis(); utils::delayMillis(20); middrv.stop(); - EXPECT_FALSE(middrv.isActive()); + EXPECT_FALSE(middrv.isPlaying()); auto stop = utils::getMillis(); EXPECT_LE(stop - start, 1 * 1000); - EXPECT_FALSE(middrv.isActive()); + EXPECT_FALSE(middrv.isPlaying()); EXPECT_TRUE(device->isAcquired()); } EXPECT_FALSE(device->isAcquired());