Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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";
     }
 }
Exemplo n.º 3
0
        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();
            }
        }
Exemplo n.º 6
0
 public void WriteVolumeLabel()
 {
     AppVolume         = volumeMixer.GetApplicationVolume(cmbAppName.SelectedIndex);
     lblAppVolume.Text = AppVolume.ToString();
 }