private async Task HandleMuteChange(KeyCoordinates coordinates) { // Get the index of the app in the applications list int appIndex = (currentPage * appsPerPage) + coordinates.Column - ACTION_KEY_COLUMN_START; if (appIndex >= audioApps.Count) { Logger.Instance.LogMessage(TracingLevel.ERROR, $"HandleVolumeChange: AppIndex is out of range! Index: {appIndex} Apps: {audioApps?.Count}"); return; } await AppVolume.ToggleAppMute(audioApps[appIndex].Name); }
private async Task HandleVolumeChange(KeyCoordinates coordinates) { // Get the index of the app in the applications list int appIndex = (currentPage * appsPerPage) + coordinates.Column - ACTION_KEY_COLUMN_START; if (appIndex >= audioApps.Count) { Logger.Instance.LogMessage(TracingLevel.ERROR, $"HandleVolumeChange: AppIndex is out of range! Index: {appIndex} Apps: {audioApps?.Count}"); return; } int absVolumeStep = Math.Abs(mixerSettings.VolumeStep); if (coordinates.Row == MINUS_KEY_ROW) { absVolumeStep *= -1; // Make it DECREASE the amount } await AppVolume.AdjustAppVolume(audioApps[appIndex].Name, absVolumeStep); }
private async Task FetchAudioApplications() { audioApps = await AppVolume.GetVolumeApplicationsStatus(); }