aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/indicator-sound.c11
-rw-r--r--src/indicator-sound.h5
2 files changed, 14 insertions, 2 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 546f404..3aca517 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -300,11 +300,22 @@ gint get_state()
return current_state;
}
+gchar* get_state_image_name(gint state)
+{
+ return g_hash_table_lookup(volume_states, GINT_TO_POINTER(state));
+}
+
void prepare_for_tests(IndicatorObject *io)
{
+ prepare_state_machine();
get_icon(io);
}
+void tidy_up_hash()
+{
+ g_hash_table_destroy(volume_states);
+}
+
static void update_state(const gint state)
{
/* g_debug("update state beginning - previous_state = %i", previous_state);*/
diff --git a/src/indicator-sound.h b/src/indicator-sound.h
index eaf8948..6d0c85c 100644
--- a/src/indicator-sound.h
+++ b/src/indicator-sound.h
@@ -21,9 +21,10 @@ You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
+// Essentially these are all exported to faciltiate testing
void prepare_state_machine();
void determine_state_from_volume(gdouble volume_percent);
gint get_state();
-// Not nice
+gchar* get_state_image_name(gint state);
void prepare_for_tests(IndicatorObject * io);
+void tidy_up_hash();