Skip to content

Commit

Permalink
Fixed Audio exceptions, faster startup, added donations button
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFitzZZ committed Feb 4, 2018
1 parent 33d895e commit 95b0d8b
Show file tree
Hide file tree
Showing 41 changed files with 710 additions and 58 deletions.
14 changes: 11 additions & 3 deletions DCS-ConfigMgmt/App.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="DCS_ConfigMgmt.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<userSettings>
<DCS_ConfigMgmt.Properties.Settings>
Expand Down Expand Up @@ -63,4 +63,12 @@
</setting>
</DCS_ConfigMgmt.Properties.Settings>
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="AudioSwitcher.AudioApi" publicKeyToken="fda5729e2db3a64f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.308" newVersion="4.0.0.308" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
37 changes: 20 additions & 17 deletions DCS-ConfigMgmt/Classes/soundswitcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading.Tasks;
using AudioSwitcher.AudioApi;
using AudioSwitcher.AudioApi.CoreAudio;
using AudioSwitcher.AudioApi.Session;
//using AudioSwitcher.AudioApi.Session;

namespace DCS_ConfigMgmt
{
Expand Down Expand Up @@ -64,8 +64,11 @@ public static CoreAudioDevice GetStandardSoundDevice(string sType)
public static void ChangeStandardSoundDevice(CoreAudioDevice device)
{
CoreAudioController Controller = new CoreAudioController();
Controller.SetDefaultDevice(device);
Controller.SetDefaultCommunicationsDevice(device);
//Controller.SetDefaultDevice(device);
//Controller.SetDefaultCommunicationsDevice(device);
//Controller.DefaultPlaybackDevice.SetAsDefault();
device.SetAsDefault();
device.SetAsDefaultCommunications();
}

public static void FindSoundDeviceByName(string sType, string sName)
Expand Down Expand Up @@ -101,24 +104,24 @@ public static void FindSoundDeviceByName(string sType, string sName)
}
}

