From 39f433c5c941536b6ade6759a1bd6f58ae78f0ff Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Sun, 29 Dec 2019 22:32:55 -0600 Subject: [PATCH 01/13] Initial migration of NAudioDemo to sdk-style project -- things appear to work thus far --- NAudio/NAudio.csproj | 2 +- NAudioDemo/NAudioDemo.csproj | 265 +------------------------- NAudioDemo/NAudioDemo.csproj.user | 59 ++++++ NAudioDemo/Properties/AssemblyInfo.cs | 33 ---- 4 files changed, 69 insertions(+), 290 deletions(-) delete mode 100644 NAudioDemo/Properties/AssemblyInfo.cs diff --git a/NAudio/NAudio.csproj b/NAudio/NAudio.csproj index bbb13c10..d8f4a7c2 100644 --- a/NAudio/NAudio.csproj +++ b/NAudio/NAudio.csproj @@ -1,6 +1,6 @@  - net35;netstandard2.0;uap10.0 + net35;netstandard2.0 1.9.0 Mark Heath & Contributors true diff --git a/NAudioDemo/NAudioDemo.csproj b/NAudioDemo/NAudioDemo.csproj index 189f9425..a5952b88 100644 --- a/NAudioDemo/NAudioDemo.csproj +++ b/NAudioDemo/NAudioDemo.csproj @@ -1,8 +1,9 @@  - + Debug AnyCPU + net40-client 9.0.30729 2.0 {C37A547B-F31E-45FB-870A-CFA704D06152} @@ -15,7 +16,6 @@ 3.5 - v4.0 publish\ true Disk @@ -31,7 +31,12 @@ false false true - Client + NAudioDemo + 1.0.0.0 + 1.0.0.0 + NAudioDemo + NAudioDemo + 1.0.0.0 true @@ -66,251 +71,7 @@ - - UserControl - - - AcmPanel.cs - - - UserControl - - - AsioDirectPanel.cs - - - UserControl - - - AsioRecordingPanel.cs - - - - UserControl - - - AsioOutSettingsPanel.cs - - - UserControl - - - AudioPlaybackPanel.cs - - - - UserControl - - - DirectSoundOutSettingsPanel.cs - - - - - - UserControl - - - WasapiOutSettingsPanel.cs - - - - UserControl - - - WaveOutSettingsPanel.cs - - - - Images.resx - True - True - - - - - Form - - - MainForm.cs - - - UserControl - - - MediaFoundationDemoPanel.cs - - - - UserControl - - - MidiInPanel.cs - - - UserControl - - - MP3StreamingPanel.cs - - - - - - - - - - - - - - UserControl - - - NetworkChatPanel.cs - - - - - - - - - - UserControl - - - FadeInOutPanel.cs - - - UserControl - - - GeneratorPanel.cs - - - - UserControl - - - SimplePlaybackPanel.cs - - - - - - - - UserControl - - - VolumeMixerPanel.cs - - - - UserControl - - - VolumePanel.cs - - - AcmPanel.cs - Designer - - - AsioDirectPanel.cs - - - AsioRecordingPanel.cs - - - AsioOutSettingsPanel.cs - - - AudioPlaybackPanel.cs - Designer - - - DirectSoundOutSettingsPanel.cs - - - WasapiOutSettingsPanel.cs - - - WaveOutSettingsPanel.cs - - - ResXFileCodeGenerator - Images.Designer.cs - Designer - - - Designer - MainForm.cs - - - MediaFoundationDemoPanel.cs - - - Designer - MidiInPanel.cs - - - MP3StreamingPanel.cs - - - NetworkChatPanel.cs - - - FadeInOutPanel.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - RecordingPanel.cs - Designer - - - True - Resources.resx - True - - - GeneratorPanel.cs - - - SimplePlaybackPanel.cs - - - VolumePanel.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - UserControl - - - RecordingPanel.cs - - - - - {DA4F02E3-0B5E-42CD-B8D9-5583FA51D66E} - NAudio - + @@ -360,12 +121,4 @@ - - \ No newline at end of file diff --git a/NAudioDemo/NAudioDemo.csproj.user b/NAudioDemo/NAudioDemo.csproj.user index 566c009a..db9e5f1d 100644 --- a/NAudioDemo/NAudioDemo.csproj.user +++ b/NAudioDemo/NAudioDemo.csproj.user @@ -3,4 +3,63 @@ ShowAllFiles + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + Form + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + + UserControl + + \ No newline at end of file diff --git a/NAudioDemo/Properties/AssemblyInfo.cs b/NAudioDemo/Properties/AssemblyInfo.cs deleted file mode 100644 index b7d1c787..00000000 --- a/NAudioDemo/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NAudioDemo")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NAudioDemo")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6f558ff4-35cc-4cdc-8767-ca7f3b679f13")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] From de1ae584ba314f34f2636154b137d5f432f33941 Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Sun, 29 Dec 2019 23:16:58 -0600 Subject: [PATCH 02/13] trim the fat --- NAudioDemo/NAudioDemo.csproj | 44 ------------------------------------ 1 file changed, 44 deletions(-) diff --git a/NAudioDemo/NAudioDemo.csproj b/NAudioDemo/NAudioDemo.csproj index a5952b88..6fbb161d 100644 --- a/NAudioDemo/NAudioDemo.csproj +++ b/NAudioDemo/NAudioDemo.csproj @@ -1,20 +1,13 @@  - Debug - AnyCPU net40-client 9.0.30729 2.0 - {C37A547B-F31E-45FB-870A-CFA704D06152} WinExe Properties NAudioDemo NAudioDemo - - - - 3.5 publish\ true @@ -38,27 +31,6 @@ NAudioDemo 1.0.0.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - AnyCPU - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - x86 - ..\Lib\NSpeex\NSpeex.dll @@ -75,29 +47,13 @@ - - - - - - - - - - - - - - - - From 0db379738f686d28145632ec92114ae3cfd286d6 Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Sun, 29 Dec 2019 23:43:41 -0600 Subject: [PATCH 03/13] asio getting closer to working on .net core -- naudio lib compiles; naudiodemo doesn't --- NAudio/NAudio.csproj | 26 ++++++++++++++++++- NAudio/Wave/Asio/ASIODriver.cs | 2 +- NAudioDemo/NAudioDemo.csproj | 3 ++- .../VolumeMixerDemo/VolumeMixerPanel.cs | 2 ++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/NAudio/NAudio.csproj b/NAudio/NAudio.csproj index d8f4a7c2..79c6c0b1 100644 --- a/NAudio/NAudio.csproj +++ b/NAudio/NAudio.csproj @@ -1,6 +1,6 @@  - net35;netstandard2.0 + netcoreapp3.0;netstandard2.0;net35 1.9.0 Mark Heath & Contributors true @@ -14,6 +14,10 @@ true + + true + + @@ -40,6 +44,17 @@ + + + + + + + + + + + @@ -73,4 +88,13 @@ + + + + 4.7.0 + + + 4.7.0 + + \ No newline at end of file diff --git a/NAudio/Wave/Asio/ASIODriver.cs b/NAudio/Wave/Asio/ASIODriver.cs index abbe2cdc..0a084737 100644 --- a/NAudio/Wave/Asio/ASIODriver.cs +++ b/NAudio/Wave/Asio/ASIODriver.cs @@ -23,7 +23,7 @@ private AsioDriver() { } -#if NET35 +#if NET35 || NETCOREAPP3_0 /// /// Gets the ASIO driver names installed. /// diff --git a/NAudioDemo/NAudioDemo.csproj b/NAudioDemo/NAudioDemo.csproj index 6fbb161d..886e68a3 100644 --- a/NAudioDemo/NAudioDemo.csproj +++ b/NAudioDemo/NAudioDemo.csproj @@ -1,7 +1,7 @@  - net40-client + netcoreapp3.0 9.0.30729 2.0 WinExe @@ -30,6 +30,7 @@ NAudioDemo NAudioDemo 1.0.0.0 + true diff --git a/NAudioDemo/VolumeMixerDemo/VolumeMixerPanel.cs b/NAudioDemo/VolumeMixerDemo/VolumeMixerPanel.cs index 4a2dc4e4..688ee6db 100644 --- a/NAudioDemo/VolumeMixerDemo/VolumeMixerPanel.cs +++ b/NAudioDemo/VolumeMixerDemo/VolumeMixerPanel.cs @@ -4,7 +4,9 @@ using System.Drawing; using System.Data; using System.Linq; +#if NET35 using System.Runtime.Remoting.Messaging; +#endif using System.Text; using System.Windows.Forms; using NAudio.CoreAudioApi; From f487fbad4a89503e0c9d63aa47f215877ffff40d Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Sun, 29 Dec 2019 23:46:43 -0600 Subject: [PATCH 04/13] Include WaveIn and WaveOut in .net core build -- NAudioDemo works untouched --- NAudio/NAudio.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/NAudio/NAudio.csproj b/NAudio/NAudio.csproj index 79c6c0b1..a1fd8c7a 100644 --- a/NAudio/NAudio.csproj +++ b/NAudio/NAudio.csproj @@ -45,10 +45,6 @@ - - - - From 478a9232c33639be5d0f545dfd97d9641d9c8b2a Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Sun, 29 Dec 2019 23:48:54 -0600 Subject: [PATCH 05/13] Add uap target back to NAudio.csproj and net40-client back to NAudioDemo.csproj --- NAudio/NAudio.csproj | 2 +- NAudioDemo/NAudioDemo.csproj | 2 +- NAudioDemo/NAudioDemo.csproj.user | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NAudio/NAudio.csproj b/NAudio/NAudio.csproj index a1fd8c7a..192c2257 100644 --- a/NAudio/NAudio.csproj +++ b/NAudio/NAudio.csproj @@ -1,6 +1,6 @@  - netcoreapp3.0;netstandard2.0;net35 + netcoreapp3.0;net35;netstandard2.0;uap10.0 1.9.0 Mark Heath & Contributors true diff --git a/NAudioDemo/NAudioDemo.csproj b/NAudioDemo/NAudioDemo.csproj index 886e68a3..327daeff 100644 --- a/NAudioDemo/NAudioDemo.csproj +++ b/NAudioDemo/NAudioDemo.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.0;net40-client; 9.0.30729 2.0 WinExe diff --git a/NAudioDemo/NAudioDemo.csproj.user b/NAudioDemo/NAudioDemo.csproj.user index db9e5f1d..df2d9b95 100644 --- a/NAudioDemo/NAudioDemo.csproj.user +++ b/NAudioDemo/NAudioDemo.csproj.user @@ -2,6 +2,7 @@ ShowAllFiles + net40-client From a430927f780b88e8395e8675bbadd678e67ec900 Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Sun, 29 Dec 2019 23:53:39 -0600 Subject: [PATCH 06/13] remove .user file --- NAudioDemo/NAudioDemo.csproj.user | 66 ------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 NAudioDemo/NAudioDemo.csproj.user diff --git a/NAudioDemo/NAudioDemo.csproj.user b/NAudioDemo/NAudioDemo.csproj.user deleted file mode 100644 index df2d9b95..00000000 --- a/NAudioDemo/NAudioDemo.csproj.user +++ /dev/null @@ -1,66 +0,0 @@ - - - - ShowAllFiles - net40-client - - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - Form - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - UserControl - - - \ No newline at end of file From e0876df3d4247cc903c18f0fffe0fc27e088169a Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Mon, 30 Dec 2019 00:29:26 -0600 Subject: [PATCH 07/13] Bring ASIO into .Net Standard --- NAudio/NAudio.csproj | 8 ++++++-- NAudio/Wave/Asio/ASIODriver.cs | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/NAudio/NAudio.csproj b/NAudio/NAudio.csproj index 192c2257..3adad776 100644 --- a/NAudio/NAudio.csproj +++ b/NAudio/NAudio.csproj @@ -36,8 +36,6 @@ - - @@ -85,6 +83,12 @@ + + + 4.7.0 + + + 4.7.0 diff --git a/NAudio/Wave/Asio/ASIODriver.cs b/NAudio/Wave/Asio/ASIODriver.cs index 0a084737..6c7b3ded 100644 --- a/NAudio/Wave/Asio/ASIODriver.cs +++ b/NAudio/Wave/Asio/ASIODriver.cs @@ -23,7 +23,7 @@ private AsioDriver() { } -#if NET35 || NETCOREAPP3_0 +#if NETSTANDARD2_0 || NET35 || NETCOREAPP3_0 /// /// Gets the ASIO driver names installed. /// From 47846ea44785473a55847ca9e85ea4c08ee270be Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Mon, 30 Dec 2019 13:01:51 -0700 Subject: [PATCH 08/13] Port NAudioWpfDemo to sdk-style csproj --- NAudioWpfDemo/NAudioWpfDemo.csproj | 273 +---------------------- NAudioWpfDemo/Properties/AssemblyInfo.cs | 55 ----- 2 files changed, 10 insertions(+), 318 deletions(-) delete mode 100644 NAudioWpfDemo/Properties/AssemblyInfo.cs diff --git a/NAudioWpfDemo/NAudioWpfDemo.csproj b/NAudioWpfDemo/NAudioWpfDemo.csproj index de1fb1eb..008123a1 100644 --- a/NAudioWpfDemo/NAudioWpfDemo.csproj +++ b/NAudioWpfDemo/NAudioWpfDemo.csproj @@ -1,9 +1,7 @@  - - + - Debug - AnyCPU + net45 9.0.30729 2.0 {A7B74F85-D353-4ED4-A321-E6E4AD4D7D32} @@ -11,14 +9,15 @@ Properties NAudioWpfDemo NAudioWpfDemo - v4.5 + NAudioWpfDemo + 1.0.0.0 + 1.0.0 + NAudioWpfDemo + NAudioWpfDemo + 1.0.0.0 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - - 3.5 - publish\ true Disk @@ -34,38 +33,9 @@ false false true - - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - x86 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - x86 - false + true - - ..\packages\NUnit.3.10.1\lib\net40\nunit.framework.dll - 3.5 @@ -89,215 +59,6 @@ 3.0 - - - MSBuild:Compile - Designer - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - MSBuild:Compile - Designer - - - App.xaml - Code - - - - AudioPlaybackDemoView.xaml - - - - - - - - - DrumMachineDemoView.xaml - - - - - DrumPatternEditor.xaml - - - - - - - - - EnumMftView.xaml - - - - - EqualizationDemoView.xaml - - - - - - - - - - - FireAndForgetPlaybackView.xaml - - - - - MainWindow.xaml - Code - - - - - - - - - MediaFoundationEncodeView.xaml - - - - - MediaFoundationPlaybackView.xaml - - - - - - MediaFoundationResampleView.xaml - - - - - PolygonWaveFormControl.xaml - - - - PolylineWaveFormControl.xaml - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - SpectrumAnalyser.xaml - - - - - - - RecordingsView.xaml - - - - - WasapiCaptureDemoView.xaml - - - - WaveFormControl.xaml - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - {DA4F02E3-0B5E-42CD-B8D9-5583FA51D66E} @@ -344,20 +105,6 @@ - + - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/NAudioWpfDemo/Properties/AssemblyInfo.cs b/NAudioWpfDemo/Properties/AssemblyInfo.cs deleted file mode 100644 index 6f0096b2..00000000 --- a/NAudioWpfDemo/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NAudioWpfDemo")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NAudioWpfDemo")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] From fe0c768eaa841fd46a2a036d4eafadddda6ecbbd Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Mon, 30 Dec 2019 13:21:44 -0700 Subject: [PATCH 09/13] Multi-target Wpf demo project for .Net Framework AND .Net Core --- NAudioWpfDemo/MainWindow.xaml.cs | 10 +++++++++- .../MediaFoundationEncodeViewModel.cs | 1 - NAudioWpfDemo/NAudioWpfDemo.csproj | 3 +-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NAudioWpfDemo/MainWindow.xaml.cs b/NAudioWpfDemo/MainWindow.xaml.cs index bcbff723..8f2ea15f 100644 --- a/NAudioWpfDemo/MainWindow.xaml.cs +++ b/NAudioWpfDemo/MainWindow.xaml.cs @@ -3,6 +3,11 @@ namespace NAudioWpfDemo { + using System; + using System.Reflection; + using System.Runtime.InteropServices; + using System.Runtime.Versioning; + /// /// Interaction logic for MainWindow.xaml /// @@ -11,7 +16,10 @@ public partial class MainWindow : Window public MainWindow() { InitializeComponent(); - this.Title = this.Title + ((System.Runtime.InteropServices.Marshal.SizeOf(IntPtr.Zero) == 8) ? " (x64)" : " (x86)"); + var arch = Environment.Is64BitProcess ? "x64" : "x86"; + var framework = Assembly.GetEntryAssembly().GetCustomAttribute().FrameworkName; + //this.Title = this.Title + arch; + this.Title = $"{this.Title} ({framework}, {arch})"; } } } diff --git a/NAudioWpfDemo/MediaFoundationEncode/MediaFoundationEncodeViewModel.cs b/NAudioWpfDemo/MediaFoundationEncode/MediaFoundationEncodeViewModel.cs index fca93b92..5a7ed249 100644 --- a/NAudioWpfDemo/MediaFoundationEncode/MediaFoundationEncodeViewModel.cs +++ b/NAudioWpfDemo/MediaFoundationEncode/MediaFoundationEncodeViewModel.cs @@ -5,7 +5,6 @@ using System.Runtime.InteropServices; using System.Windows.Forms; using System.Windows.Input; -using MS.Internal.Xml.XPath; using NAudio.MediaFoundation; using NAudio.Wave; using NAudioWpfDemo.ViewModel; diff --git a/NAudioWpfDemo/NAudioWpfDemo.csproj b/NAudioWpfDemo/NAudioWpfDemo.csproj index 008123a1..57f71efa 100644 --- a/NAudioWpfDemo/NAudioWpfDemo.csproj +++ b/NAudioWpfDemo/NAudioWpfDemo.csproj @@ -1,7 +1,7 @@  - net45 + netcoreapp3.0;net45 9.0.30729 2.0 {A7B74F85-D353-4ED4-A321-E6E4AD4D7D32} @@ -17,7 +17,6 @@ 1.0.0.0 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 3.5 publish\ true Disk From 364be1478bcfd15e4f5c98c8b97ba23a0bab7080 Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Mon, 30 Dec 2019 13:29:44 -0700 Subject: [PATCH 10/13] Add runtime framework moniker to WinForms demo form title --- NAudioDemo/MainForm.cs | 6 +++++- NAudioWpfDemo/MainWindow.xaml.cs | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NAudioDemo/MainForm.cs b/NAudioDemo/MainForm.cs index ce25c6b6..058897ff 100644 --- a/NAudioDemo/MainForm.cs +++ b/NAudioDemo/MainForm.cs @@ -1,5 +1,7 @@ using System; using System.Linq; +using System.Reflection; +using System.Runtime.Versioning; using System.Windows.Forms; using NAudioDemo.Utils; @@ -21,7 +23,9 @@ public MainForm() listBoxDemos.Items.Add(demo); } - Text += ((System.Runtime.InteropServices.Marshal.SizeOf(IntPtr.Zero) == 8) ? " (x64)" : " (x86)"); + var arch = Environment.Is64BitProcess ? "x64" : "x86"; + var framework = Assembly.GetEntryAssembly().GetCustomAttribute().FrameworkName; + this.Text = $"{this.Text} ({framework}) ({arch})"; } diff --git a/NAudioWpfDemo/MainWindow.xaml.cs b/NAudioWpfDemo/MainWindow.xaml.cs index 8f2ea15f..684d5786 100644 --- a/NAudioWpfDemo/MainWindow.xaml.cs +++ b/NAudioWpfDemo/MainWindow.xaml.cs @@ -18,8 +18,7 @@ public MainWindow() InitializeComponent(); var arch = Environment.Is64BitProcess ? "x64" : "x86"; var framework = Assembly.GetEntryAssembly().GetCustomAttribute().FrameworkName; - //this.Title = this.Title + arch; - this.Title = $"{this.Title} ({framework}, {arch})"; + this.Title = $"{this.Title} ({framework}) ({arch})"; } } } From 4803dea930ec10fb5cd458489b6038cb3157731a Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Mon, 30 Dec 2019 14:25:40 -0700 Subject: [PATCH 11/13] Add .net 4.8 targets to demo apps, and fix up NAudioDemo not building on client profile --- NAudioDemo/MainForm.cs | 2 +- NAudioDemo/NAudioDemo.csproj | 2 +- NAudioWpfDemo/NAudioWpfDemo.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NAudioDemo/MainForm.cs b/NAudioDemo/MainForm.cs index 058897ff..8683abcd 100644 --- a/NAudioDemo/MainForm.cs +++ b/NAudioDemo/MainForm.cs @@ -24,7 +24,7 @@ public MainForm() } var arch = Environment.Is64BitProcess ? "x64" : "x86"; - var framework = Assembly.GetEntryAssembly().GetCustomAttribute().FrameworkName; + var framework = ((TargetFrameworkAttribute)(Assembly.GetEntryAssembly().GetCustomAttributes(typeof(TargetFrameworkAttribute),true).ToArray()[0])).FrameworkName; this.Text = $"{this.Text} ({framework}) ({arch})"; } diff --git a/NAudioDemo/NAudioDemo.csproj b/NAudioDemo/NAudioDemo.csproj index 327daeff..2b8f2aab 100644 --- a/NAudioDemo/NAudioDemo.csproj +++ b/NAudioDemo/NAudioDemo.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0;net40-client; + netcoreapp3.0;net40-client;net48 9.0.30729 2.0 WinExe diff --git a/NAudioWpfDemo/NAudioWpfDemo.csproj b/NAudioWpfDemo/NAudioWpfDemo.csproj index 57f71efa..15c9a13c 100644 --- a/NAudioWpfDemo/NAudioWpfDemo.csproj +++ b/NAudioWpfDemo/NAudioWpfDemo.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0;net45 + netcoreapp3.0;net45;net48 9.0.30729 2.0 {A7B74F85-D353-4ED4-A321-E6E4AD4D7D32} From ccf37314aee24e0547f5ac01be0117de2ae51eac Mon Sep 17 00:00:00 2001 From: Mark Heath Date: Fri, 31 Jan 2020 15:57:24 +0000 Subject: [PATCH 12/13] build fixes for PR #574 --- .../MediaFoundationEncode/MediaFoundationEncodeViewModel.cs | 4 ++-- .../MediaFoundationPlaybackViewModel.cs | 2 +- azure-pipelines.yml | 3 ++- global.json | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NAudioWpfDemo/MediaFoundationEncode/MediaFoundationEncodeViewModel.cs b/NAudioWpfDemo/MediaFoundationEncode/MediaFoundationEncodeViewModel.cs index 5a7ed249..7449956c 100644 --- a/NAudioWpfDemo/MediaFoundationEncode/MediaFoundationEncodeViewModel.cs +++ b/NAudioWpfDemo/MediaFoundationEncode/MediaFoundationEncodeViewModel.cs @@ -3,7 +3,7 @@ using System.IO; using System.Linq; using System.Runtime.InteropServices; -using System.Windows.Forms; +using System.Windows; using System.Windows.Input; using NAudio.MediaFoundation; using NAudio.Wave; @@ -77,7 +77,7 @@ private bool TryOpenInputFile(string file) } catch (Exception e) { - MessageBox.Show(String.Format("Not a supported input file ({0})", e.Message)); + MessageBox.Show($"Not a supported input file ({e.Message})"); } return isValid; } diff --git a/NAudioWpfDemo/MediaFoundationPlayback/MediaFoundationPlaybackViewModel.cs b/NAudioWpfDemo/MediaFoundationPlayback/MediaFoundationPlaybackViewModel.cs index dd378ec7..cdf68b86 100644 --- a/NAudioWpfDemo/MediaFoundationPlayback/MediaFoundationPlaybackViewModel.cs +++ b/NAudioWpfDemo/MediaFoundationPlayback/MediaFoundationPlaybackViewModel.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Windows.Forms; +using System.Windows; using System.Windows.Threading; using NAudio.Wave; using NAudioWpfDemo.ViewModel; diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f05be062..839cec67 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,9 +2,10 @@ # Build and run tests for .NET Desktop or Windows classic desktop solutions. # Add steps that publish symbols, save build artifacts, and more: # https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net +# vmImage options: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#use-a-microsoft-hosted-agent pool: - vmImage: 'VS2017-Win2016' + vmImage: 'windows-2019' variables: solution: '**/*.sln' diff --git a/global.json b/global.json index dc03d9ee..80d84a25 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "msbuild-sdks": { - "MSBuild.Sdk.Extras": "2.0.31" + "MSBuild.Sdk.Extras": "2.0.54" } } \ No newline at end of file From 13516bf0df9505a499d497cb7b99e6f9d6dd1fd4 Mon Sep 17 00:00:00 2001 From: Mark Heath Date: Fri, 31 Jan 2020 16:19:36 +0000 Subject: [PATCH 13/13] updating version number --- NAudio/NAudio.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NAudio/NAudio.csproj b/NAudio/NAudio.csproj index 3adad776..e15416b8 100644 --- a/NAudio/NAudio.csproj +++ b/NAudio/NAudio.csproj @@ -1,7 +1,7 @@  netcoreapp3.0;net35;netstandard2.0;uap10.0 - 1.9.0 + 1.10.0 Mark Heath & Contributors true NAudio, an audio library for .NET @@ -9,7 +9,7 @@ https://github.com/naudio/NAudio C# .NET audio sound https://github.com/naudio/NAudio - © Mark Heath 2019 + © Mark Heath 2020 true true