aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2018-03-26 16:02:55 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-26 21:07:40 +0000
commit6345c7e02210218f5a35e02e71a44b9be28556a3 (patch)
tree336d8d96af908aa472fc35f58869b6659d2e24a6 /src
parentb5c758c4051c749107872fd056dcc843dd4b08cc (diff)
downloadayatana-indicator-datetime-6345c7e02210218f5a35e02e71a44b9be28556a3.tar.gz
ayatana-indicator-datetime-6345c7e02210218f5a35e02e71a44b9be28556a3.tar.bz2
ayatana-indicator-datetime-6345c7e02210218f5a35e02e71a44b9be28556a3.zip
use a different default sound for calendars than for alarms
Diffstat (limited to 'src')
-rw-r--r--src/snap.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index 7774def..326e676 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -98,7 +98,8 @@ public:
if (appointment.is_ubuntu_alarm() || !silent_mode()) {
// create the sound.
const auto role = appointment.is_ubuntu_alarm() ? "alarm" : "alert";
- const auto uri = get_alarm_uri(alarm, m_settings);
+ const auto default_sound = appointment.is_ubuntu_alarm() ? ALARM_DEFAULT_SOUND : CALENDAR_DEFAULT_SOUND;
+ const auto uri = get_alarm_uri(alarm, m_settings, default_sound);
const auto volume = m_settings->alarm_volume.get();
const bool loop = interactive;
sound = std::make_shared<ain::Sound>(role, uri, volume, loop);
@@ -191,13 +192,12 @@ private:
}
std::string get_alarm_uri(const Alarm& alarm,
- const std::shared_ptr<const Settings>& settings) const
+ const std::shared_ptr<const Settings>& settings,
+ const std::string& default_sound ) const
{
- const char* FALLBACK {ALARM_DEFAULT_SOUND};
-
const std::string candidates[] = { alarm.audio_url,
settings->alarm_sound.get(),
- FALLBACK };
+ default_sound };
std::string uri;