public static void Test()
{
string test = "Mikrofon (USB Audio Device)";
//public static void Test()
//{
// string test = "Mikrofon (USB Audio Device)";

CoreAudioController Controller = new CoreAudioController();
var devices = Controller.GetCaptureDevices(DeviceState.Active);
// CoreAudioController Controller = new CoreAudioController();
// var devices = Controller.GetCaptureDevices(DeviceState.Active);

foreach (var d in devices)
{
if (d.FullName == test)
{
System.Windows.Forms.MessageBox.Show("Yeah");
}
}
// foreach (var d in devices)
// {
// if (d.FullName == test)
// {
// System.Windows.Forms.MessageBox.Show("Yeah");
// }
// }

return;
// return;

}
//}

}
}
13 changes: 7 additions & 6 deletions DCS-ConfigMgmt/DCS-ConfigMgmt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
<PublisherName>FitzZZ</PublisherName>
<SuiteName>DCS Toolbox</SuiteName>
<MinimumRequiredVersion>1.0.0.5</MinimumRequiredVersion>
<ApplicationRevision>3</ApplicationRevision>
<ApplicationVersion>1.4.0.%2a</ApplicationVersion>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.5.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down Expand Up @@ -91,11 +91,11 @@
<ManifestTimestampUrl>http://timestamp.digicert.com</ManifestTimestampUrl>
</PropertyGroup>
<ItemGroup>
<Reference Include="AudioSwitcher.AudioApi, Version=3.0.0.209, Culture=neutral, PublicKeyToken=fda5729e2db3a64f, processorArchitecture=MSIL">
<HintPath>..\packages\AudioSwitcher.AudioApi.3.0.0\lib\net40\AudioSwitcher.AudioApi.dll</HintPath>
<Reference Include="AudioSwitcher.AudioApi, Version=4.0.0.308, Culture=neutral, PublicKeyToken=fda5729e2db3a64f, processorArchitecture=MSIL">
<HintPath>..\packages\AudioSwitcher.AudioApi.4.0.0-alpha5\lib\net45\AudioSwitcher.AudioApi.dll</HintPath>
</Reference>
<Reference Include="AudioSwitcher.AudioApi.CoreAudio, Version=3.0.0.209, Culture=neutral, PublicKeyToken=fda5729e2db3a64f, processorArchitecture=MSIL">
<HintPath>..\packages\AudioSwitcher.AudioApi.CoreAudio.3.0.0.1\lib\net40\AudioSwitcher.AudioApi.CoreAudio.dll</HintPath>
<Reference Include="AudioSwitcher.AudioApi.CoreAudio, Version=4.0.0.308, Culture=neutral, PublicKeyToken=fda5729e2db3a64f, processorArchitecture=MSIL">
<HintPath>..\packages\AudioSwitcher.AudioApi.CoreAudio.4.0.0-alpha5\lib\net45\AudioSwitcher.AudioApi.CoreAudio.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath>
Expand Down Expand Up @@ -173,6 +173,7 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Resource Include="Resources\donate.png" />
<Resource Include="Resources\icons8-file-528.png" />
<Resource Include="Resources\icons8-settings-528.png" />
<Resource Include="Resources\icons8-support-528.png" />
Expand Down
Binary file added DCS-ConfigMgmt/Installer/DCSCM-Portable-R5.0.zip
Binary file not shown.
Binary file modified DCS-ConfigMgmt/Installer/DCSCM-Setup.zip
Binary file not shown.
18 changes: 11 additions & 7 deletions DCS-ConfigMgmt/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,27 @@
<TabItem Header="About" Margin="4,0,-7,0">
<Grid Background="#FF3F3F46" Margin="10,0,0,0">
<Image x:Name="image924thLogo" RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Left" Height="245" Margin="10,1,0,0" VerticalAlignment="Top" Width="236" Source="Resources/j9241.png" Stretch="Fill"/>
<TextBlock x:Name="textBlock_About" HorizontalAlignment="Left" Margin="251,11,0,0" TextWrapping="WrapWithOverflow" VerticalAlignment="Top" Height="144" Width="320" RenderTransformOrigin="0.5,0.525"><Run FontWeight="Bold" FontSize="22" Text="DCS Configuration Manager"/><LineBreak/><Run FontWeight="Bold" FontSize="16" Text="Version "/><Run FontWeight="Bold" FontSize="16" Text="2017 "/><Run FontWeight="Bold" FontSize="16" Text="R"/><Run FontWeight="Bold" FontSize="16" Text="4"/><LineBreak/><Run FontWeight="Bold"/><LineBreak/><Run Text="Dedicated to "/><Run Text="the 924th vFW"/><LineBreak/><Run Text="Badly written by FitzZZ"/><LineBreak/><Run/><LineBreak/><Run Text="Please p"/><Run Text="ost issues and suggestions "/><Run Text="on the GitHub page."/></TextBlock>
<TextBlock Margin="286,171,229,137" FontWeight="Bold" Foreground="White">
<TextBlock x:Name="textBlock_About" HorizontalAlignment="Left" Margin="251,11,0,0" TextWrapping="WrapWithOverflow" VerticalAlignment="Top" Height="144" Width="320" RenderTransformOrigin="0.5,0.525"><Run FontWeight="Bold" FontSize="22" Text="DCS Configuration Manager"/><LineBreak/><Run FontWeight="Bold" FontSize="16" Text="Version "/><Run FontWeight="Bold" FontSize="16" Text="2017 "/><Run FontWeight="Bold" FontSize="16" Text="R"/><Run FontWeight="Bold" FontSize="16" Text="5"/><LineBreak/><Run FontWeight="Bold"/><LineBreak/><Run Text="Dedicated to "/><Run Text="the 924th vFW"/><LineBreak/><Run Text="Badly written by FitzZZ"/><LineBreak/><Run/><LineBreak/><Run Text="Please p"/><Run Text="ost issues and suggestions "/><Run Text="on the GitHub page."/></TextBlock>
<TextBlock Margin="286,169,229,139" FontWeight="Bold" Foreground="White">
<Hyperlink Foreground="White" NavigateUri="https://github.com/TheFitzZZ/DCS-Config-Manager/wiki/Donations" RequestNavigate="Hyperlink_RequestNavigate" FontWeight="Normal">Donate a coffee :-)</Hyperlink>
</TextBlock>
<TextBlock Margin="286,200,229,108" FontWeight="Bold" Foreground="White">
<Hyperlink Foreground="White" NavigateUri="https://github.com/TheFitzZZ/DCS-Config-Manager" RequestNavigate="Hyperlink_RequestNavigate" FontWeight="Normal">Visit GitHub project</Hyperlink>
</TextBlock>
<TextBlock Margin="286,209,214,99" FontWeight="Bold" Foreground="White">
<TextBlock Margin="286,231,214,77" FontWeight="Bold" Foreground="White">
<Hyperlink Foreground="White" NavigateUri="https://discord.gg/UYcu2Wz" RequestNavigate="Hyperlink_RequestNavigate" FontWeight="Normal">Talk to me on Discord</Hyperlink>
</TextBlock>
<TextBlock Margin="286,244,241,64" FontWeight="Bold" Foreground="White">
<TextBlock Margin="286,261,241,47" FontWeight="Bold" Foreground="White">
<Hyperlink Foreground="White" NavigateUri="https://www.reddit.com/user/The_FitzZZ/" RequestNavigate="Hyperlink_RequestNavigate" FontWeight="Normal">PM me on Reddit</Hyperlink>
</TextBlock>
<Label x:Name="labelResetSettings" Content="Reset settings" HorizontalAlignment="Left" Margin="500,295,0,0" VerticalAlignment="Top" FontSize="10" Foreground="#FF4B4B55" MouseDoubleClick="LabelResetSettings_MouseDoubleClick"/>
<Label x:Name="labelLogfile" Content="Open Log" HorizontalAlignment="Left" Margin="409,294,0,0" VerticalAlignment="Top" FontSize="10" Foreground="#FF4B4B55" MouseDown="LabelLogfile_MouseDown"/>
<Label x:Name="labelVersion" Content="Label" HorizontalAlignment="Left" Margin="0,182,0,0" VerticalAlignment="Top" Foreground="#FF4D4B4D" Visibility="Hidden"/>
<Image RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Left" Height="30" Margin="251,202,0,0" VerticalAlignment="Top" Width="30" Source="Resources/icons8-discord-528.png"/>
<Image RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Left" Height="30" Margin="251,225,0,0" VerticalAlignment="Top" Width="30" Source="Resources/icons8-discord-528.png"/>
<Image RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Left" Height="20" Margin="389,297,0,0" VerticalAlignment="Top" Width="20" Source="Resources/icons8-file-528.png" Opacity="0.5"/>
<Image RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Left" Height="30" Margin="251,166,0,0" VerticalAlignment="Top" Width="30" Source="Resources/icons8-github-528.png"/>
<Image RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Left" Height="30" Margin="251,236,0,0" VerticalAlignment="Top" Width="30" Source="Resources/icons8-reddit-528.png"/>
<Image RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Left" Height="30" Margin="251,195,0,0" VerticalAlignment="Top" Width="30" Source="Resources/icons8-github-528.png"/>
<Image RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Left" Height="29" Margin="251,163,0,0" VerticalAlignment="Top" Width="30" Source="Resources/donate.png"/>
<Image RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Left" Height="30" Margin="251,252,0,0" VerticalAlignment="Top" Width="30" Source="Resources/icons8-reddit-528.png"/>
<Image RenderOptions.BitmapScalingMode="HighQuality" HorizontalAlignment="Left" Height="20" Margin="480,297,0,0" VerticalAlignment="Top" Width="20" Source="Resources/icons8-support-528.png" Opacity="0.5"/>
</Grid>
</TabItem>
Expand Down
8 changes: 4 additions & 4 deletions DCS-ConfigMgmt/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,10 +1015,10 @@ private void DCSStarter(string branch, string sStartoption)
//System.Threading.Thread.Sleep(10000);
//Catch the dcs executable
var processDCS = Process.GetProcessesByName("DCS");
foreach (var process2 in Process.GetProcesses())
{
Console.WriteLine(process2.ProcessName);
}
//foreach (var process2 in Process.GetProcesses())
//{
// Console.WriteLine(process2.ProcessName);
//}
//Wait for it to close
processDCS[0].WaitForExit();
}
Expand Down
Binary file added DCS-ConfigMgmt/Resources/donate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions DCS-ConfigMgmt/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AudioSwitcher.AudioApi" version="3.0.0" targetFramework="net461" />
<package id="AudioSwitcher.AudioApi.CoreAudio" version="3.0.0.1" targetFramework="net461" />
<package id="AudioSwitcher.AudioApi" version="4.0.0-alpha5" targetFramework="net461" />
<package id="AudioSwitcher.AudioApi.CoreAudio" version="4.0.0-alpha5" targetFramework="net461" />
<package id="MahApps.Metro" version="1.5.0" targetFramework="net461" />
<package id="NLog" version="4.4.12" targetFramework="net461" />
<package id="NLog.Config" version="4.4.12" targetFramework="net461" />
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 95b0d8b

Please sign in to comment.