2022-05-07 17:02:41 +03:00
|
|
|
#include "audio_support.h"
|
|
|
|
|
|
2023-05-20 11:59:07 +03:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
2022-05-07 17:02:41 +03:00
|
|
|
#include <QSound>
|
|
|
|
|
|
|
|
|
|
extern void play_audio(const app_settings::selected_audio& item)
|
|
|
|
|
{
|
|
|
|
|
// Play audio
|
2023-05-20 11:59:07 +03:00
|
|
|
|
2022-05-07 17:02:41 +03:00
|
|
|
if (item.name != Audio_Empty && item.name != Audio_Custom)
|
|
|
|
|
{
|
|
|
|
|
// Find bundled audio
|
|
|
|
|
auto iter = AudioMap.find(item.name);
|
|
|
|
|
if (iter != AudioMap.end())
|
|
|
|
|
QSound::play(iter->second);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (item.name == Audio_Custom && !item.path.isEmpty())
|
|
|
|
|
QSound::play(item.path);
|
|
|
|
|
}
|
2023-05-20 11:59:07 +03:00
|
|
|
#else
|
|
|
|
|
extern void play_audio(const app_settings::selected_audio& item)
|
|
|
|
|
{}
|
|
|
|
|
#endif
|