Skip to content

Commit

Permalink
show notification on mute/unmute. fix travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Junker committed Nov 17, 2019
1 parent c918f22 commit e1d5011
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ addons:
- libgee-0.8-dev
- libpulse-dev
- libgtk-3-dev
- libnotify-dev
- ninja-build
- meson

script:
- mkdir builddir
- meson ./ ./builddir
- ninja -C builddir
- ninja -C builddir test
- ninja -C builddir test
2 changes: 1 addition & 1 deletion src/mictray.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MicTrayApp : Gtk.Application
{
status_icon.update();

if (config.show_notifications && pulse.old_volume != pulse.volume)
if (config.show_notifications && pulse.old_volume != pulse.volume || pulse.old_muted != pulse.muted)
{
try
{
Expand Down
2 changes: 2 additions & 0 deletions src/pulse.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class Pulse : Object
public int volume;
public int old_volume;
public bool muted;
public bool old_muted;

public Callback change_callback;
public Callback source_change_callback;
Expand Down Expand Up @@ -184,6 +185,7 @@ public class Pulse : Object

this.old_volume = this.volume;
this.volume = (int)((info.volume.avg() / (float)PulseAudio.Volume.NORM) * 100);
this.old_muted = this.muted;
this.muted = (bool)info.mute;

this.change_callback();
Expand Down

0 comments on commit e1d5011

Please sign in to comment.