Compare commits

..

No commits in common. "main" and "v1.3.1-pre" have entirely different histories.

6 changed files with 2 additions and 84 deletions

View File

@ -17,7 +17,6 @@ public class AudioHelper
int _retryFallbackCount = 0;
public List<Override> Overrides { get; set; }
public List<string> Ignored { get; set; }
public IAudioSession Current { get; private set; }
@ -147,13 +146,7 @@ public class AudioHelper
if (_currentProcesses == null || !_currentProcesses.SequenceEqual(processIds) || _retryFallbackCount == 5)
{
_retryFallbackCount = 0;
var newSession = FindSession(processes);
if(newSession != null || fallbackBehavior != FallbackBehavior.PreviousApp)
{
Current = newSession;
}
Current = FindSession(processes);
}
else if(Current is SystemSoundsAudioSession || Current is SystemVolumeAudioSession)
{
@ -224,11 +217,6 @@ public class AudioHelper
{
return new List<Process>();
}
if(processes.Any(x => Ignored.Contains(x.ProcessName)))
{
return new List<Process>();
}
try
{

View File

@ -33,16 +33,12 @@ public class DialAction : EncoderBase
[JsonProperty("overrides")]
public string Overrides { get; set; }
[JsonProperty("ignored")]
public string Ignored { get; set; }
public static PluginSettings CreateDefaultSettings()
{
PluginSettings instance = new PluginSettings();
instance.FallbackBehavior = FallbackBehavior.SystemSounds;
instance.StepSize = 1;
instance.Overrides = DefaultOverrides;
instance.Ignored = "";
return instance;
}
}
@ -61,20 +57,9 @@ public class DialAction : EncoderBase
else
{
settings = payload.Settings.ToObject<PluginSettings>();
bool save = false;
if(string.IsNullOrEmpty(settings.Overrides))
{
settings.Overrides = DefaultOverrides;
save = true;
}
if(string.IsNullOrEmpty(settings.Ignored))
{
settings.Ignored = "";
save = true;
}
if(save)
{
_ = SaveSettings();
}
}
@ -84,7 +69,6 @@ public class DialAction : EncoderBase
try
{
_audioHelper.Overrides = OverrideParser.Parse(settings.Overrides);
_audioHelper.Ignored = IgnoreParser.Parse(settings.Ignored);
//just in case we fail to get the active session, don't prevent the plugin from launching
var session = _audioHelper.GetActiveSession(settings.FallbackBehavior);
_ = UpdateStateIfNeeded(session);
@ -254,7 +238,6 @@ public class DialAction : EncoderBase
{
Tools.AutoPopulateSettings(settings, payload.Settings);
_audioHelper.Overrides = OverrideParser.Parse(settings.Overrides);
_audioHelper.Ignored = IgnoreParser.Parse(settings.Ignored);
//_ = SaveSettings();
}
catch (Exception ex)

View File

@ -67,7 +67,6 @@
<Compile Include="FallbackBehavior.cs" />
<Compile Include="AudioHelpers\NameAndIconHelper.cs" />
<Compile Include="InternalsVisibleTo.cs" />
<Compile Include="Overrides\IgnoreParser.cs" />
<Compile Include="Overrides\Override.cs" />
<Compile Include="Overrides\MatchType.cs" />
<Compile Include="Overrides\OverrideParser.cs" />

View File

@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FocusVolumeControl.Overrides
{
internal class IgnoreParser
{
public static List<string> Parse(string raw)
{
var ignores = new List<string>();
if (raw == null)
{
return ignores;
}
var lines = raw.Split(new[] { "\r\n", "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries);
foreach (var line in lines)
{
if (string.IsNullOrEmpty(line) || line.StartsWith("//"))
{
continue;
}
var str = line.Trim();
ignores.Add(line.Trim());
}
return ignores;
}
}
}

View File

@ -61,22 +61,6 @@
</details>
<div type="textarea" class="sdpi-item">
<div class="sdpi-item-label">Ignored</div>
<span class="sdpi-item-value" textarea>
<textarea type="textarea" class="sdProperty" id="ignored" oninput="setSettings()"></textarea>
</span>
</div>
<details>
<summary>Ignored Details</summary>
<p>Sometimes you may not want certain processes to be controlable.</p>
<p>In this case, you can add a list of process names which will be ignored.</p>
<p>ex:<br /> chrome</p>
<p>Blank lines can be used for spacing<br/>Lines starting with // are ignored</p>
<p>To get a process name, you can use task manager, right click on a process and select properties</p>
<p>Process names are case sensitive and must match exactly</p>
</details>
</div>
</body>

View File

@ -33,7 +33,7 @@
"Name": "Focused Application Volume",
"Description": "Control the volume of the focused application",
"URL": "https://github.com/dlprows/FocusVolumeControl",
"Version": "1.4.0",
"Version": "1.3.1",
"CodePath": "FocusVolumeControl",
"Category": "Volume Control [dlprows]",
"Icon": "Images/pluginIcon",