Fix: Only fire switched event if preset load succeeded

This commit is contained in:
Mischa
2026-01-24 22:12:06 -08:00
committed by Mischa Spiegelmock
parent be07112ae7
commit aa24265fd1

View File

@ -131,8 +131,9 @@ void PlaylistCWrapper::PlayPresetIndex(uint32_t index, bool hardCut, bool resetF
{
if (m_presetLoadEventCallback(index, filename.c_str(), hardCut, m_presetLoadEventUserData))
{
// Application handled the load, don't try to load from filesystem
if (m_presetSwitchedEventCallback != nullptr)
// Application handled the load, don't try to load from filesystem.
// Only fire switched event if the app's load succeeded.
if (!m_lastPresetSwitchFailed && m_presetSwitchedEventCallback != nullptr)
{
m_presetSwitchedEventCallback(hardCut, index, m_presetSwitchedEventUserData);
}