Skip to content

Commit

Permalink
refactor(Mute::Notification): Remove notification for mute
Browse files Browse the repository at this point in the history
  • Loading branch information
Belphemur committed Sep 4, 2021
1 parent 03009ba commit 96e080a
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public MicrophoneMuteToggler(AudioSwitcher switcher, NotificationManager.Notific
return null;
}

_notificationManager.NotifyMuteChanged(result.Name, result.NewMuteState);
return result.NewMuteState;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,5 @@ public interface INotification : IEnumImpl<NotificationTypeEnum>
/// <param name="profile"></param>
/// <param name="processId"></param>
void NotifyProfileChanged(Profile.Profile profile, uint? processId);

/// <summary>
/// Notify about the mute state having changed
/// </summary>
void NotifyMuteChanged(string microphoneName, bool newMuteState);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,6 @@ public void NotifyProfileChanged(Profile.Profile profile, uint? processId)
_bannerManager.ShowNotification(bannerData);
}

public void NotifyMuteChanged(string microphoneName, bool newMuteState)
{
var title = newMuteState ? string.Format(SettingsStrings.notification_microphone_muted, microphoneName) : string.Format(SettingsStrings.notification_microphone_unmuted, microphoneName);

var icon = newMuteState ? Resources.microphone_muted : Resources.microphone_unmuted;

var bannerData = new BannerData
{
Priority = 2,
Image = icon,
Title = title

};
_bannerManager.ShowNotification(bannerData);
}

public void NotifyDefaultChanged(MMDevice audioDevice)
{
var icon = AudioDeviceIconExtractor.ExtractIconFromAudioDevice(audioDevice, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,5 @@ public void NotifyProfileChanged(Profile.Profile profile, uint? processId)
//Ignored
}
}

public void NotifyMuteChanged(string microphoneName, bool newMuteState)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,5 @@ public bool IsAvailable()
public void NotifyProfileChanged(Profile.Profile profile, uint? processId)
{
}

public void NotifyMuteChanged(string microphoneName, bool newMuteState)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ public void NotifyProfileChanged(Profile.Profile profile, uint? processId)
}
}

public void NotifyMuteChanged(string microphoneName, bool newMuteState)
{
}

private Stream GetStreamCopy()
{
lock (this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,5 @@ public void NotifyProfileChanged(Profile.Profile profile, uint? processId)
var text = string.Join("\n", profile.Devices.Select(wrapper => wrapper.DeviceInfo.NameClean));
Configuration.Icon.ShowBalloonTip(1000, title, text, ToolTipIcon.Info);
}

public void NotifyMuteChanged(string microphoneName, bool newMuteState)
{
var title = newMuteState ? string.Format(SettingsStrings.notification_microphone_muted, microphoneName) : string.Format(SettingsStrings.notification_microphone_unmuted, microphoneName);
Configuration.Icon.ShowBalloonTip(1000, title, microphoneName, ToolTipIcon.Info);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ public void NotifyProfileChanged(Profile.Profile profile, uint? processId)
_notification.NotifyProfileChanged(profile, processId);
}

public void NotifyMuteChanged(string microphoneName, bool newMuteState)
{
_notification.NotifyMuteChanged(microphoneName, newMuteState);
}

~NotificationManager()
{
_model.DefaultDeviceChanged -= ModelOnDefaultDeviceChanged;
Expand Down
12 changes: 11 additions & 1 deletion SoundSwitch/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions SoundSwitch/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="SoundSwitch16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrow-switch-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down Expand Up @@ -202,4 +202,7 @@
<data name="profile-menu-delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\user-times-solid.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="muted_microphone_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\muted_microphone_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

0 comments on commit 96e080a

Please sign in to comment.