Skip to content

Commit

Permalink
feat(autoadd): remove the auto add feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Belphemur committed Apr 3, 2024
1 parent a647935 commit dd39379
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 213 deletions.
25 changes: 13 additions & 12 deletions SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/********************************************************************
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
********************************************************************/
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
********************************************************************/

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -93,6 +93,7 @@ public SoundSwitchConfiguration()
public string CustomNotificationFilePath { get; set; }
public bool NotifyUsingPrimaryScreen { get; set; }

[Obsolete("Feature has been removed")]
public bool AutoAddNewConnectedDevices { get; set; }


Expand Down
20 changes: 0 additions & 20 deletions SoundSwitch/Model/AppModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
using SoundSwitch.Framework.WinApi.Keyboard;
using SoundSwitch.Localization;
using SoundSwitch.Localization.Factory;
using SoundSwitch.Model.Job;
using SoundSwitch.UI.Component;

namespace SoundSwitch.Model
Expand All @@ -57,15 +56,6 @@ private AppModel()

_deviceCyclerManager = new DeviceCyclerManager();
_selectedDevices = null;
MMNotificationClient.Instance.DeviceAdded += (sender, @event) =>
{
if (!AutoAddNewDevice)
{
return;
}

JobScheduler.Instance.ScheduleJob(new DeviceAddedJob(this, @event.DeviceId));
};
_microphoneMuteToggler = new MicrophoneMuteToggler(AudioSwitcher.Instance, _notificationManager);
_updateScheduler = new LimitedConcurrencyLevelTaskScheduler(1);
}
Expand Down Expand Up @@ -252,16 +242,6 @@ public bool NotifyUsingPrimaryScreen
}
}

public bool AutoAddNewDevice
{
get => AppConfigs.Configuration.AutoAddNewConnectedDevices;
set
{
AppConfigs.Configuration.AutoAddNewConnectedDevices = value;
AppConfigs.Configuration.Save();
}
}

#region Misc settings

/// <summary>
Expand Down
27 changes: 13 additions & 14 deletions SoundSwitch/Model/IAppModel.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/********************************************************************
* Copyright (C) 2015 Jeroen Pelgrims
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
********************************************************************/
* Copyright (C) 2015 Jeroen Pelgrims
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
********************************************************************/

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -117,7 +117,6 @@ public interface IAppModel : IDisposable
bool Telemetry { get; set; }
bool QuickMenuEnabled { get; set; }
bool KeepVolumeEnabled { get; set; }
bool AutoAddNewDevice { get; set; }

#endregion

Expand Down
69 changes: 0 additions & 69 deletions SoundSwitch/Model/Job/DeviceAddedJob.cs

This file was deleted.

Loading

0 comments on commit dd39379

Please sign in to comment.