Add sfPlaybackDevice to manage the audio playback device

This commit is contained in:
Lukas Dürrenberger committed 2026-10-04 22:11:58 +02:00
1 parent b4220b39ff
commit 523c48cf98
7 files changed
+374

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
#include <CSFML/Audio/PlaybackDevice.h>
#include <SFML/Audio/PlaybackDevice.hpp>
#include <catch2/catch_test_macros.hpp>
TEST_CASE("[Audio] sfPlaybackDevice")
{
SECTION("sfPlaybackDeviceNotification")
{
STATIC_CHECK(sfPlaybackDeviceStarted == static_cast<int>(sf::PlaybackDevice::Notification::DeviceStarted));
STATIC_CHECK(sfPlaybackDeviceStopped == static_cast<int>(sf::PlaybackDevice::Notification::DeviceStopped));
STATIC_CHECK(sfPlaybackDeviceRerouted == static_cast<int>(sf::PlaybackDevice::Notification::DeviceRerouted));
STATIC_CHECK(sfPlaybackDeviceInterruptionBegan ==
static_cast<int>(sf::PlaybackDevice::Notification::DeviceInterruptionBegan));
STATIC_CHECK(sfPlaybackDeviceInterruptionEnded ==
static_cast<int>(sf::PlaybackDevice::Notification::DeviceInterruptionEnded));
STATIC_CHECK(sfPlaybackDeviceUnlocked == static_cast<int>(sf::PlaybackDevice::Notification::DeviceUnlocked));
}
SECTION("sfPlaybackDevice_setNotificationCallback")
{
sfPlaybackDevice_setNotificationCallback([](sfPlaybackDeviceNotification, void*) {}, nullptr);
sfPlaybackDevice_setNotificationCallback(nullptr, nullptr);
}
}