Skip to content
This repository was archived by the owner on Jan 5, 2025. It is now read-only.

Commit 66d627f

Browse files
committed
Version 18.2.3
1 parent 836735d commit 66d627f

8 files changed

Lines changed: 53 additions & 55 deletions

File tree

KeppyMIDIConverter/Forms/AddingMIDIs.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,15 @@ private void AnalyzeMIDIs_RunWorkerCompleted(object sender, RunWorkerCompletedEv
143143
{
144144
if (InvalidFiles > 0 && !IgnoreInvalid)
145145
{
146-
AnalyzerProgress.Enabled = false;
147-
AnalyzerProgressBar.Value = 100;
148-
CancelBtn.Text = Languages.Parse("ConfirmBtn");
149-
ParsingMIDIInfoStatus.Text = String.Format(Languages.Parse("ParsingMIDIInfoInvalidOutcome"),
150-
(ValidFiles + InvalidFiles).ToString("N0", new CultureInfo("is-IS")),
151-
ValidFiles.ToString("N0", new CultureInfo("is-IS")),
152-
InvalidFiles.ToString("N0", new CultureInfo("is-IS")));
146+
MainWindow.Delegate.Invoke((MethodInvoker)delegate {
147+
AnalyzerProgress.Enabled = false;
148+
AnalyzerProgressBar.Value = 100;
149+
CancelBtn.Text = Languages.Parse("ConfirmBtn");
150+
ParsingMIDIInfoStatus.Text = String.Format(Languages.Parse("ParsingMIDIInfoInvalidOutcome"),
151+
(ValidFiles + InvalidFiles).ToString("N0", new CultureInfo("is-IS")),
152+
ValidFiles.ToString("N0", new CultureInfo("is-IS")),
153+
InvalidFiles.ToString("N0", new CultureInfo("is-IS")));
154+
});
153155
}
154156
else MainWindow.Delegate.Invoke((MethodInvoker)delegate { Close(); });
155157
}

KeppyMIDIConverter/Forms/MainWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public MainWindow(String[] args)
229229
InitializeLanguage();
230230

231231
//Parse through arguments
232-
foreach (String s in args)
232+
foreach (String s in args.Skip(1).ToArray())
233233
{
234234
//Find out it the current file is a MIDI
235235
if (MIDIs == null) MIDIs = new List<String>();
@@ -304,7 +304,7 @@ private void MainWindow_Load(object sender, EventArgs e)
304304
//Check if there are soundfonts
305305
if (SoundFonts != null)
306306
{
307-
SoundFontChain.SoundFonts = new string[SoundFonts.Count];
307+
SoundFontChain.SoundFonts = new String[SoundFonts.Count];
308308
SoundFonts.CopyTo(SoundFontChain.SoundFonts, 0);
309309

310310
foreach (String SF in SoundFonts) KMCDialogs.SFDialog.SFList.Items.Add(SF);

KeppyMIDIConverter/Functions/BASSControl.cs

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,34 @@ namespace KeppyMIDIConverter
2222
{
2323
class BASSControl
2424
{
25-
public static void ReleaseResources(bool stillrendering)
25+
public static void ReleaseResources(bool StillRendering, bool Closing)
2626
{
27+
foreach (Int32 Stream in MainWindow.VSTs._DummyVSTHandles) BassVst.BASS_VST_ChannelRemoveDSP(0, Stream);
28+
BassVst.BASS_VST_ChannelRemoveDSP(0, MainWindow.VSTs._DummyLoudMaxHan);
2729
MainWindow.KMCGlobals.DoNotCountNotes = false;
2830
BassWasapi.BASS_WASAPI_Stop(true);
2931
BassWasapi.BASS_WASAPI_Free();
3032
Bass.BASS_StreamFree(MainWindow.KMCGlobals._recHandle);
31-
MainWindow.KMCStatus.IsKMCBusy = stillrendering;
33+
MainWindow.KMCStatus.IsKMCBusy = StillRendering;
3234
MainWindow.KMCStatus.IsKMCNowExporting = false;
3335
MainWindow.KMCGlobals.eventc = 0;
3436
MainWindow.KMCGlobals.events = null;
37+
38+
if (Closing)
39+
{
40+
MainWindow.KMCGlobals.ActiveVoicesInt = 0;
41+
MainWindow.KMCGlobals.NewWindowName = null;
42+
MainWindow.KMCStatus.RenderingMode = false;
43+
RTF.CPUUsage = 0.0f;
44+
RTF.ActiveVoices = 0.0f;
45+
}
3546
}
3647

3748
public static void BASSCloseStream(string message, string title, int type)
3849
{
39-
// Free streams
40-
BassWasapi.BASS_WASAPI_Stop(true);
41-
BassWasapi.BASS_WASAPI_Free();
42-
Bass.BASS_StreamFree(MainWindow.KMCGlobals._recHandle);
43-
Bass.BASS_Free();
44-
4550
// Reset
46-
MainWindow.KMCGlobals.DoNotCountNotes = false;
47-
MainWindow.KMCGlobals.CurrentStatusTextString = message;
48-
MainWindow.KMCGlobals.ActiveVoicesInt = 0;
49-
MainWindow.KMCGlobals.NewWindowName = null;
50-
MainWindow.KMCStatus.IsKMCBusy = false;
51-
MainWindow.KMCStatus.IsKMCNowExporting = false;
52-
MainWindow.KMCStatus.RenderingMode = false;
53-
MainWindow.KMCGlobals.DoNotCountNotes = false;
54-
MainWindow.KMCGlobals.eventc = 0;
55-
MainWindow.KMCGlobals.events = null;
56-
RTF.CPUUsage = 0.0f;
57-
RTF.ActiveVoices = 0.0f;
58-
51+
ReleaseResources(false, true);
52+
5953
// Show message
6054
if (type == 0)
6155
{
@@ -90,15 +84,9 @@ public static void BASSCloseStream(string message, string title, int type)
9084

9185
public static void BASSCloseStreamCrash(Exception ex)
9286
{
93-
Bass.BASS_StreamFree(MainWindow.KMCGlobals._recHandle);
94-
Bass.BASS_Free();
95-
MainWindow.KMCGlobals.NewWindowName = null;
96-
MainWindow.KMCStatus.IsKMCBusy = false;
97-
MainWindow.KMCStatus.IsKMCNowExporting = false;
98-
MainWindow.KMCStatus.RenderingMode = false;
99-
MainWindow.KMCGlobals.DoNotCountNotes = false;
100-
MainWindow.KMCGlobals.eventc = 0;
101-
MainWindow.KMCGlobals.events = null;
87+
// Reset
88+
ReleaseResources(false, true);
89+
10290
MainWindow.Delegate.Invoke((MethodInvoker)delegate {
10391
ErrorHandler errordialog = new ErrorHandler(Languages.Parse("Error"), ex.ToString(), 0, 1);
10492
errordialog.ShowDialog();

KeppyMIDIConverter/Functions/ConverterFunctions.cs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ public static void CPWork(object sender, DoWorkEventArgs e)
181181
if (MainWindow.KMCGlobals.CancellationPendingValue == 1)
182182
break;
183183
}
184-
BASSControl.ReleaseResources((MainWindow.KMCGlobals.CancellationPendingValue != 1));
184+
185+
BASSControl.ReleaseResources((MainWindow.KMCGlobals.CancellationPendingValue != 1), (MainWindow.KMCGlobals.CancellationPendingValue == 1));
186+
if (MainWindow.KMCGlobals.CancellationPendingValue == 1) break;
185187
}
186188

187189
MainWindow.KMCStatus.RenderingMode = false;
@@ -206,7 +208,7 @@ public static void CPWork(object sender, DoWorkEventArgs e)
206208
catch (Exception exception)
207209
{
208210
BasicFunctions.WriteToConsole(exception);
209-
BASSControl.ReleaseResources(false);
211+
BASSControl.ReleaseResources(false, true);
210212
}
211213
}
212214
catch (Exception exception2)
@@ -255,7 +257,9 @@ public static void CPRWork(object sender, DoWorkEventArgs e)
255257
}
256258
else break;
257259
}
258-
BASSControl.ReleaseResources((MainWindow.KMCGlobals.CancellationPendingValue != 1));
260+
261+
BASSControl.ReleaseResources((MainWindow.KMCGlobals.CancellationPendingValue != 1), (MainWindow.KMCGlobals.CancellationPendingValue == 1));
262+
if (MainWindow.KMCGlobals.CancellationPendingValue == 1) break;
259263
}
260264

261265
MainWindow.KMCStatus.RenderingMode = false;
@@ -266,7 +270,7 @@ public static void CPRWork(object sender, DoWorkEventArgs e)
266270
String Msg = (MainWindow.KMCGlobals.CancellationPendingValue == 1) ? "ConversionAborted" : "ConversionCompleted";
267271
BASSControl.BASSCloseStream(Languages.Parse(Msg), Languages.Parse(Msg), 0);
268272

269-
if (MainWindow.KMCGlobals.CancellationPendingValue != 1)
273+
if (MainWindow.KMCGlobals.CancellationPendingValue == 1)
270274
{
271275
if (MainWindow.KMCGlobals.AutoShutDownEnabled == true)
272276
Process.Start(new ProcessStartInfo("shutdown", "/s /t 0") { CreateNoWindow = true, UseShellExecute = false });
@@ -280,7 +284,7 @@ public static void CPRWork(object sender, DoWorkEventArgs e)
280284
catch (Exception exception)
281285
{
282286
BasicFunctions.WriteToConsole(exception);
283-
BASSControl.ReleaseResources(false);
287+
BASSControl.ReleaseResources(false, true);
284288
}
285289
}
286290
catch (Exception exception2)
@@ -343,7 +347,9 @@ public static void PBWork(object sender, DoWorkEventArgs e)
343347

344348
TimerFuncs.MicroSleep(-1);
345349
}
346-
BASSControl.ReleaseResources((MainWindow.KMCGlobals.CancellationPendingValue != 1));
350+
351+
BASSControl.ReleaseResources((MainWindow.KMCGlobals.CancellationPendingValue != 1), (MainWindow.KMCGlobals.CancellationPendingValue == 1));
352+
if (MainWindow.KMCGlobals.CancellationPendingValue == 1) break;
347353
}
348354

349355
MainWindow.KMCStatus.RenderingMode = false;
@@ -359,7 +365,7 @@ public static void PBWork(object sender, DoWorkEventArgs e)
359365
catch (Exception exception)
360366
{
361367
BasicFunctions.WriteToConsole(exception);
362-
BASSControl.ReleaseResources(false);
368+
BASSControl.ReleaseResources(false, true);
363369
}
364370
}
365371
catch (Exception exception2)
@@ -426,7 +432,9 @@ public static void PBRWork(object sender, DoWorkEventArgs e)
426432

427433
TimerFuncs.MicroSleep(-1);
428434
}
429-
BASSControl.ReleaseResources((MainWindow.KMCGlobals.CancellationPendingValue != 1));
435+
436+
BASSControl.ReleaseResources((MainWindow.KMCGlobals.CancellationPendingValue != 1), (MainWindow.KMCGlobals.CancellationPendingValue == 1));
437+
if (MainWindow.KMCGlobals.CancellationPendingValue == 1) break;
430438
}
431439

