diff --git a/Images/Advanced.png b/Images/Advanced.png
new file mode 100644
index 0000000..75b026d
Binary files /dev/null and b/Images/Advanced.png differ
diff --git a/Images/Filter.png b/Images/Filter.png
index 55d27b6..bd51fa6 100644
Binary files a/Images/Filter.png and b/Images/Filter.png differ
diff --git a/Images/Input.png b/Images/Input.png
index 97473e5..2034b4e 100644
Binary files a/Images/Input.png and b/Images/Input.png differ
diff --git a/Images/Joystick.png b/Images/Joystick.png
new file mode 100644
index 0000000..8efc33c
Binary files /dev/null and b/Images/Joystick.png differ
diff --git a/Images/Transmitter.png b/Images/Transmitter.png
new file mode 100644
index 0000000..a124a77
Binary files /dev/null and b/Images/Transmitter.png differ
diff --git a/SharpPropoPlus.Audio/AudioHelper.cs b/SharpPropoPlus.Audio/AudioHelper.cs
index 349be5b..3a80f9f 100644
--- a/SharpPropoPlus.Audio/AudioHelper.cs
+++ b/SharpPropoPlus.Audio/AudioHelper.cs
@@ -12,6 +12,7 @@
using CSCore.Win32;
using SharpPropoPlus.Audio.Enums;
using SharpPropoPlus.Audio.EventArguments;
+using SharpPropoPlus.Audio.Interfaces;
using SharpPropoPlus.Audio.Models;
using SharpPropoPlus.Contracts.EventArguments;
using SharpPropoPlus.Events;
@@ -26,8 +27,8 @@ public class AudioHelper : IDisposable
//private bool _quitPolling;
private CancellationTokenSource _pollingCancellationTokenSource;
private readonly MMDeviceEnumerator _deviceEnumerator;
- private string _deviceId;
- private string _deviceName;
+ //private string _deviceId;
+ private IAudioEndPoint _device;
private readonly PeakValues _lastPeakValues;
private static readonly object _sync = new object();
private static volatile AudioHelper _instance;
@@ -61,8 +62,8 @@ private AudioHelper()
_currentDevice = GetDefaultDevice();
- DeviceId = _currentDevice.DeviceID;
- DeviceName = _currentDevice.FriendlyName;
+ //DeviceId = _currentDevice.DeviceID;
+ Device = new AudioEndPoint(_currentDevice.FriendlyName, _currentDevice.DeviceID, GetDeviceFormat(_currentDevice).Channels, _currentDevice.DeviceState != DeviceState.Active, (int?)((_currentDevice.GetJackDescriptions()?.FirstOrDefault())?.Color)?.Value); ;
_isStartUp = false;
}
@@ -153,17 +154,17 @@ public static AudioHelper Instance
}
}
- public string DeviceName
+ public IAudioEndPoint Device
{
- get { return _deviceName; }
- private set { _deviceName = value; }
+ get { return _device; }
+ private set { _device = value; }
}
- public string DeviceId
- {
- get { return _deviceId; }
- private set { _deviceId = value; }
- }
+ //public string DeviceId
+ //{
+ // get { return _deviceId; }
+ // private set { _deviceId = value; }
+ //}
public AudioChannel Channel
{
@@ -259,65 +260,19 @@ private WaveFormat GetDeviceFormat(MMDevice device)
return new WaveFormat();
}
- private void StartRecording(MMDevice device)
+ private void StartRecording(MMDevice mmDevice)
{
StopRecording();
- if (device == null || device.DataFlow != DataFlow.Capture)
- throw new ArgumentNullException(nameof(device), "Selected Audio device is invalid.");
-
- DeviceId = device.DeviceID;
- DeviceName = device.FriendlyName;
-
- //for (var i = 0; i < device.Properties.Count; i++)
- //{
- // object value = null;
- // try
- // {
- // value = device.Properties[i].Value;
- // }
- // catch (Exception)
- // {
- // value = null;
- // }
-
- // if (value != null && value.GetType() == typeof(byte[]))
- // {
- // if (((byte[]) value).Any())
- // {
- // value = string.Join(":", ((byte[])value).Select(s => $"{s:X}"));
-
- // }
- // else
- // {
- // value = null;
- // }
- // }
- // Debug.WriteLine("{0}: {1}\n\t{2}", i, device.Properties[i].Key.formatId, value);
- //}
-
+ if (mmDevice == null || mmDevice.DataFlow != DataFlow.Capture)
+ throw new ArgumentNullException(nameof(mmDevice), "Selected Audio device is invalid.");
- //device.AudioEndpointVolume.OnVolumeNotification += delegate(AudioVolumeNotificationData data)
- //{
- // GlobalEventAggregator.Instance.SendMessage(new PeakValueEventArgs(new PeakValues(data.Muted, data.MasterVolume, data.ChannelVolume[0], data.ChannelVolume[1])));
- //};
+ Device = new AudioEndPoint(mmDevice.FriendlyName, mmDevice.DeviceID, GetDeviceFormat(mmDevice).Channels, mmDevice.DeviceState != DeviceState.Active, (int?)((mmDevice.GetJackDescriptions()?.FirstOrDefault())?.Color)?.Value);
+ var deviceFormat = GetDeviceFormat(mmDevice);
- //var x = _deviceEnumerator.EnumerateAudioEndPoints(DataFlow.Capture, DeviceState.All)
- // .FirstOrDefault(w => w.ID == _deviceId);
-
-
-
- //deviceFormat = new WaveFormat(192000, 16, deviceFormat.Channels);
-
- var deviceFormat = GetDeviceFormat(device);
-
- //var channels = deviceFormat.Channels;
-
- var jackDescription = device.GetJackDescriptions()?.FirstOrDefault();
-
- var audioEndPointArgs = new AudioEndPointEventArgs(device.FriendlyName, device.DeviceID, deviceFormat.Channels, device.DeviceState != DeviceState.Active, (int?)(jackDescription?.Color)?.Value);
+ var audioEndPointArgs = new AudioEndPointEventArgs(Device.DeviceName, Device.DeviceId, deviceFormat.Channels, Device.Disabled, Device.JackColor);
AudioEndPointChanged?.Invoke(this, audioEndPointArgs);
GlobalEventAggregator.Instance.SendMessage(audioEndPointArgs);
@@ -325,12 +280,11 @@ private void StartRecording(MMDevice device)
new WasapiCapture(false, AudioClientShareMode.Shared, 0, deviceFormat,
ThreadPriority.Highest)
{
- Device = device
+ Device = mmDevice
};
_soundIn.Initialize();
- //var soundInSource = new SoundInSource(_soundIn);
SoundInSource soundInSource = new SoundInSource(_soundIn)
{
FillWithZeros = false
@@ -347,9 +301,6 @@ private void StartRecording(MMDevice device)
//byte[] buffer = new byte[_finalSource.WaveFormat.BytesPerSecond / 2];
soundInSource.DataAvailable += SoundInSourceOnDataAvailable;
-
- //singleBlockNotificationStream.SingleBlockRead += SingleBlockNotificationStreamOnSingleBlockRead;
-
_soundIn.Start();
PollAudioLevels();
diff --git a/SharpPropoPlus.Audio/EventArguments/DeviceInfoEventArgs.cs b/SharpPropoPlus.Audio/EventArguments/DeviceInfoEventArgs.cs
index 79f94ca..5e21e46 100644
--- a/SharpPropoPlus.Audio/EventArguments/DeviceInfoEventArgs.cs
+++ b/SharpPropoPlus.Audio/EventArguments/DeviceInfoEventArgs.cs
@@ -5,15 +5,15 @@ namespace SharpPropoPlus.Audio.EventArguments
{
public class AudioEndPointEventArgs : EventArgs, IAudioEndPoint
{
- public string DeviceName { get; }
+ public string DeviceName { get; internal set; }
- public string DeviceId { get; }
+ public string DeviceId { get; internal set; }
- public int Channels { get; }
+ public int Channels { get; internal set; }
- public bool Disabled { get; }
+ public bool Disabled { get; internal set; }
- public int? DeviceColor { get; }
+ public int? JackColor { get; internal set; }
public AudioEndPointEventArgs()
{
@@ -26,7 +26,7 @@ public AudioEndPointEventArgs(string deviceName, string deviceId, int channels,
DeviceId = deviceId;
Channels = channels;
Disabled = disabled;
- DeviceColor = deviceColor;
+ JackColor = deviceColor;
}
}
}
\ No newline at end of file
diff --git a/SharpPropoPlus.Audio/Interfaces/IAudioEndPoint.cs b/SharpPropoPlus.Audio/Interfaces/IAudioEndPoint.cs
index 4961598..c5d2361 100644
--- a/SharpPropoPlus.Audio/Interfaces/IAudioEndPoint.cs
+++ b/SharpPropoPlus.Audio/Interfaces/IAudioEndPoint.cs
@@ -6,5 +6,6 @@ public interface IAudioEndPoint
string DeviceId { get; }
int Channels { get; }
bool Disabled { get; }
+ int? JackColor { get; }
}
}
\ No newline at end of file
diff --git a/SharpPropoPlus.Audio/Models/AudioEndPoint.cs b/SharpPropoPlus.Audio/Models/AudioEndPoint.cs
index d2454fb..58571be 100644
--- a/SharpPropoPlus.Audio/Models/AudioEndPoint.cs
+++ b/SharpPropoPlus.Audio/Models/AudioEndPoint.cs
@@ -4,15 +4,15 @@ namespace SharpPropoPlus.Audio.Models
{
public class AudioEndPoint : IAudioEndPoint
{
- public int? DeviceColor { get; }
+ public int? JackColor { get; internal set; }
- public string DeviceName { get; }
+ public string DeviceName { get; internal set; }
- public string DeviceId { get; }
+ public string DeviceId { get; internal set; }
- public int Channels { get; }
+ public int Channels { get; internal set; }
- public bool Disabled { get; }
+ public bool Disabled { get; internal set; }
public AudioEndPoint(string deviceName, string deviceId, int channels, bool disabled, int? deviceColor)
{
@@ -20,7 +20,7 @@ public AudioEndPoint(string deviceName, string deviceId, int channels, bool disa
DeviceId = deviceId;
Channels = channels;
Disabled = disabled;
- DeviceColor = deviceColor;
+ JackColor = deviceColor;
}
}
}
\ No newline at end of file
diff --git a/SharpPropoPlus/Properties/app.manifest b/SharpPropoPlus/Properties/app.manifest
new file mode 100644
index 0000000..cd90d8b
--- /dev/null
+++ b/SharpPropoPlus/Properties/app.manifest
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SharpPropoPlus/SharpPropoPlus.csproj b/SharpPropoPlus/SharpPropoPlus.csproj
index d131400..0f99492 100644
--- a/SharpPropoPlus/SharpPropoPlus.csproj
+++ b/SharpPropoPlus/SharpPropoPlus.csproj
@@ -81,7 +81,7 @@
SharpPropoPlus_TemporaryKey.pfx
- true
+ false
false
@@ -95,6 +95,12 @@
Always
+
+ LocalIntranet
+
+
+ Properties\app.manifest
+
..\packages\Unity.5.7.3\lib\net46\CommonServiceLocator.dll
@@ -355,6 +361,7 @@
+
SettingsSingleFileGenerator
Settings.Designer.cs
diff --git a/SharpPropoPlus/ViewModels/AudioConfigViewModel.cs b/SharpPropoPlus/ViewModels/AudioConfigViewModel.cs
index 0ebcc8d..044db57 100644
--- a/SharpPropoPlus/ViewModels/AudioConfigViewModel.cs
+++ b/SharpPropoPlus/ViewModels/AudioConfigViewModel.cs
@@ -40,7 +40,7 @@ public AudioConfigViewModel()
new ReadOnlyObservableCollection(new ObservableCollection(AudioHelper.Instance.Devices));
SelectedAudioEndPoint =
- AudioEndPointCollection.FirstOrDefault(fd => fd.DeviceId == AudioHelper.Instance.DeviceId);
+ AudioEndPointCollection.FirstOrDefault(fd => fd.DeviceId == AudioHelper.Instance.Device.DeviceId);
_selectedBitrateItem = AudioHelper.Instance.Bitrate;
_selectedChannelItem = AudioHelper.Instance.Channel;
diff --git a/SharpPropoPlus/ViewModels/OverviewViewModel.cs b/SharpPropoPlus/ViewModels/OverviewViewModel.cs
index 1ab8682..7641934 100644
--- a/SharpPropoPlus/ViewModels/OverviewViewModel.cs
+++ b/SharpPropoPlus/ViewModels/OverviewViewModel.cs
@@ -4,6 +4,7 @@
using SharpPropoPlus.Audio;
using SharpPropoPlus.Audio.Enums;
using SharpPropoPlus.Audio.EventArguments;
+using SharpPropoPlus.Audio.Interfaces;
using SharpPropoPlus.Contracts.Enums;
using SharpPropoPlus.Contracts.EventArguments;
using SharpPropoPlus.Decoder;
@@ -20,7 +21,7 @@ namespace SharpPropoPlus.ViewModels
public class OverviewViewModel : BaseViewModel
{
private string _prefferedChannel = string.Empty;
- private string _deviceName = string.Empty;
+ private IAudioEndPoint _device = null;
private int _rawChannels;
private string _joystickName = string.Empty;
private string _decoderName;
@@ -56,7 +57,7 @@ public OverviewViewModel()
FilterDescription = currentFilter.Description;
IsFilterEnabled = Application.Instance.FilterManager.IsEnabled;
- DeviceName = AudioHelper.Instance.DeviceName;
+ Device = AudioHelper.Instance.Device;
JoystickName = JoystickInteraction.Instance.CurrentDevice.Name;
ChannelData = new ObservableCollection()
@@ -227,8 +228,7 @@ private void AudioEndPointListner(AudioEndPointEventArgs args)
if (args == null)
return;
- DeviceName = args.DeviceName;
- DeviceColor = args.DeviceColor;
+ Device = args;
}
private void PrefferedChannelListner(PreferredChannelEventArgs args)
@@ -239,30 +239,16 @@ private void PrefferedChannelListner(PreferredChannelEventArgs args)
PrefferedChannel = args.Channel.ToString();
}
- public string DeviceName
+ public IAudioEndPoint Device
{
- get => _deviceName;
+ get => _device;
private set
{
- if (_deviceName == value)
+ if (_device == value)
return;
- _deviceName = value;
- OnPropertyChanged();
- }
- }
-
- public int? DeviceColor
- {
- get => _deviceColor;
-
- private set
- {
- if (_deviceColor == value)
- return;
-
- _deviceColor = value;
+ _device = value;
OnPropertyChanged();
}
}
diff --git a/SharpPropoPlus/Views/Overview.xaml b/SharpPropoPlus/Views/Overview.xaml
index 3852e03..9e16467 100644
--- a/SharpPropoPlus/Views/Overview.xaml
+++ b/SharpPropoPlus/Views/Overview.xaml
@@ -62,7 +62,7 @@
-
+
@@ -88,14 +88,14 @@
-