mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-13 20:18:50 +03:00
refactor notification sounds cmake option
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gdkmm/pixbuf.h>
|
||||
|
||||
#ifdef WITH_MINIAUDIO
|
||||
#include <miniaudio.h>
|
||||
#ifdef ENABLE_NOTIFICATION_SOUNDS
|
||||
#include <miniaudio.h>
|
||||
#endif
|
||||
|
||||
class Notifier {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <miniaudio.h>
|
||||
|
||||
Notifier::Notifier() {
|
||||
#ifdef WITH_MINIAUDIO
|
||||
#ifdef ENABLE_NOTIFICATION_SOUNDS
|
||||
if (ma_engine_init(nullptr, &m_engine) != MA_SUCCESS) {
|
||||
printf("failed to initialize miniaudio engine\n");
|
||||
}
|
||||
@@ -13,7 +13,7 @@ Notifier::Notifier() {
|
||||
}
|
||||
|
||||
Notifier::~Notifier() {
|
||||
#ifdef WITH_MINIAUDIO
|
||||
#ifdef ENABLE_NOTIFICATION_SOUNDS
|
||||
ma_engine_uninit(&m_engine);
|
||||
#endif
|
||||
}
|
||||
@@ -34,7 +34,7 @@ void Notifier::Notify(const Glib::ustring &title, const Glib::ustring &text, con
|
||||
g_object_unref(icon);
|
||||
g_object_unref(file);
|
||||
|
||||
#ifdef WITH_MINIAUDIO
|
||||
#ifdef ENABLE_NOTIFICATION_SOUNDS
|
||||
ma_engine_play_sound(&m_engine, Abaddon::Get().GetResPath("/sound/message.mp3").c_str(), nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user