-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite completely the listing of devices
Rewrite the caching of the information. Stop using the MMDevice, only use it to gather the needed date. MMDevice is great to list devices, not to be used everywhere as I was doing since it's a COM Object. I created a DeviceFullInfo that contains exactly what the app needs to work. This way it's lighter and resolve the lag issues. Fixes #298 Fixes #293
- Loading branch information
Antoine Aflalo
committed
Nov 21, 2018
1 parent
b107f27
commit 8fcbd63
Showing
31 changed files
with
696 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
SoundSwitch/Framework/Audio/Device/DisposableMMDeviceCollection.cs
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
SoundSwitch/Framework/Configuration/Device/DeviceFullInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Drawing; | ||
using NAudio.CoreAudioApi; | ||
using SoundSwitch.Util; | ||
|
||
namespace SoundSwitch.Framework.Configuration.Device | ||
{ | ||
public class DeviceFullInfo : DeviceInfo | ||
{ | ||
public string IconPath { get; } | ||
public DeviceState State { get; } | ||
|
||
public Icon LargeIcon => AudioDeviceIconExtractor.ExtractIconFromPath(IconPath, Type, true); | ||
public Icon SmallIcon => AudioDeviceIconExtractor.ExtractIconFromPath(IconPath, Type, false); | ||
|
||
public DeviceFullInfo(string name, string id, DataFlow type, string iconPath, DeviceState state) : base(name, id, type) | ||
{ | ||
IconPath = iconPath; | ||
State = state; | ||
} | ||
|
||
public DeviceFullInfo(MMDevice device) : base(device) | ||
{ | ||
IconPath = device.IconPath; | ||
State = device.State; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return Name; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.