-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Camera, Microphone, Driver, Interpreter, and Experiment Selection Tab all are persistent now using the C# configuration manager. 2021.1 is feature complete!
- Loading branch information
1 parent
3713407
commit 9df1839
Showing
18 changed files
with
391 additions
and
76 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
@@ -1,23 +1,28 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<OutputPath>..\ProtocolMasterWPF\bin\Debug\netcoreapp3.1\Extensions\</OutputPath> | ||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
<WarningLevel>5</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<OutputPath>..\ProtocolMasterWPF\bin\Debug\netcoreapp3.1\Extensions\</OutputPath> | ||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
<WarningLevel>5</WarningLevel> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="SerialPortStream" Version="2.2.2" /> | ||
</ItemGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<OutputPath>..\ProtocolMasterWPF\bin\Release\netcoreapp3.1\Extensions\</OutputPath> | ||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\ProtocolMasterCore\ProtocolMasterCore.csproj"> | ||
<Private>false</Private> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="SerialPortStream" Version="2.2.2" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\ProtocolMasterCore\ProtocolMasterCore.csproj"> | ||
<Private>false</Private> | ||
</ProjectReference> | ||
</ItemGroup> | ||
|
||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using ProtocolMasterCore.Protocol; | ||
using ProtocolMasterCore.Protocol.Driver; | ||
using ProtocolMasterCore.Protocol.Interpreter; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Text; | ||
|
||
namespace ProtocolMasterWPF.Model | ||
{ | ||
[Serializable] | ||
public sealed class ExtensionMetaSetting : IExtensionMeta | ||
{ | ||
public string Name { get; set; } | ||
public string Version { get; set; } | ||
public ExtensionMetaSetting() { } | ||
public ExtensionMetaSetting(IExtensionMeta from) | ||
{ | ||
Name = from.Name; Version = from.Version; | ||
} | ||
public bool Equals([AllowNull] IExtensionMeta other) | ||
{ | ||
return this.Name == other.Name && this.Version == other.Version; | ||
} | ||
} | ||
} |
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,60 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.Devices.Enumeration; | ||
|
||
namespace ProtocolMasterWPF.Model | ||
{ | ||
internal class MediaDevices : Observable | ||
{ | ||
private static MediaDevices instance = new MediaDevices(); | ||
public static MediaDevices Instance { get => instance; } | ||
static MediaDevices() { } | ||
private MediaDevices() | ||
{ | ||
RefreshDevices(); | ||
} | ||
private DeviceInformationCollection _videoDevices; | ||
|
||
public DeviceInformationCollection VideoDevices | ||
{ | ||
get => _videoDevices; | ||
set | ||
{ | ||
_videoDevices = value; | ||
NotifyProperty(); | ||
} | ||
} | ||
public void RefreshDevices() | ||
{ | ||
Task<DeviceInformationCollection> task = DeviceInformation.FindAllAsync(DeviceClass.VideoCapture).AsTask(); | ||
task.Wait(); | ||
VideoDevices = task.Result; | ||
task.Dispose(); | ||
|
||
task = DeviceInformation.FindAllAsync(DeviceClass.AudioCapture).AsTask(); | ||
task.Wait(); | ||
AudioDevices = task.Result; | ||
} | ||
private DeviceInformationCollection _audioDevices; | ||
public DeviceInformationCollection AudioDevices | ||
{ | ||
get => _audioDevices; | ||
set | ||
{ | ||
_audioDevices = value; | ||
NotifyProperty(); | ||
} | ||
} | ||
public DeviceInformation AudioDeviceByID(string id) | ||
{ | ||
return AudioDevices.First(a => a.Id == id); | ||
} | ||
public DeviceInformation VideoDeviceByID(string id) | ||
{ | ||
return VideoDevices.First(a => a.Id == id); | ||
} | ||
} | ||
} |
Oops, something went wrong.