File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 <PropertyGroup >
44 <TargetFramework >net8.0</TargetFramework >
55 <OutputType >Library</OutputType >
6- <Version >0.7.3 </Version >
6+ <Version >0.7.4 </Version >
77 <Authors >Mike Oliphant</Authors >
88 <Description >Easily create VST (VST3) audio plugins in C# .NET.</Description >
99 <PackageLicenseExpression >MIT</PackageLicenseExpression >
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ public class Logger
2222 static StreamWriter logWriter = null ;
2323 static string logPath ;
2424 static string logFileDateFormat = "yyyy-MM-dd-HH-mm-ss-ffff" ;
25+ static Thread logThread ;
26+ static bool exit = false ;
2527
2628 static Logger ( )
2729 {
@@ -51,7 +53,7 @@ static Logger()
5153
5254 logWriter = new StreamWriter ( logFile ) ;
5355
54- Thread logThread = new Thread ( ( ) => DoLogging ( ) ) ;
56+ logThread = new Thread ( ( ) => DoLogging ( ) ) ;
5557
5658 logThread . Priority = ThreadPriority . Lowest ;
5759 logThread . IsBackground = true ;
@@ -118,6 +120,9 @@ static void DoLogging()
118120 {
119121 WriteLogs ( ) ;
120122 }
123+
124+ if ( exit )
125+ break ;
121126 }
122127 while ( true ) ;
123128 }
@@ -147,5 +152,15 @@ static void WriteLogs()
147152 catch { }
148153 }
149154 }
155+
156+ public static void FlushAndShutdown ( )
157+ {
158+ exit = true ;
159+
160+ if ( logThread != null )
161+ logThread . Join ( ) ;
162+
163+ logThread = null ;
164+ }
150165 }
151166}
Original file line number Diff line number Diff line change 66 <Nullable >enable</Nullable >
77 <AllowUnsafeBlocks >True</AllowUnsafeBlocks >
88 <UseWindowsForms >true</UseWindowsForms >
9- <Version >0.7.0 </Version >
9+ <Version >0.7.4 </Version >
1010 <Authors >Mike Oliphant</Authors >
1111 <Description >Stand-alone ASIO host for AudioPlugSharp plugins.</Description >
1212 <PackageLicenseExpression >MIT</PackageLicenseExpression >
Original file line number Diff line number Diff line change @@ -32,10 +32,27 @@ public void Run()
3232 if ( audioHost . AsioDriver == null )
3333 ShowAudioSettings ( ) ;
3434
35- audioHost . Plugin . ShowEditor ( IntPtr . Zero ) ;
35+ if ( Plugin . HasUserInterface )
36+ {
37+ try
38+ {
39+ Plugin . ShowEditor ( IntPtr . Zero ) ;
40+ }
41+ catch ( Exception ex )
42+ {
43+ Logger . Log ( "Plugin failed with: " + ex . ToString ( ) ) ;
44+ }
45+ }
46+ else
47+ {
48+ Thread . Sleep ( Timeout . Infinite ) ;
49+ }
50+
3651 audioHost . Exit ( ) ;
3752
3853 notifyIcon . Visible = false ;
54+
55+ Logger . FlushAndShutdown ( ) ;
3956 }
4057
4158 void ShowAudioSettings ( )
Original file line number Diff line number Diff line change 44 <TargetFramework >net8.0</TargetFramework >
55 <ImplicitUsings >enable</ImplicitUsings >
66 <Nullable >enable</Nullable >
7- <Version >0.7.0 </Version >
7+ <Version >0.7.4 </Version >
88 <Authors >Mike Oliphant</Authors >
99 <Description >Jack Audio host for AudioPlugSharp plugins.</Description >
1010 <PackageLicenseExpression >MIT</PackageLicenseExpression >
Original file line number Diff line number Diff line change @@ -110,14 +110,23 @@ public void Run()
110110
111111 if ( Plugin . HasUserInterface )
112112 {
113- Plugin . ShowEditor ( IntPtr . Zero ) ;
113+ try
114+ {
115+ Plugin . ShowEditor ( IntPtr . Zero ) ;
116+ }
117+ catch ( Exception ex )
118+ {
119+ Logger . Log ( "Plugin failed with: " + ex . ToString ( ) ) ;
120+ }
114121
115122 Exit ( ) ;
116123 }
117124 else
118125 {
119126 Thread . Sleep ( Timeout . Infinite ) ;
120127 }
128+
129+ Logger . FlushAndShutdown ( ) ;
121130 }
122131 }
123132
Original file line number Diff line number Diff line change 44 <TargetFramework >net8.0</TargetFramework >
55 <ImplicitUsings >enable</ImplicitUsings >
66 <Nullable >enable</Nullable >
7- <Version >0.7.3 </Version >
7+ <Version >0.7.4 </Version >
88 <Authors >Mike Oliphant</Authors >
99 <Description >AudioPlugSharp VST3 plugin implmentation</Description >
1010 <PackageLicenseExpression >MIT</PackageLicenseExpression >
Original file line number Diff line number Diff line change 44 <TargetFramework >net8.0-windows</TargetFramework >
55 <UseWPF >true</UseWPF >
66 <UseWindowsForms >true</UseWindowsForms >
7- <Version >0.7.3 </Version >
7+ <Version >0.7.4 </Version >
88 <Authors >Mike Oliphant</Authors >
99 <Description >Add WPF GUI to your AudioPlugSharp plugin.</Description >
1010 <PackageLicenseExpression >MIT</PackageLicenseExpression >
Original file line number Diff line number Diff line change 1- using AudioPlugSharpJack ;
1+ using AudioPlugSharp ;
2+ using AudioPlugSharpJack ;
23using SimpleExample ;
34
45namespace JackHostTest
@@ -10,6 +11,8 @@ static void Main(string[] args)
1011 JackHost < SimpleExamplePlugin > host = new JackHost < SimpleExamplePlugin > ( new SimpleExamplePlugin ( ) ) ;
1112
1213 host . Run ( ) ;
14+
15+ Logger . FlushAndShutdown ( ) ;
1316 }
1417 }
1518}
You can’t perform that action at this time.
0 commit comments