Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix IMusicDriver play if no audio resurce/file was set #261

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
endif()


project ("sdl2-hyper-sonic-drivers" VERSION 0.12.1 DESCRIPTION "SDL2 based Hyper-Sonic Drivers for emulating old soundcards")
project ("sdl2-hyper-sonic-drivers" VERSION 0.12.2 DESCRIPTION "SDL2 based Hyper-Sonic Drivers for emulating old soundcards")
include (TestBigEndian)
TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
if(IS_BIG_ENDIAN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ namespace HyperSonicDrivers::drivers

void MIDDriver::play(const uint8_t track) noexcept
{
if (m_midi == nullptr)
return;

if (track >= m_midi->numTracks)
{
logW(std::format("track not available: {}", track));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ namespace HyperSonicDrivers::drivers::westwood
void ADLDriver::play(const uint8_t track) noexcept
{
std::scoped_lock lock(m_mutex);

if (m_adl_file == nullptr)
return;

constexpr uint8_t volume = std::numeric_limits<uint8_t>::max();
const uint16_t soundId = m_adl_file->getTrack(track);
Expand Down
Loading