From a85fd44e7b2dc67b3e0712e174e88d0eb6c467e7 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 23 Jun 2014 18:52:52 -0500 Subject: add GSettings support for specifying a default alarm sound and default alarm volume. --- include/datetime/settings-live.h | 2 ++ include/datetime/settings-shared.h | 12 ++++++++++++ include/datetime/settings.h | 2 ++ 3 files changed, 16 insertions(+) (limited to 'include/datetime') diff --git a/include/datetime/settings-live.h b/include/datetime/settings-live.h index 202c998..a075a85 100644 --- a/include/datetime/settings-live.h +++ b/include/datetime/settings-live.h @@ -55,6 +55,8 @@ private: void update_show_year(); void update_time_format_mode(); void update_timezone_name(); + void update_alarm_sound(); + void update_alarm_volume(); GSettings* m_settings; diff --git a/include/datetime/settings-shared.h b/include/datetime/settings-shared.h index 17a8ef0..b8d7737 100644 --- a/include/datetime/settings-shared.h +++ b/include/datetime/settings-shared.h @@ -30,6 +30,16 @@ typedef enum } TimeFormatMode; +typedef enum +{ + ALARM_VOLUME_VERY_QUIET, + ALARM_VOLUME_QUIET, + ALARM_VOLUME_NORMAL, + ALARM_VOLUME_LOUD, + ALARM_VOLUME_VERY_LOUD +} +AlarmVolume; + #define SETTINGS_INTERFACE "com.canonical.indicator.datetime" #define SETTINGS_SHOW_CLOCK_S "show-clock" #define SETTINGS_TIME_FORMAT_S "time-format" @@ -45,5 +55,7 @@ TimeFormatMode; #define SETTINGS_SHOW_DETECTED_S "show-auto-detected-location" #define SETTINGS_LOCATIONS_S "locations" #define SETTINGS_TIMEZONE_NAME_S "timezone-name" +#define SETTINGS_ALARM_SOUND_S "alarm-default-sound" +#define SETTINGS_ALARM_VOLUME_S "alarm-default-volume" #endif // INDICATOR_DATETIME_SETTINGS_SHARED diff --git a/include/datetime/settings.h b/include/datetime/settings.h index ce234d9..5a0f1eb 100644 --- a/include/datetime/settings.h +++ b/include/datetime/settings.h @@ -56,6 +56,8 @@ public: core::Property show_year; core::Property time_format_mode; core::Property timezone_name; + core::Property alarm_sound; + core::Property alarm_volume; }; } // namespace datetime -- cgit v1.2.3 From 9c34627337380a3125ffc7173606d72a66feec2e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 23 Jun 2014 19:03:47 -0500 Subject: in the snap decision code, handle custom sounds and volume levels. --- include/datetime/snap.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/datetime') diff --git a/include/datetime/snap.h b/include/datetime/snap.h index a493772..ffd3aa0 100644 --- a/include/datetime/snap.h +++ b/include/datetime/snap.h @@ -21,6 +21,7 @@ #define INDICATOR_DATETIME_SNAP_H #include +#include #include #include @@ -35,13 +36,16 @@ namespace datetime { class Snap { public: - Snap(); + Snap(const std::shared_ptr& settings); virtual ~Snap(); typedef std::function appointment_func; void operator()(const Appointment& appointment, appointment_func show, appointment_func dismiss); + +private: + const std::shared_ptr m_settings; }; } // namespace datetime -- cgit v1.2.3 From 0463fa7657b1aab4a3f5c6e7909ba1513c047968 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 23 Jun 2014 20:26:09 -0500 Subject: add support for per-alarm ringtone sounds set in EDS via E_CAL_COMPONENT_ALARM_AUDIO --- include/datetime/appointment.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/datetime') diff --git a/include/datetime/appointment.h b/include/datetime/appointment.h index 4778293..2e406a2 100644 --- a/include/datetime/appointment.h +++ b/include/datetime/appointment.h @@ -39,6 +39,7 @@ public: std::string summary; std::string url; std::string uid; + std::string audio_url; bool has_alarms = false; DateTime begin; DateTime end; -- cgit v1.2.3 From 373832769c30a950629a4ca9474bd7f5bf03a6b4 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 24 Jun 2014 00:06:04 -0500 Subject: add GSettings support for specifying an alarm loop duration --- include/datetime/settings-live.h | 1 + include/datetime/settings-shared.h | 1 + include/datetime/settings.h | 1 + 3 files changed, 3 insertions(+) (limited to 'include/datetime') diff --git a/include/datetime/settings-live.h b/include/datetime/settings-live.h index a075a85..4db2d40 100644 --- a/include/datetime/settings-live.h +++ b/include/datetime/settings-live.h @@ -57,6 +57,7 @@ private: void update_timezone_name(); void update_alarm_sound(); void update_alarm_volume(); + void update_alarm_duration(); GSettings* m_settings; diff --git a/include/datetime/settings-shared.h b/include/datetime/settings-shared.h index b8d7737..bfddd88 100644 --- a/include/datetime/settings-shared.h +++ b/include/datetime/settings-shared.h @@ -57,5 +57,6 @@ AlarmVolume; #define SETTINGS_TIMEZONE_NAME_S "timezone-name" #define SETTINGS_ALARM_SOUND_S "alarm-default-sound" #define SETTINGS_ALARM_VOLUME_S "alarm-default-volume" +#define SETTINGS_ALARM_DURATION_S "alarm-duration-minutes" #endif // INDICATOR_DATETIME_SETTINGS_SHARED diff --git a/include/datetime/settings.h b/include/datetime/settings.h index 5a0f1eb..a941f05 100644 --- a/include/datetime/settings.h +++ b/include/datetime/settings.h @@ -58,6 +58,7 @@ public: core::Property timezone_name; core::Property alarm_sound; core::Property alarm_volume; + core::Property alarm_duration; }; } // namespace datetime -- cgit v1.2.3 From dd54649aa56790ec43fc4272bc41e6916b4ebb31 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 24 Jun 2014 00:06:55 -0500 Subject: in the snap decision code, handle sound custom loop durations --- include/datetime/snap.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/datetime') diff --git a/include/datetime/snap.h b/include/datetime/snap.h index ffd3aa0..9b45b3f 100644 --- a/include/datetime/snap.h +++ b/include/datetime/snap.h @@ -21,6 +21,7 @@ #define INDICATOR_DATETIME_SNAP_H #include +#include #include #include @@ -36,7 +37,8 @@ namespace datetime { class Snap { public: - Snap(const std::shared_ptr& settings); + Snap(const std::shared_ptr& clock, + const std::shared_ptr& settings); virtual ~Snap(); typedef std::function appointment_func; @@ -45,6 +47,7 @@ public: appointment_func dismiss); private: + const std::shared_ptr m_clock; const std::shared_ptr m_settings; }; -- cgit v1.2.3