Merge lp:~ctf/unity-settings-daemon/bug1389099_mic_volume_icons into lp:ubuntu/trusty/unity-settings-daemon

Proposed by TienFu Chen
Status: Rejected
Rejected by: Robert Ancell
Proposed branch: lp:~ctf/unity-settings-daemon/bug1389099_mic_volume_icons
Merge into: lp:ubuntu/trusty/unity-settings-daemon
Diff against target: 69 lines (+29/-2)
1 file modified
plugins/media-keys/gsd-media-keys-manager.c (+29/-2)
To merge this branch: bzr merge lp:~ctf/unity-settings-daemon/bug1389099_mic_volume_icons
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Review via email: mp+240687@code.launchpad.net

Description of the change

added microphone volume icons support.

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Looks good, thanks!

review: Approve
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Actually, it appears this was already solved?

Unmerged revisions

15. By TienFu Chen

added mic volume icons

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/media-keys/gsd-media-keys-manager.c'
2--- plugins/media-keys/gsd-media-keys-manager.c 2014-03-10 17:25:56 +0000
3+++ plugins/media-keys/gsd-media-keys-manager.c 2014-11-05 08:25:10 +0000
4@@ -210,6 +210,7 @@
5
6 /* Ubuntu notifications */
7 NotifyNotification *volume_notification;
8+ NotifyNotification *mic_volume_notification;
9 NotifyNotification *brightness_notification;
10 NotifyNotification *kb_backlight_notification;
11
12@@ -257,6 +258,12 @@
13 NULL
14 };
15
16+static const char *mic_volume_icons[] = {
17+ "notification-audio-input-microphone-low-zero",
18+ "notification-audio-input-microphone-high",
19+ NULL
20+};
21+
22 static const char *brightness_icons[] = {
23 "notification-display-brightness-off",
24 "notification-display-brightness-low",
25@@ -350,6 +357,15 @@
26 }
27
28 static gboolean
29+ubuntu_osd_notification_show_mic_volume (GsdMediaKeysManager *manager,
30+ gint value,
31+ gboolean muted)
32+{
33+ return ubuntu_osd_do_notification (&manager->priv->mic_volume_notification,
34+ "mic-volume", value, muted, mic_volume_icons);
35+}
36+
37+static gboolean
38 ubuntu_osd_notification_show_brightness (GsdMediaKeysManager *manager,
39 gint value)
40 {
41@@ -1337,8 +1353,13 @@
42 const GvcMixerStreamPort *port;
43 const char *icon;
44
45- if (ubuntu_osd_notification_show_volume (manager, vol, muted))
46- goto done;
47+ if (GVC_IS_MIXER_SINK (stream)) {
48+ if (ubuntu_osd_notification_show_volume (manager, vol, muted))
49+ goto done;
50+ } else {
51+ if (ubuntu_osd_notification_show_mic_volume (manager, vol, muted))
52+ goto done;
53+ }
54
55 vol = CLAMP (vol, 0, 100);
56
57@@ -3115,6 +3136,12 @@
58 priv->volume_notification = NULL;
59 }
60
61+ if (priv->mic_volume_notification != NULL) {
62+ notify_notification_close (priv->mic_volume_notification, NULL);
63+ g_object_unref (priv->mic_volume_notification);
64+ priv->mic_volume_notification = NULL;
65+ }
66+
67 if (priv->brightness_notification != NULL) {
68 notify_notification_close (priv->brightness_notification, NULL);
69 g_object_unref (priv->brightness_notification);

Subscribers

People subscribed via source and target branches

to all changes: