diff options
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | include/notifications/sound.h | 22 | ||||
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | src/snap.cpp | 1 |
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}; |