summaryrefslogtreecommitdiff
path: root/src/notifications/notifier_fallback.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-12-30 02:26:45 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2023-12-30 02:26:45 -0500
commitdaa57bf00ee3895aa9d863a2ae72232ad7733a3f (patch)
tree0cf06d1094db3d896db21266e646a6ce43ff9a94 /src/notifications/notifier_fallback.cpp
parent862079c4925a2511b9b8065b73785d7646f84b51 (diff)
parent9b2475538a55b0f95b9d05c50209b9f9efcb63e1 (diff)
downloadabaddon-portaudio-daa57bf00ee3895aa9d863a2ae72232ad7733a3f.tar.gz
abaddon-portaudio-daa57bf00ee3895aa9d863a2ae72232ad7733a3f.zip
Merge branch 'master' into classic-channels
Diffstat (limited to 'src/notifications/notifier_fallback.cpp')
-rw-r--r--src/notifications/notifier_fallback.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/notifications/notifier_fallback.cpp b/src/notifications/notifier_fallback.cpp
new file mode 100644
index 0000000..00e9d4a
--- /dev/null
+++ b/src/notifications/notifier_fallback.cpp
@@ -0,0 +1,30 @@
+#include "notifier.hpp"
+
+/* no actual notifications, just sounds
+ GNotification has no win32 backend, and WinToast uses headers msys2 doesnt provide
+ maybe it can be LoadLibrary'd in :s
+*/
+
+Notifier::Notifier() {
+#ifdef ENABLE_NOTIFICATION_SOUNDS
+ if (ma_engine_init(nullptr, &m_engine) != MA_SUCCESS) {
+ printf("failed to initialize miniaudio engine\n");
+ }
+#endif
+}
+
+Notifier::~Notifier() {
+#ifdef ENABLE_NOTIFICATION_SOUNDS
+ ma_engine_uninit(&m_engine);
+#endif
+}
+
+void Notifier::Notify(const Glib::ustring &id, const Glib::ustring &title, const Glib::ustring &text, const Glib::ustring &default_action, const std::string &icon_path) {
+#ifdef ENABLE_NOTIFICATION_SOUNDS
+ if (Abaddon::Get().GetSettings().NotificationsPlaySound) {
+ ma_engine_play_sound(&m_engine, Abaddon::Get().GetResPath("/sound/message.mp3").c_str(), nullptr);
+ }
+#endif
+}
+
+void Notifier::Withdraw(const Glib::ustring &id) {}