Skip to content

Commit

Permalink
2.0.1.2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
AmanoTooko committed Oct 22, 2018
1 parent 8ce96e2 commit fb319a1
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
7 changes: 5 additions & 2 deletions Daigassou/CommonUtilities.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Net;
using System.Reflection;
using System.Windows.Forms;
Expand All @@ -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)
{
Expand Down
10 changes: 9 additions & 1 deletion Daigassou/Input_Midi/MidiToKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions Daigassou/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions Daigassou/MainForm.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -36,6 +37,7 @@ public MainForm()

private void formUpdate()
{
Text += $" Ver{Assembly.GetExecutingAssembly().GetName().Version}";
if (Settings.Default.IsEightKeyLayout)
{
btn8key.BackgroundImage = Resources.ka1;
Expand Down Expand Up @@ -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
Expand All @@ -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;
}


Expand Down
4 changes: 2 additions & 2 deletions Daigassou/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
2 changes: 1 addition & 1 deletion Daigassou/Version.ORZ
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.1.1
2.0.1.2

0 comments on commit fb319a1

Please sign in to comment.