aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-08-31 21:16:06 +0200
committerRobert Tari <robert@tari.in>2021-08-31 21:25:26 +0200
commit8ca77cf41948373987dc93446ede7afd50103cae (patch)
tree9f9f90b761bc9acbd520b092d29b61c89ac23c60
parent9d95a062904cf8f421680d844ea656316c3c9a74 (diff)
downloadayatana-indicator-datetime-8ca77cf41948373987dc93446ede7afd50103cae.tar.gz
ayatana-indicator-datetime-8ca77cf41948373987dc93446ede7afd50103cae.tar.bz2
ayatana-indicator-datetime-8ca77cf41948373987dc93446ede7afd50103cae.zip
Fix build failure on Ubuntu 20.04
- include/notifications/sound.h: Add SoundBuilder class - src/snap.cpp: Add m_sound_builder variable - src/main.cpp: Fix uin -> ain typo - CMakeLists.txt: Add uuid dependency
-rw-r--r--CMakeLists.txt3
-rw-r--r--include/notifications/sound.h22
-rw-r--r--src/main.cpp2
-rw-r--r--src/snap.cpp1
4 files changed, 26 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e682ea..a4920c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,7 +67,8 @@ pkg_check_modules (SERVICE_DEPS REQUIRED
libnotify>=0.7.6
properties-cpp>=0.0.1
libaccounts-glib>=1.18
- messaging-menu>=0.8.2)
+ messaging-menu>=0.8.2
+ uuid>=2.25)
include_directories (SYSTEM ${SERVICE_DEPS_INCLUDE_DIRS})
# lomiri-url-dispatcher
diff --git a/include/notifications/sound.h b/include/notifications/sound.h
index 8bd3e33..1bff0b0 100644
--- a/include/notifications/sound.h
+++ b/include/notifications/sound.h
@@ -53,6 +53,28 @@ private:
****
***/
+class SoundBuilder
+{
+public:
+ SoundBuilder() =default;
+ virtual ~SoundBuilder() =default;
+ virtual std::shared_ptr<Sound> create(const std::string& role, const std::string& uri, unsigned int volume, bool loop) =0;
+};
+
+class DefaultSoundBuilder: public SoundBuilder
+{
+public:
+ DefaultSoundBuilder() =default;
+ ~DefaultSoundBuilder() =default;
+ virtual std::shared_ptr<Sound> create(const std::string& role, const std::string& uri, unsigned int volume, bool loop) override {
+ return std::make_shared<Sound>(role, uri, volume, loop);
+ }
+};
+
+/***
+****
+***/
+
} // namespace notifications
} // namespace indicator
} // namespace ayatana
diff --git a/src/main.cpp b/src/main.cpp
index 6cad190..255b62c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -151,7 +151,7 @@ main(int /*argc*/, char** /*argv*/)
// set up the snap decisions
auto snooze_planner = std::make_shared<SnoozePlanner>(state->settings, state->clock);
auto notification_engine = std::make_shared<ain::Engine>("ayatana-indicator-datetime-service");
- auto sound_builder = std::make_shared<uin::DefaultSoundBuilder>();
+ auto sound_builder = std::make_shared<ain::DefaultSoundBuilder>();
std::unique_ptr<Snap> snap (new Snap(notification_engine, sound_builder, state->settings, system_bus));
auto alarm_queue = create_simple_alarm_queue(state->clock, snooze_planner, engine, timezone_);
auto on_response = [snooze_planner, actions](const Appointment& appointment, const Alarm& alarm, const Snap::Response& response) {
diff --git a/src/snap.cpp b/src/snap.cpp
index 00c4743..0ef6a94 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -300,6 +300,7 @@ private:
}
const std::shared_ptr<ayatana::indicator::notifications::Engine> m_engine;
+ const std::shared_ptr<ayatana::indicator::notifications::SoundBuilder> m_sound_builder;
const std::shared_ptr<const Settings> m_settings;
std::set<int> m_notifications;
GCancellable * m_cancellable {nullptr};