diff --git a/Daigassou/CommonUtilities.cs b/Daigassou/CommonUtilities.cs index a0a3049..a754098 100644 --- a/Daigassou/CommonUtilities.cs +++ b/Daigassou/CommonUtilities.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Net; using System.Reflection; using System.Windows.Forms; @@ -18,8 +19,10 @@ public static async void GetLatestVersion() var nowVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); var newVersion = await wc.DownloadStringTaskAsync(LatestApiAddress); if (nowVersion != newVersion) - MessageBox.Show($"检测到新版本{newVersion}已经发布,请下载最新版!", "更新啦!", MessageBoxButtons.OK, - MessageBoxIcon.Information); + if (MessageBox.Show($"检测到新版本{newVersion}已经发布,点击确定下载最新版哦!\r\n 当然就算你点了取消,这个提示每次打开还会出现的哦!", "哇——更新啦!", + MessageBoxButtons.OKCancel, + MessageBoxIcon.Information) == DialogResult.OK) + Process.Start("https://github.com/AmanoTooko/Daigassou/releases"); } catch (Exception e) { diff --git a/Daigassou/Input_Midi/MidiToKey.cs b/Daigassou/Input_Midi/MidiToKey.cs index 7511d17..d9b9a4a 100644 --- a/Daigassou/Input_Midi/MidiToKey.cs +++ b/Daigassou/Input_Midi/MidiToKey.cs @@ -40,7 +40,15 @@ public void OpenFile(string path) midi = MidiFile.Read(path, new ReadingSettings { NoHeaderChunkPolicy = NoHeaderChunkPolicy.Ignore, - NotEnoughBytesPolicy = NotEnoughBytesPolicy.Ignore + NotEnoughBytesPolicy = NotEnoughBytesPolicy.Ignore, + InvalidChannelEventParameterValuePolicy = InvalidChannelEventParameterValuePolicy.ReadValid, + InvalidChunkSizePolicy = InvalidChunkSizePolicy.Ignore, + InvalidMetaEventParameterValuePolicy = InvalidMetaEventParameterValuePolicy.SnapToLimits, + MissedEndOfTrackPolicy = MissedEndOfTrackPolicy.Ignore, + UnexpectedTrackChunksCountPolicy = UnexpectedTrackChunksCountPolicy.Ignore, + ExtraTrackChunkPolicy = ExtraTrackChunkPolicy.Read, + UnknownChunkIdPolicy = UnknownChunkIdPolicy.ReadAsUnknownChunk, + SilentNoteOnPolicy = SilentNoteOnPolicy.NoteOff }); Tmap = midi.GetTempoMap(); } diff --git a/Daigassou/MainForm.Designer.cs b/Daigassou/MainForm.Designer.cs index 4afc41d..282c242 100644 --- a/Daigassou/MainForm.Designer.cs +++ b/Daigassou/MainForm.Designer.cs @@ -319,7 +319,7 @@ private void InitializeComponent() this.nudBpm.ForeColor = System.Drawing.Color.Gray; this.nudBpm.Location = new System.Drawing.Point(182, 33); this.nudBpm.Maximum = new decimal(new int[] { - 240, + 250, 0, 0, 0}); @@ -384,7 +384,7 @@ private void InitializeComponent() this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(161, 20); this.label7.TabIndex = 2; - this.label7.Text = "设置BPM,范围40~240"; + this.label7.Text = "设置BPM,范围40~250"; // // cbMidiKeyboard // diff --git a/Daigassou/MainForm.cs b/Daigassou/MainForm.cs index a11a38e..b19c1c0 100644 --- a/Daigassou/MainForm.cs +++ b/Daigassou/MainForm.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Reflection; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; @@ -36,6 +37,7 @@ public MainForm() private void formUpdate() { + Text += $" Ver{Assembly.GetExecutingAssembly().GetName().Version}"; if (Settings.Default.IsEightKeyLayout) { btn8key.BackgroundImage = Resources.ka1; @@ -96,15 +98,15 @@ private void Form1_Load(object sender, EventArgs e) catch (Win32Exception) { MessageBox.Show("无法注册快捷键,请检查是否被其他程序占用。", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); - Application.Exit(); + Environment.Exit(0); } + hotKeyManager.KeyPressed += HotKeyManagerPressed; } private void selectFileButton_Click(object sender, EventArgs e) { - if (midFileDiag.ShowDialog() == DialogResult.OK) mtk.OpenFile(midFileDiag.FileName); else @@ -122,7 +124,12 @@ private void selectFileButton_Click(object sender, EventArgs e) trackComboBox.DataSource = tmp; trackComboBox.SelectedIndex = 0; - nudBpm.Value = bpm; + if (bpm >= nudBpm.Maximum) + nudBpm.Value = nudBpm.Maximum; + else if (bpm <= nudBpm.Minimum) + nudBpm.Value = nudBpm.Minimum; + else + nudBpm.Value = bpm; } diff --git a/Daigassou/Properties/AssemblyInfo.cs b/Daigassou/Properties/AssemblyInfo.cs index 0017af3..c4280cd 100644 --- a/Daigassou/Properties/AssemblyInfo.cs +++ b/Daigassou/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.1.1")] -[assembly: AssemblyFileVersion("2.0.1.1")] +[assembly: AssemblyVersion("2.0.1.2")] +[assembly: AssemblyFileVersion("2.0.1.2")] diff --git a/Daigassou/Version.ORZ b/Daigassou/Version.ORZ index d08c465..3066c37 100644 --- a/Daigassou/Version.ORZ +++ b/Daigassou/Version.ORZ @@ -1 +1 @@ -2.0.1.1 \ No newline at end of file +2.0.1.2 \ No newline at end of file