1
0
mirror of https://github.com/uowuo/abaddon.git synced 2025-03-04 03:03:16 -05:00

Merge branch 'master' into classic-channels

This commit is contained in:
ouwou 2023-12-30 02:26:45 -05:00
commit daa57bf00e
5 changed files with 35 additions and 13 deletions

View File

@ -83,7 +83,7 @@ endif ()
if (NOT WIN32)
target_sources(abaddon PRIVATE src/notifications/notifier_gio.cpp)
else ()
target_sources(abaddon PRIVATE src/notifications/notifier_null.cpp)
target_sources(abaddon PRIVATE src/notifications/notifier_fallback.cpp)
endif ()
if (IXWebSocket_LIBRARIES)

View File

@ -87,7 +87,7 @@ the result of fundamental issues with Discord's thread implementation.
#### Linux:
1. Install dependencies
* On Ubuntu 20.04 (Focal) and newer:
* On Ubuntu 22.04 (Jammy) and newer:
```Shell
$ sudo apt install g++ cmake libgtkmm-3.0-dev libcurl4-gnutls-dev libsqlite3-dev libssl-dev nlohmann-json3-dev libhandy-1-dev libsecret-1-dev libopus-dev libsodium-dev libspdlog-dev
```
@ -117,7 +117,7 @@ Latest release version: https://github.com/uowuo/abaddon/releases/latest
- MacOS: [here](https://nightly.link/uowuo/abaddon/workflows/ci/master/build-macos-RelWithDebInfo.zip) unsigned,
unpackaged, requires gtkmm3 (e.g. from homebrew)
- Linux: [here](https://nightly.link/uowuo/abaddon/workflows/ci/master/build-linux-MinSizeRel.zip) unpackaged (for now),
requires gtkmm3. built on Ubuntu 18.04 + gcc9
requires gtkmm3. built on Ubuntu 22.04 + gcc9
> **Warning**: If you use Windows, make sure to start from the `bin` directory

View File

@ -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) {}

View File

@ -1,9 +0,0 @@
#include "notifier.hpp"
Notifier::Notifier() {}
Notifier::~Notifier() {}
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) {}
void Notifier::Withdraw(const Glib::ustring &id) {}

View File

@ -47,10 +47,11 @@ public:
// [notifications]
#ifdef _WIN32
bool NotificationsEnabled { false };
bool NotificationsPlaySound { false };
#else
bool NotificationsEnabled { true };
#endif
bool NotificationsPlaySound { true };
#endif
// [voice]
#ifdef WITH_RNNOISE