From a8fd3f49bf6509bd4545aec3292d2fc022d847ca Mon Sep 17 00:00:00 2001 From: charles kerr Date: Fri, 1 Jan 2016 15:58:55 -0600 Subject: make a SoundPlayer interface so we can mock it in the tests this requires an annoying amount of scaffolding: 1. implement gst and mock classes to implement the SoundPlayer interface 2. modify notifier to take a SoundPlayer argument in its ctor 3. modify service to take a Notifier argument in its ctor instead of instantiating it on its own 4. change main to update the startup steps for player/notifier/service --- src/notifier.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/notifier.h') diff --git a/src/notifier.h b/src/notifier.h index 18e25d7..9625c07 100644 --- a/src/notifier.h +++ b/src/notifier.h @@ -23,6 +23,7 @@ #include #include "device.h" +#include "sound-player.h" G_BEGIN_DECLS @@ -55,7 +56,7 @@ struct _IndicatorPowerNotifierClass GType indicator_power_notifier_get_type (void); -IndicatorPowerNotifier * indicator_power_notifier_new (void); +IndicatorPowerNotifier * indicator_power_notifier_new (IndicatorPowerSoundPlayer * sound_player); void indicator_power_notifier_set_bus (IndicatorPowerNotifier * self, GDBusConnection * connection); @@ -63,6 +64,9 @@ void indicator_power_notifier_set_bus (IndicatorPowerNotifier * self, void indicator_power_notifier_set_battery (IndicatorPowerNotifier * self, IndicatorPowerDevice * battery); +void indicator_power_notifier_set_sound_player (IndicatorPowerNotifier * self, + IndicatorPowerSoundPlayer * battery); + #define POWER_LEVEL_STR_OK "ok" #define POWER_LEVEL_STR_LOW "low" #define POWER_LEVEL_STR_VERY_LOW "very_low" -- cgit v1.2.3 From bdc03e1cddb8811651f22e0bb423bf3385cbc793 Mon Sep 17 00:00:00 2001 From: charles kerr Date: Fri, 1 Jan 2016 16:12:16 -0600 Subject: update copyright years on changed/new files --- src/notifier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/notifier.h') diff --git a/src/notifier.h b/src/notifier.h index 9625c07..602f6e5 100644 --- a/src/notifier.h +++ b/src/notifier.h @@ -1,5 +1,5 @@ /* - * Copyright 2014 Canonical Ltd. + * Copyright 2014-2016 Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published -- cgit v1.2.3 From f4d66118c3a845892b32495efec3d6473e17baca Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 1 Feb 2016 10:53:07 -0600 Subject: for low power notifications, use libnotify's 'sound-file' property instead of indicator-power calling the sound player directly --- src/notifier.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/notifier.h') diff --git a/src/notifier.h b/src/notifier.h index 602f6e5..1b04943 100644 --- a/src/notifier.h +++ b/src/notifier.h @@ -23,7 +23,6 @@ #include #include "device.h" -#include "sound-player.h" G_BEGIN_DECLS @@ -56,7 +55,7 @@ struct _IndicatorPowerNotifierClass GType indicator_power_notifier_get_type (void); -IndicatorPowerNotifier * indicator_power_notifier_new (IndicatorPowerSoundPlayer * sound_player); +IndicatorPowerNotifier * indicator_power_notifier_new (void); void indicator_power_notifier_set_bus (IndicatorPowerNotifier * self, GDBusConnection * connection); @@ -64,9 +63,6 @@ void indicator_power_notifier_set_bus (IndicatorPowerNotifier * self, void indicator_power_notifier_set_battery (IndicatorPowerNotifier * self, IndicatorPowerDevice * battery); -void indicator_power_notifier_set_sound_player (IndicatorPowerNotifier * self, - IndicatorPowerSoundPlayer * battery); - #define POWER_LEVEL_STR_OK "ok" #define POWER_LEVEL_STR_LOW "low" #define POWER_LEVEL_STR_VERY_LOW "very_low" -- cgit v1.2.3