public async override void OnTick() { string title = String.Empty; if (String.IsNullOrEmpty(settings.Application) || (!settings.ShowVolume && !settings.ShowAppName)) { return; } if (settings.ShowAppName) { title = settings.Application; } if (settings.ShowVolume) { var appInfo = (await AppVolume.GetVolumeApplicationsStatus()).Where(app => app.Name == settings.Application).FirstOrDefault(); if (appInfo != null) { // Append volume on new line if app name is also selected title = title + (String.IsNullOrEmpty(title) ? "" : "\n") + Math.Round(appInfo.Volume * 100).ToString(); } } await Connection.SetTitleAsync(title); }
private void notifyIcon_MouseMove(object sender, MouseEventArgs e) { if (AppMute) { notifyIcon.Text = "AppVolumeHotkeys\nVolume: " + AppVolume.ToString() + " | Mute: Yes"; } else { notifyIcon.Text = "AppVolumeHotkeys\nVolume: " + AppVolume.ToString() + " | Mute: No"; } }
private bool _IsWhitelisted(AppVolume appVolume) { foreach (string path in this._AppWhitelist) { if (this._DoesPathWildcardMatch(appVolume.Path, path)) { return(true); } } return(false); }
private async void FetchApplications() { // Get all the applications in the Volume Mixer settings.Applications = await AppVolume.GetVolumeApplicationsStatus(); if (settings.Applications == null) { Logger.Instance.LogMessage(TracingLevel.WARN, $"{GetType()} GetVolumeApplicationsNames called but returned null"); return; } Logger.Instance.LogMessage(TracingLevel.INFO, $"{GetType()} FetchApplication returned {settings.Applications.Count} volume apps"); await SaveSettings(); }
public async override void KeyPressed(KeyPayload payload) { Logger.Instance.LogMessage(TracingLevel.INFO, $"{GetType()} Key Pressed"); if (String.IsNullOrEmpty(settings.Application)) { Logger.Instance.LogMessage(TracingLevel.WARN, $"{GetType()} Key Pressed but no application is set"); return; } Logger.Instance.LogMessage(TracingLevel.INFO, $"Setting {settings.Application}'s volume to {volume}"); if (await AppVolume.SetAppVolume(settings.Application, volume)) { await Connection.ShowOk(); } else { await Connection.ShowAlert(); } }
public void WriteVolumeLabel() { AppVolume = volumeMixer.GetApplicationVolume(cmbAppName.SelectedIndex); lblAppVolume.Text = AppVolume.ToString(); }