diff --git a/sdl2-hyper-sonic-drivers/examples/pcm-example.cpp b/sdl2-hyper-sonic-drivers/examples/pcm-example.cpp index 0d008cd5..4ec2058c 100644 --- a/sdl2-hyper-sonic-drivers/examples/pcm-example.cpp +++ b/sdl2-hyper-sonic-drivers/examples/pcm-example.cpp @@ -40,7 +40,7 @@ int main(int argc, char* argv[]) } drv.play(wavSound); - while(drv.isActive(wavSound)) + while(drv.isPlaying(wavSound)) { cout << "is playing" << endl; delayMillis(1000); @@ -49,7 +49,7 @@ int main(int argc, char* argv[]) delayMillis(500); drv.play(vocSound); - while (drv.isActive(vocSound)) + while (drv.isPlaying(vocSound)) { cout << "is playing" << endl; delayMillis(1000); @@ -67,7 +67,7 @@ int main(int argc, char* argv[]) drv.play(vocSound, 255, -127 * sig); } - while(drv.isActive()) + while(drv.isPlaying()) { cout << "is playing" << endl; delayMillis(1000); diff --git a/sdl2-hyper-sonic-drivers/sdl2-hyper-sonic-drivers.cpp b/sdl2-hyper-sonic-drivers/sdl2-hyper-sonic-drivers.cpp index 5968e90f..c529c9af 100644 --- a/sdl2-hyper-sonic-drivers/sdl2-hyper-sonic-drivers.cpp +++ b/sdl2-hyper-sonic-drivers/sdl2-hyper-sonic-drivers.cpp @@ -404,7 +404,7 @@ void pcm_sound_append() drivers::PCMDriver drv(mixer); drv.play(s2); - while (drv.isActive()) + while (drv.isPlaying()) { utils::delayMillis(100); } diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp index b73f65cd..37110ddc 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.cpp @@ -10,7 +10,7 @@ namespace HyperSonicDrivers::drivers { } - bool PCMDriver::isActive() const noexcept + bool PCMDriver::isPlaying() const noexcept { for (const auto& [stream, _] : m_PCMStreams_channels) { @@ -21,7 +21,7 @@ namespace HyperSonicDrivers::drivers return false; } - bool PCMDriver::isActive(const std::shared_ptr& sound) const noexcept + bool PCMDriver::isPlaying(const std::shared_ptr& sound) const noexcept { for (const auto& [stream, _] : m_PCMStreams_channels) { diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.hpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.hpp index 098a3735..0bcb4820 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.hpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/drivers/PCMDriver.hpp @@ -23,8 +23,8 @@ namespace HyperSonicDrivers::drivers explicit PCMDriver(const std::shared_ptr& mixer, const uint8_t max_channels = 0xFF); ~PCMDriver() = default; - bool isActive() const noexcept; - bool isActive(const std::shared_ptr& sound) const noexcept; + bool isPlaying() const noexcept; + bool isPlaying(const std::shared_ptr& sound) const noexcept; std::optional play( const std::shared_ptr& sound, const uint8_t volume = audio::mixer::Channel_max_volume, diff --git a/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestPCMDriver.cpp b/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestPCMDriver.cpp index eccafc7a..6b714c19 100644 --- a/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestPCMDriver.cpp +++ b/sdl2-hyper-sonic-drivers/test/HyperSonicDrivers/drivers/TestPCMDriver.cpp @@ -20,14 +20,14 @@ namespace HyperSonicDrivers::drivers auto sound = std::make_shared(audio::mixer::eChannelGroup::Plain, true, 44100, 1, sound_data); auto ch_id = drv.play(sound); - ASSERT_TRUE(drv.isActive(sound)); - ASSERT_TRUE(drv.isActive()); + ASSERT_TRUE(drv.isPlaying(sound)); + ASSERT_TRUE(drv.isPlaying()); ASSERT_TRUE(ch_id.has_value()); EXPECT_EQ(ch_id.value(), 0); drv.stop(ch_id.value()); - EXPECT_FALSE(drv.isActive(sound)); - EXPECT_FALSE(drv.isActive()); + EXPECT_FALSE(drv.isPlaying(sound)); + EXPECT_FALSE(drv.isPlaying()); } TEST(PCMDriver, play_stop1) @@ -41,14 +41,14 @@ namespace HyperSonicDrivers::drivers auto sound = std::make_shared(audio::mixer::eChannelGroup::Plain, true, 44100, 1, sound_data); auto ch_id = drv.play(sound); - ASSERT_TRUE(drv.isActive(sound)); - ASSERT_TRUE(drv.isActive()); + ASSERT_TRUE(drv.isPlaying(sound)); + ASSERT_TRUE(drv.isPlaying()); ASSERT_TRUE(ch_id.has_value()); EXPECT_EQ(ch_id.value(), 0); drv.stop(sound); - EXPECT_FALSE(drv.isActive(sound)); - EXPECT_FALSE(drv.isActive()); + EXPECT_FALSE(drv.isPlaying(sound)); + EXPECT_FALSE(drv.isPlaying()); } TEST(PCMDriver, play_stop2) @@ -62,14 +62,14 @@ namespace HyperSonicDrivers::drivers auto sound = std::make_shared(audio::mixer::eChannelGroup::Plain, true, 44100, 1, sound_data); auto ch_id = drv.play(sound); - ASSERT_TRUE(drv.isActive(sound)); - ASSERT_TRUE(drv.isActive()); + ASSERT_TRUE(drv.isPlaying(sound)); + ASSERT_TRUE(drv.isPlaying()); ASSERT_TRUE(ch_id.has_value()); EXPECT_EQ(ch_id.value(), 0); drv.stop(); - EXPECT_FALSE(drv.isActive(sound)); - EXPECT_FALSE(drv.isActive()); + EXPECT_FALSE(drv.isPlaying(sound)); + EXPECT_FALSE(drv.isPlaying()); } TEST(PCMDriver, play_stop_complex) @@ -89,14 +89,14 @@ namespace HyperSonicDrivers::drivers EXPECT_TRUE(drv.play(sound2).has_value()); EXPECT_TRUE(drv.play(sound2).has_value()); - ASSERT_TRUE(drv.isActive(sound)); - ASSERT_TRUE(drv.isActive()); + ASSERT_TRUE(drv.isPlaying(sound)); + ASSERT_TRUE(drv.isPlaying()); ASSERT_TRUE(ch_id.has_value()); EXPECT_EQ(ch_id.value(), 0); drv.stop(ch_id.value()); - EXPECT_FALSE(drv.isActive(sound)); - EXPECT_TRUE(drv.isActive()); + EXPECT_FALSE(drv.isPlaying(sound)); + EXPECT_TRUE(drv.isPlaying()); } }