Merge lp:~tintou/wingpanel-indicator-sound/no-custom-binding into lp:~wingpanel-devs/wingpanel-indicator-sound/trunk

Proposed by Corentin Noël
Status: Needs review
Proposed branch: lp:~tintou/wingpanel-indicator-sound/no-custom-binding
Merge into: lp:~wingpanel-devs/wingpanel-indicator-sound/trunk
Diff against target: 40 lines (+4/-7)
1 file modified
src/Services/Volume-control.vala (+4/-7)
To merge this branch: bzr merge lp:~tintou/wingpanel-indicator-sound/no-custom-binding
Reviewer Review Type Date Requested Status
WingPanel Devs Pending
Review via email: mp+313796@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

138. By Corentin Noël

Use the vapi directly

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Services/Volume-control.vala'
--- src/Services/Volume-control.vala 2016-09-09 21:03:14 +0000
+++ src/Services/Volume-control.vala 2016-12-22 19:13:11 +0000
@@ -21,7 +21,7 @@
21 * Ted Gould <ted@canonical.com>21 * Ted Gould <ted@canonical.com>
22 */22 */
2323
24 public abstract class Sound.Services.VolumeControl : Object {24public abstract class Sound.Services.VolumeControl : Object {
25 public enum VolumeReasons {25 public enum VolumeReasons {
26 PULSE_CHANGE,26 PULSE_CHANGE,
27 ACCOUNTS_SERVICE_SET,27 ACCOUNTS_SERVICE_SET,
@@ -49,10 +49,7 @@
49 public bool headphone_plugged { get; protected set; default = false; }49 public bool headphone_plugged { get; protected set; default = false; }
5050
51 public abstract void set_mute (bool mute);51 public abstract void set_mute (bool mute);
52 }52}
53
54[CCode(cname="pa_cvolume_set", cheader_filename = "pulse/volume.h")]
55extern unowned PulseAudio.CVolume? vol_set (PulseAudio.CVolume? cv, uint channels, PulseAudio.Volume v);
5653
57public class Sound.Services.VolumeControlPulse : VolumeControl {54public class Sound.Services.VolumeControlPulse : VolumeControl {
58 /* this is static to ensure it being freed after @context (loop does not have ref counting) */55 /* this is static to ensure it being freed after @context (loop does not have ref counting) */
@@ -643,7 +640,7 @@
643 void set_mic_volume_get_server_info_cb (PulseAudio.Context c, PulseAudio.ServerInfo? i) {640 void set_mic_volume_get_server_info_cb (PulseAudio.Context c, PulseAudio.ServerInfo? i) {
644 if (i != null) {641 if (i != null) {
645 unowned PulseAudio.CVolume cvol = PulseAudio.CVolume ();642 unowned PulseAudio.CVolume cvol = PulseAudio.CVolume ();
646 cvol = vol_set (cvol, 1, double_to_volume (_mic_volume));643 cvol = cvol.set (1, double_to_volume (_mic_volume));
647 c.set_source_volume_by_name (i.default_source_name, cvol, set_mic_volume_success_cb);644 c.set_source_volume_by_name (i.default_source_name, cvol, set_mic_volume_success_cb);
648 }645 }
649 }646 }
@@ -833,4 +830,4 @@
833 }830 }
834 return false; // G_SOURCE_REMOVE831 return false; // G_SOURCE_REMOVE
835 }832 }
836}
837\ No newline at end of file833\ No newline at end of file
834}

Subscribers

People subscribed via source and target branches

to all changes: