Skip to content

Commit

Permalink
Change my logs to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
R-N committed Mar 23, 2022
1 parent 3e452e1 commit 16a0d0f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
22 changes: 11 additions & 11 deletions PiP-Tool/DataModel/AudioControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,18 @@ internal void GetControls(DataFlow dataFlow)

if (audioControls0.Count == 0)
{
Logger.Instance.Info("Found no audio control");
Logger.Instance.Debug("Found no audio control");
DisposeControls();
return;
}

/*
if (audioControls0.Count == 0) {
Logger.Instance.Info("Getting controls by root");
Logger.Instance.Debug("Getting controls by root");
audioControls0 = GetControls(dataFlow, x => (
new ProcessInfo(x.ProcessID).GetRootProcess().ProcessId == this.selectedWindow.GetRootProcess().ProcessId
));
Logger.Instance.Info("Getting controls by root done");
Logger.Instance.Debug("Getting controls by root done");
}
*/

Expand All @@ -125,12 +125,12 @@ internal void GetControls(DataFlow dataFlow)
/*
if (audioControls2.Count == 0)
{
Logger.Instance.Info("Filtering controls by root");
Logger.Instance.Debug("Filtering controls by root");
audioControls2 = audioControls0.Where(x => (
x.Process.Program == this.selectedWindow.Program
&& x.Process.GetRootProcess().ProcessId == this.selectedWindow.GetRootProcess().ProcessId
)).ToList();
Logger.Instance.Info("Filtering controls by root done");
Logger.Instance.Debug("Filtering controls by root done");
}
*/
if (audioControls2.Count == 0) {
Expand All @@ -141,27 +141,27 @@ internal void GetControls(DataFlow dataFlow)
/*
if (audioControls2.Count == 0)
{
Logger.Instance.Info("Filtering controls by root2");
Logger.Instance.Debug("Filtering controls by root2");
audioControls2 = audioControls0.Where(x => (
x.Process.GetRootProcess().ProcessId == this.selectedWindow.GetRootProcess().ProcessId
)).ToList();
Logger.Instance.Info("Filtering controls by root2 done");
Logger.Instance.Debug("Filtering controls by root2 done");
}
*/

if (audioControls2.Count == 0)
{
Logger.Instance.Info("Found no audio control");
Logger.Instance.Debug("Found no audio control");
DisposeControls();
return;
}
DisposeControls();
this.audioControls = audioControls2.ToArray();
Logger.Instance.Info("Found " + audioControls.Length + " audio controls");
Logger.Instance.Debug("Found " + audioControls.Length + " audio controls");
foreach(AudioControl control in this.audioControls)
{
control.RegisterAudioSessionNotification(sessionEvents);
Logger.Instance.Info("AudioController " + control.Process.Program + " " + control.Process.Title);
Logger.Instance.Debug("AudioController " + control.Process.Program + " " + control.Process.Title);
}
}
internal void SetAllMasterVolume(float volume)
Expand All @@ -170,7 +170,7 @@ internal void SetAllMasterVolume(float volume)
{
if (control.MasterVolume != volume) {
control.MasterVolume = volume;
Logger.Instance.Info("Notified mixer changed to " + control.MasterVolume);
Logger.Instance.Debug("Notified mixer changed to " + control.MasterVolume);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion PiP-Tool/DataModel/ProcessInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ internal int GetParentProcessId()

}
this.parentProcessId = parentProcessId;
Logger.Instance.Info("Child-Parent: " + this.ProcessId + " " + this.ParentProcessId);
Logger.Instance.Debug("Child-Parent: " + this.ProcessId + " " + this.ParentProcessId);
return ParentProcessId;
}
internal int GetParentProcessId1()
Expand Down
10 changes: 5 additions & 5 deletions PiP-Tool/ViewModels/VolumeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public double Volume
/// </summary>
public VolumeViewModel()
{
Logger.Instance.Info(" ====== VolumeDialog ====== ");
Logger.Instance.Debug(" ====== VolumeDialog ====== ");

MessengerInstance.Register<AudioControls>(this, InitAudioControls);
LoadedCommand = new RelayCommand(LoadedCommandExecute);
Expand Down Expand Up @@ -81,7 +81,7 @@ private void InitAudioControls(AudioControls audioControls)
this.audioControls = audioControls;
MessengerInstance.Unregister<AudioControls>(this);

Logger.Instance.Info("Init Volume : " + audioControls.SelectedWindow.Title);
Logger.Instance.Debug("Init Volume : " + audioControls.SelectedWindow.Title);
this.audioControls.SessionEvents.SimpleVolumeChanged += OnMixerChanged;
this.Volume = this.audioControls.MasterVolume;
//this.SetSliderValue(this.audioControls.MasterVolume);
Expand All @@ -108,7 +108,7 @@ private void CloseCommandExecute()

private void SetMixerVolume(float volume)
{
Logger.Instance.Info("Setting master volume to " + volume);
Logger.Instance.Debug("Setting master volume to " + volume);
this.audioControls.SetAllMasterVolume(volume);
}

Expand All @@ -133,14 +133,14 @@ private void SetSliderValue(double value)

private void OnMixerChanged(object sender, AudioSessionSimpleVolumeChangedEventArgs e)
{
Logger.Instance.Info("Notified mixer changed to " + e.NewVolume);
Logger.Instance.Debug("Notified mixer changed to " + e.NewVolume);
SetSliderValue(e.NewVolume);
}

public void OnSliderChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
var value = e.NewValue;
Logger.Instance.Info("Slider changed to " + value);
Logger.Instance.Debug("Slider changed to " + value);
if (volume != value)
volume = value;
SetMixerVolume(value);
Expand Down

0 comments on commit 16a0d0f

Please sign in to comment.