432440
MainWindow.KMCStatus.RenderingMode = false;
@@ -442,7 +450,7 @@ public static void PBRWork(object sender, DoWorkEventArgs e)
442450
catch (Exception exception)
443451
{
444452
BasicFunctions.WriteToConsole(exception);
445-
BASSControl.ReleaseResources(false);
453+
BASSControl.ReleaseResources(false, true);
446454
}
447455
}
448456
catch (Exception exception2)

KeppyMIDIConverter/Languages/Lang.it-IT.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ Lasciare i valori fonte su 0 per i banchi SFZ.</value>
695695
<comment>Self-explanatory.</comment>
696696
</data>
697697
<data name="0Translators0" xml:space="preserve">
698-
<value>KaleidonKep99</value>
698+
<value>Riccardo Loi</value>
699699
<comment>You translated it! I think... If it says "KaleidonKep99", then you didn't.</comment>
700700
</data>
701701
<data name="AdvancedVoicesChannel" xml:space="preserve">

KeppyMIDIConverter/Properties/AssemblyInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
[assembly: AssemblyTitle("Keppy's MIDI Converter")]
99
[assembly: AssemblyDescription("Convert your favorite MIDIs to audio files!")]
1010
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("KaleidonKep99")]
11+
[assembly: AssemblyCompany("Riccardo Loi")]
1212
[assembly: AssemblyProduct("KeppyMIDIConverter")]
13-
[assembly: AssemblyCopyright("Copyright © KaleidonKep99 2013")]
13+
[assembly: AssemblyCopyright("Copyright © Riccardo Loi 2013")]
1414
[assembly: AssemblyTrademark("KMC")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -32,5 +32,5 @@
3232
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
3333
// usando l'asterisco '*' come illustrato di seguito:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("18.2.2")]
36-
[assembly: AssemblyFileVersion("18.2.2")]
35+
[assembly: AssemblyVersion("18.2.3")]
36+
[assembly: AssemblyFileVersion("18.2.3")]

KeppyMIDIConverter/kmcsetup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#define vc
66

77
#define MyAppSetupName "Keppy's MIDI Converter"
8-
#define MyAppVersion '18.2.2'
8+
#define MyAppVersion '18.2.3'
99

1010
[Setup]
1111
AllowCancelDuringInstall=False

KeppyMIDIConverter/kmcupdate.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.2.2
1+
18.2.3

0 commit comments

Comments
 (0)