diff --git a/Daigassou/Common.cs b/Daigassou/Common.cs index d6413bd..ca8344b 100644 --- a/Daigassou/Common.cs +++ b/Daigassou/Common.cs @@ -4,19 +4,16 @@ using System.Diagnostics; using System.Linq; using System.Runtime.InteropServices; -using System.Threading.Tasks; +using System.Text; using System.Windows.Forms; -using System.Xml.Linq; using AutoUpdaterDotNET; using Daigassou.Controller; -using Daigassou.Forms; using Daigassou.Properties; using Newtonsoft.Json; using Newtonsoft.Json.Linq; - -using Sunny.UI; -using NHotkey.WindowsForms; using NHotkey; +using NHotkey.WindowsForms; +using Sunny.UI; namespace Daigassou.Utils { @@ -25,60 +22,47 @@ public class CommObject public eventCata eventId { get; set; } /// - /// EventID = MIDI_FILE_NAME: string, midiFilepath - /// EventID = TRACK_FILE_NAME: string, trackIndex | trackName - /// EventID = MIDI_CONTROL_START_COUNTDOWN: int, startOffset - /// EventID = MIDI_CONTROL_START_ENSEMBLE: int, startOffset - /// EventID = MIDI_CONTROL_STOP: No Payload - /// EventID = MIDI_CONTROL_INSTRUCODE: int , instrument code + /// EventID = MIDI_FILE_NAME: string, midiFilepath + /// EventID = TRACK_FILE_NAME: string, trackIndex | trackName + /// EventID = MIDI_CONTROL_START_COUNTDOWN: int, startOffset + /// EventID = MIDI_CONTROL_START_ENSEMBLE: int, startOffset + /// EventID = MIDI_CONTROL_STOP: No Payload + /// EventID = MIDI_CONTROL_INSTRUCODE: int , instrument code /// public object payload { get; set; } - } - public enum eventCata:int + public enum eventCata { - MIDI_FILE_NAME=1000, - TRACK_FILE_NAME=1001, - MIDI_FILE_NAME_CROSS=1010, - MIDI_CONTROL_START_COUNTDOWN=2000, - MIDI_CONTROL_START_ENSEMBLE=2001, + MIDI_FILE_NAME = 1000, + TRACK_FILE_NAME = 1001, + MIDI_FILE_NAME_CROSS = 1010, + MIDI_CONTROL_START_COUNTDOWN = 2000, + MIDI_CONTROL_START_ENSEMBLE = 2001, MIDI_CONTROL_START_TIMER = 2002, MIDI_CONTROL_START_KEY = 2003, - MIDI_CONTROL_STOP =2010, + MIDI_CONTROL_STOP = 2010, MIDI_CONTROL_INSTRUCODE = 2020, MIDI_CONTROL_PITCHUP = 2031, - MIDI_CONTROL_PITCHDOWN = 2032, - + MIDI_CONTROL_PITCHDOWN = 2032 } + public class Utils { private const string OriginalTitle = @"FINAL FANTASY XIV"; private const uint WM_SETTEXT = 0x000C; private const int WM_COPYDATA = 0x004A; private const uint WM_MIDICONTROL = 0x3378; - public struct COPYDATASTRUCT - - { - - public IntPtr dwData; - - public int cData; - - [MarshalAs(UnmanagedType.LPStr)] - - public string lpData; - - } [DllImport("User32.dll")] - public static extern int SendMessage(IntPtr hwnd, int msg, int wParam, ref COPYDATASTRUCT IParam); [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern IntPtr SendMessage(IntPtr hWnd, uint wmMsg, IntPtr wParam, string lParam); + [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern IntPtr SendMessage(IntPtr hWnd, uint wmMsg, IntPtr wParam, int lParam); + /// public static void SetGameTitle(IntPtr intPtr, bool customTitle = true, string name = "最终幻想XIV") { @@ -98,40 +82,31 @@ public static void TimeSync() double error; try { - var offset = new NtpClient(Settings.Default.NtpServer).GetOffset(out error); - + // TODO: error handler if (SetSystemDateTime.SetLocalTimeByStr( DateTime.Now.AddMilliseconds(offset.TotalMilliseconds * -0.5))) ; - } catch (Exception e) { - - } - - - } - public static void SendMessageToAll(eventCata ev,string message) + public static void SendMessageToAll(eventCata ev, string message) { foreach (var process in Process.GetProcessesByName("Daigassou")) - { if (process.MainWindowHandle != Process.GetCurrentProcess().MainWindowHandle) { - - if (ev==eventCata.MIDI_FILE_NAME_CROSS) + if (ev == eventCata.MIDI_FILE_NAME_CROSS) { - byte[] arr = System.Text.Encoding.Default.GetBytes(message); + var arr = Encoding.Default.GetBytes(message); - int len = arr.Length; + var len = arr.Length; COPYDATASTRUCT cdata; - cdata.dwData = (IntPtr)100; + cdata.dwData = (IntPtr) 100; cdata.lpData = message; @@ -141,34 +116,32 @@ public static void SendMessageToAll(eventCata ev,string message) } else { - SendMessage(process.MainWindowHandle, WM_MIDICONTROL, IntPtr.Zero, (int)ev); + SendMessage(process.MainWindowHandle, WM_MIDICONTROL, IntPtr.Zero, (int) ev); } - - - } - } } public static void CheckForUpdate() { - AutoUpdater.ParseUpdateInfoEvent += AutoUpdaterOnParseUpdateInfoEvent; AutoUpdater.ShowSkipButton = false; AutoUpdater.LetUserSelectRemindLater = false; - AutoUpdater.RemindLaterTimeSpan = RemindLaterFormat.Days; - AutoUpdater.RemindLaterAt = 1; + AutoUpdater.RemindLaterTimeSpan = RemindLaterFormat.Hours; + AutoUpdater.RemindLaterAt = 12; + + #if DEBUG AutoUpdater.Start("https://up.xiv.pub/version_test.json"); -#endif +#else AutoUpdater.Start("https://up.xiv.pub/version.json"); +#endif } - + private static void AutoUpdaterOnParseUpdateInfoEvent(ParseUpdateInfoEventArgs args) { dynamic json = JsonConvert.DeserializeObject(args.RemoteData); - NetworkParser.opcodeDict["countDownPacket"]=json.opcode.countDownPacket; + NetworkParser.opcodeDict["countDownPacket"] = json.opcode.countDownPacket; NetworkParser.opcodeDict["ensembleStopPacket"] = json.opcode.ensembleStopPacket; NetworkParser.opcodeDict["partyStopPacket"] = json.opcode.partyStopPacket; NetworkParser.opcodeDict["ensembleStartPacket"] = json.opcode.ensembleStartPacket; @@ -190,18 +163,26 @@ private static void AutoUpdaterOnParseUpdateInfoEvent(ParseUpdateInfoEventArgs a Value = json.checksum.value, HashingAlgorithm = json.checksum.hashingAlgorithm } - }; - + } + + public struct COPYDATASTRUCT + + { + public IntPtr dwData; + + public int cData; + + [MarshalAs(UnmanagedType.LPStr)] public string lpData; } } public class HotkeyWrapper { - - public string name=""; public Keys hk; - public bool isOccupied = false; + public bool isOccupied; + + public string name = ""; public HotkeyWrapper(string _name, Keys _mk) { @@ -209,49 +190,45 @@ public HotkeyWrapper(string _name, Keys _mk) hk = _mk; } } + public class HotkeyUtils { //public HotKeyManager hkm; private static HotkeyUtils hku; - - public EventHandler HotKeyHandler; - public ArrayList hotkeysArrayList { get;set; } - public static HotkeyUtils GetInstance(Form f=null) - { - if (hku==null) - { - hku = new HotkeyUtils(f); - } - return hku; - } + public EventHandler HotKeyHandler; public HotkeyUtils(Form f) { - //hkm = new HotKeyManager(f); hotkeysArrayList = new ArrayList(); } + public ArrayList hotkeysArrayList { get; set; } + + public static HotkeyUtils GetInstance(Form f = null) + { + if (hku == null) hku = new HotkeyUtils(f); + + return hku; + } + public void RemoveHotKey(string name) { HotkeyManager.Current.Remove(name); - hotkeysArrayList.Remove(hotkeysArrayList.ToList().Find(x=>x.name==name)); + hotkeysArrayList.Remove(hotkeysArrayList.ToList().Find(x => x.name == name)); } + public bool UpdateHotkey(HotkeyWrapper hwWrapper) { HotkeyManager.Current.IsEnabled = false; var currentHotkey = hotkeysArrayList.ToList().Find(x => x.name == hwWrapper.name); - if (currentHotkey==null) - { + if (currentHotkey == null) hotkeysArrayList.Add(hwWrapper); - } else - { hotkeysArrayList[hotkeysArrayList.IndexOf(currentHotkey)] = hwWrapper; - } - - bool ret = true; + + var ret = true; try { HotkeyManager.Current.AddOrReplace(hwWrapper.name, hwWrapper.hk, HotkeyUtils_HotKeyPressed); @@ -262,10 +239,9 @@ public bool UpdateHotkey(HotkeyWrapper hwWrapper) ret = false; hwWrapper.isOccupied = true; } - + HotkeyManager.Current.IsEnabled = true; return ret; - } public void LoadConfig() @@ -276,24 +252,22 @@ public void LoadConfig() var tmpArraylist = JsonConvert.DeserializeObject(Settings.Default.HotKeyBinding); foreach (JObject j in tmpArraylist) - { hotkeysArrayList.Add( - new HotkeyWrapper(j["name"].Value(), (Keys)j["hk"].Value())); - } + new HotkeyWrapper(j["name"].Value(), (Keys) j["hk"].Value())); } } + public void ResetConfig() { - bool registFlag = true; + var registFlag = true; HotkeyManager.Current.IsEnabled = false; hotkeysArrayList.Clear(); - hotkeysArrayList.Add(new HotkeyWrapper("Start", Keys.Control| Keys.F10)); - hotkeysArrayList.Add(new HotkeyWrapper("Stop", Keys.Control| Keys.F11)); - hotkeysArrayList.Add(new HotkeyWrapper("PitchUp", Keys.Control | Keys.Alt| Keys.Up)); - hotkeysArrayList.Add(new HotkeyWrapper("PitchDown", Keys.Control | Keys.Alt| Keys.Down)); + hotkeysArrayList.Add(new HotkeyWrapper("Start", Keys.Control | Keys.F10)); + hotkeysArrayList.Add(new HotkeyWrapper("Stop", Keys.Control | Keys.F11)); + hotkeysArrayList.Add(new HotkeyWrapper("PitchUp", Keys.Control | Keys.Alt | Keys.Up)); + hotkeysArrayList.Add(new HotkeyWrapper("PitchDown", Keys.Control | Keys.Alt | Keys.Down)); foreach (HotkeyWrapper hk in hotkeysArrayList) - { try { HotkeyManager.Current.AddOrReplace(hk.name, hk.hk, HotkeyUtils_HotKeyPressed); @@ -302,21 +276,15 @@ public void ResetConfig() { hk.isOccupied = true; registFlag = false; - } - } - if (!registFlag) - { - UIMessageTip.ShowError("部分快捷键注册失败"); - } + if (!registFlag) UIMessageTip.ShowError("部分快捷键注册失败"); HotkeyManager.Current.IsEnabled = true; - } + public void SaveConfig() { - Settings.Default.HotKeyBinding = JsonConvert.SerializeObject(hotkeysArrayList); Settings.Default.Save(); } @@ -326,12 +294,9 @@ public void InitHotKey() HotkeyManager.Current.IsEnabled = false; - if (Settings.Default.HotKeyBinding != "") { LoadConfig(); - - } else { @@ -340,39 +305,29 @@ public void InitHotKey() } - - bool registFlag = true; + var registFlag = true; foreach (HotkeyWrapper hk in hotkeysArrayList) - { try { - HotkeyManager.Current.AddOrReplace(hk.name,hk.hk,HotkeyUtils_HotKeyPressed); + HotkeyManager.Current.AddOrReplace(hk.name, hk.hk, HotkeyUtils_HotKeyPressed); } catch (Exception e) { hk.isOccupied = true; registFlag = false; - } - } - if (!registFlag) - { - UIMessageTip.ShowError("部分快捷键注册失败"); - } + if (!registFlag) UIMessageTip.ShowError("部分快捷键注册失败"); HotkeyManager.Current.IsEnabled = true; - } - private void HotkeyUtils_HotKeyPressed(object sender, HotkeyEventArgs e) { - HotKeyHandler.Invoke(sender,e); + HotKeyHandler.Invoke(sender, e); } - } public struct SystemTime @@ -394,8 +349,8 @@ public class SetSystemDateTime public static bool SetLocalTimeByStr(DateTime dt) { - bool flag = false; - SystemTime sysTime = new SystemTime(); + var flag = false; + var sysTime = new SystemTime(); sysTime.wYear = Convert.ToUInt16(dt.Year); sysTime.wMonth = Convert.ToUInt16(dt.Month); sysTime.wDay = Convert.ToUInt16(dt.Day); @@ -405,16 +360,16 @@ public static bool SetLocalTimeByStr(DateTime dt) sysTime.wMiliseconds = Convert.ToUInt16(dt.Millisecond); try { - flag = SetSystemDateTime.SetLocalTime(ref sysTime); + flag = SetLocalTime(ref sysTime); } catch (Exception e) { - } return flag; } } + public class KeyPlayList { public enum NoteEvent diff --git a/Daigassou/Forms/MainFormEx.Designer.cs b/Daigassou/Forms/MainFormEx.Designer.cs index e503e02..6993250 100644 --- a/Daigassou/Forms/MainFormEx.Designer.cs +++ b/Daigassou/Forms/MainFormEx.Designer.cs @@ -30,11 +30,11 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainFormEx)); - System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("独奏", 0, 1); - System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("合奏", 2, 3); - System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("外接", 4, 5); - System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("设置", 6, 7); - System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("试听", 8, 9); + System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("独奏", 0, 1); + System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("合奏", 2, 3); + System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("外接", 4, 5); + System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("设置", 6, 7); + System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("试听", 8, 9); this.uiStyleManager1 = new Sunny.UI.UIStyleManager(this.components); this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.uiNavMenu1 = new Sunny.UI.UINavMenu(); @@ -83,32 +83,32 @@ private void InitializeComponent() this.uiNavMenu1.Margin = new System.Windows.Forms.Padding(0); this.uiNavMenu1.MenuStyle = Sunny.UI.UIMenuStyle.Custom; this.uiNavMenu1.Name = "uiNavMenu1"; - treeNode1.ImageIndex = 0; - treeNode1.Name = "节点0"; - treeNode1.SelectedImageIndex = 1; - treeNode1.Text = "独奏"; - treeNode2.ImageIndex = 2; - treeNode2.Name = "节点1"; - treeNode2.SelectedImageIndex = 3; - treeNode2.Text = "合奏"; - treeNode3.ImageIndex = 4; - treeNode3.Name = "节点2"; - treeNode3.SelectedImageIndex = 5; - treeNode3.Text = "外接"; - treeNode4.ImageIndex = 6; - treeNode4.Name = "节点3"; - treeNode4.SelectedImageIndex = 7; - treeNode4.Text = "设置"; - treeNode5.ImageIndex = 8; - treeNode5.Name = "节点4"; - treeNode5.SelectedImageIndex = 9; - treeNode5.Text = "试听"; + treeNode6.ImageIndex = 0; + treeNode6.Name = "节点0"; + treeNode6.SelectedImageIndex = 1; + treeNode6.Text = "独奏"; + treeNode7.ImageIndex = 2; + treeNode7.Name = "节点1"; + treeNode7.SelectedImageIndex = 3; + treeNode7.Text = "合奏"; + treeNode8.ImageIndex = 4; + treeNode8.Name = "节点2"; + treeNode8.SelectedImageIndex = 5; + treeNode8.Text = "外接"; + treeNode9.ImageIndex = 6; + treeNode9.Name = "节点3"; + treeNode9.SelectedImageIndex = 7; + treeNode9.Text = "设置"; + treeNode10.ImageIndex = 8; + treeNode10.Name = "节点4"; + treeNode10.SelectedImageIndex = 9; + treeNode10.Text = "试听"; this.uiNavMenu1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { - treeNode1, - treeNode2, - treeNode3, - treeNode4, - treeNode5}); + treeNode6, + treeNode7, + treeNode8, + treeNode9, + treeNode10}); this.uiNavMenu1.ScrollBarColor = System.Drawing.Color.White; this.uiNavMenu1.ScrollBarHoverColor = System.Drawing.Color.White; this.uiNavMenu1.ScrollBarPressColor = System.Drawing.Color.White; @@ -173,8 +173,8 @@ private void InitializeComponent() // toolStripStatusLabel2 // this.toolStripStatusLabel2.Name = "toolStripStatusLabel2"; - this.toolStripStatusLabel2.Size = new System.Drawing.Size(313, 20); - this.toolStripStatusLabel2.Text = "开源免费,请勿购买。|请勿修改程序文件名!"; + this.toolStripStatusLabel2.Size = new System.Drawing.Size(335, 20); + this.toolStripStatusLabel2.Text = "开源免费,请勿购买。|BUG反馈加群720145203"; // // MainFormEx // diff --git a/Daigassou/Forms/MainFormEx.cs b/Daigassou/Forms/MainFormEx.cs index 59b87a5..768fae9 100644 --- a/Daigassou/Forms/MainFormEx.cs +++ b/Daigassou/Forms/MainFormEx.cs @@ -1,5 +1,7 @@ using System; +using System.Diagnostics; using System.Drawing; +using System.IO; using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Windows.Forms; @@ -47,14 +49,40 @@ public MainFormEx() uiNavMenu1.SetNodePageIndex(uiNavMenu1.Nodes[4], (int) PageID.PreviewPlayPage); Utils.Utils.TimeSync(); - Utils.Utils.CheckForUpdate(); + + checkFileNameChanged(); + + Utils.Utils.CheckForUpdate(); + + toolStripStatusLabel1.Text = "当前版本: "+System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); } - + + private void checkFileNameChanged() + { + var targetName = Path.Combine(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule?.FileName), + "Daigassou.exe"); + + if (File.Exists(targetName) && Process.GetCurrentProcess().MainModule?.FileName != "Daigassou.exe") + { + var v = FileVersionInfo.GetVersionInfo(targetName).FileVersion; + if (v.ToString() != System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()) + { + UIMessageDialog.ShowWarningDialog(this,"更新提示","因当前文件名被修改,更新后请打开Daigassou.exe!"); + + } + + + + } + + + } + private void HotkeyUtils_HotKeyPressed(object sender, HotkeyEventArgs e) { switch (e.Name) diff --git a/Daigassou/Forms/MidiDevicePage.cs b/Daigassou/Forms/MidiDevicePage.cs index 2b9f3f0..b7fe546 100644 --- a/Daigassou/Forms/MidiDevicePage.cs +++ b/Daigassou/Forms/MidiDevicePage.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using Daigassou.Input_Midi; @@ -132,7 +133,7 @@ private void MidiDevicePage_Enter(object sender, EventArgs e) private void uiLinkLabel1_Click(object sender, EventArgs e) { - SendParamToFrame(333); + Process.Start("https://www.bilibili.com/video/BV1kG4y1R7sM/"); } } } \ No newline at end of file diff --git a/Daigassou/Forms/MuiltiPlayForm.Designer.cs b/Daigassou/Forms/MuiltiPlayForm.Designer.cs index efc9cde..2bf6b3f 100644 --- a/Daigassou/Forms/MuiltiPlayForm.Designer.cs +++ b/Daigassou/Forms/MuiltiPlayForm.Designer.cs @@ -112,6 +112,7 @@ private void InitializeComponent() this.uiLinkLabel1.Text = "视频教程"; this.uiLinkLabel1.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); this.uiLinkLabel1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + this.uiLinkLabel1.Click += new System.EventHandler(this.uiLinkLabel1_Click); // // uiDatetimePicker1 // diff --git a/Daigassou/Forms/MuiltiPlayForm.cs b/Daigassou/Forms/MuiltiPlayForm.cs index 8d7800b..8456a2d 100644 --- a/Daigassou/Forms/MuiltiPlayForm.cs +++ b/Daigassou/Forms/MuiltiPlayForm.cs @@ -163,5 +163,10 @@ private void MuiltiPlayForm_Enter(object sender, EventArgs e) { uiDatetimePicker1.Value = DateTime.Now; } + + private void uiLinkLabel1_Click(object sender, EventArgs e) + { + Process.Start("https://www.bilibili.com/video/BV11K411X7xC/"); + } } } \ No newline at end of file diff --git a/Daigassou/Forms/SettingPage.Designer.cs b/Daigassou/Forms/SettingPage.Designer.cs index 6dd5281..039d4a4 100644 --- a/Daigassou/Forms/SettingPage.Designer.cs +++ b/Daigassou/Forms/SettingPage.Designer.cs @@ -48,6 +48,11 @@ private void InitializeComponent() this.uiSymbolLabel2 = new Sunny.UI.UISymbolLabel(); this.uiSymbolLabel1 = new Sunny.UI.UISymbolLabel(); this.uiPanel1 = new Sunny.UI.UIPanel(); + this.uiPanel4 = new Sunny.UI.UIPanel(); + this.uiIntegerUpDown1 = new Sunny.UI.UIIntegerUpDown(); + this.uiSymbolLabel9 = new Sunny.UI.UISymbolLabel(); + this.uiSymbolLabel8 = new Sunny.UI.UISymbolLabel(); + this.uiSwitch1 = new Sunny.UI.UISwitch(); this.uiLinkLabel1 = new Sunny.UI.UILinkLabel(); this.updIntervalMinMs = new Sunny.UI.UIIntegerUpDown(); this.uiSymbolLabel4 = new Sunny.UI.UISymbolLabel(); @@ -55,11 +60,6 @@ private void InitializeComponent() this.updChordMinMs = new Sunny.UI.UIIntegerUpDown(); this.uiLine1 = new Sunny.UI.UILine(); this.uiToolTip1 = new Sunny.UI.UIToolTip(this.components); - this.uiPanel4 = new Sunny.UI.UIPanel(); - this.uiSymbolLabel8 = new Sunny.UI.UISymbolLabel(); - this.uiSwitch1 = new Sunny.UI.UISwitch(); - this.uiSymbolLabel9 = new Sunny.UI.UISymbolLabel(); - this.uiIntegerUpDown1 = new Sunny.UI.UIIntegerUpDown(); this.uiPanel3.SuspendLayout(); this.uiPanel2.SuspendLayout(); this.uiPanel1.SuspendLayout(); @@ -426,6 +426,103 @@ private void InitializeComponent() this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; this.uiPanel1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); // + // uiPanel4 + // + this.uiPanel4.Controls.Add(this.uiIntegerUpDown1); + this.uiPanel4.Controls.Add(this.uiSymbolLabel9); + this.uiPanel4.Controls.Add(this.uiSymbolLabel8); + this.uiPanel4.Controls.Add(this.uiSwitch1); + this.uiPanel4.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); + this.uiPanel4.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); + this.uiPanel4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiPanel4.Location = new System.Drawing.Point(277, 0); + this.uiPanel4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.uiPanel4.MinimumSize = new System.Drawing.Size(1, 1); + this.uiPanel4.Name = "uiPanel4"; + this.uiPanel4.RadiusSides = Sunny.UI.UICornerRadiusSides.None; + this.uiPanel4.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(190)))), ((int)(((byte)(172))))); + this.uiPanel4.Size = new System.Drawing.Size(209, 100); + this.uiPanel4.Style = Sunny.UI.UIStyle.Colorful; + this.uiPanel4.TabIndex = 37; + this.uiPanel4.Text = null; + this.uiPanel4.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; + this.uiPanel4.Visible = false; + this.uiPanel4.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + // + // uiIntegerUpDown1 + // + this.uiIntegerUpDown1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); + this.uiIntegerUpDown1.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); + this.uiIntegerUpDown1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiIntegerUpDown1.HasMaximum = true; + this.uiIntegerUpDown1.HasMinimum = true; + this.uiIntegerUpDown1.Location = new System.Drawing.Point(91, 46); + this.uiIntegerUpDown1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.uiIntegerUpDown1.Maximum = 65535; + this.uiIntegerUpDown1.MaximumEnabled = true; + this.uiIntegerUpDown1.Minimum = 1000; + this.uiIntegerUpDown1.MinimumEnabled = true; + this.uiIntegerUpDown1.MinimumSize = new System.Drawing.Size(100, 0); + this.uiIntegerUpDown1.Name = "uiIntegerUpDown1"; + this.uiIntegerUpDown1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(190)))), ((int)(((byte)(172))))); + this.uiIntegerUpDown1.ShowText = false; + this.uiIntegerUpDown1.Size = new System.Drawing.Size(112, 26); + this.uiIntegerUpDown1.Style = Sunny.UI.UIStyle.Colorful; + this.uiIntegerUpDown1.TabIndex = 32; + this.uiIntegerUpDown1.Text = "uiIntegerUpDown2"; + this.uiIntegerUpDown1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; + this.uiIntegerUpDown1.Value = 2345; + this.uiIntegerUpDown1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + this.uiIntegerUpDown1.ValueChanged += new Sunny.UI.UIIntegerUpDown.OnValueChanged(this.uiIntegerUpDown1_ValueChanged); + // + // uiSymbolLabel9 + // + this.uiSymbolLabel9.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiSymbolLabel9.Location = new System.Drawing.Point(3, 43); + this.uiSymbolLabel9.MinimumSize = new System.Drawing.Size(1, 1); + this.uiSymbolLabel9.Name = "uiSymbolLabel9"; + this.uiSymbolLabel9.Padding = new System.Windows.Forms.Padding(30, 0, 0, 0); + this.uiSymbolLabel9.Size = new System.Drawing.Size(93, 35); + this.uiSymbolLabel9.Style = Sunny.UI.UIStyle.Colorful; + this.uiSymbolLabel9.Symbol = 362787; + this.uiSymbolLabel9.SymbolOffset = new System.Drawing.Point(4, 0); + this.uiSymbolLabel9.SymbolSize = 26; + this.uiSymbolLabel9.TabIndex = 40; + this.uiSymbolLabel9.Text = "端口号"; + this.uiSymbolLabel9.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + // + // uiSymbolLabel8 + // + this.uiSymbolLabel8.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiSymbolLabel8.Location = new System.Drawing.Point(3, 6); + this.uiSymbolLabel8.MinimumSize = new System.Drawing.Size(1, 1); + this.uiSymbolLabel8.Name = "uiSymbolLabel8"; + this.uiSymbolLabel8.Padding = new System.Windows.Forms.Padding(30, 0, 0, 0); + this.uiSymbolLabel8.Size = new System.Drawing.Size(108, 35); + this.uiSymbolLabel8.Style = Sunny.UI.UIStyle.Colorful; + this.uiSymbolLabel8.Symbol = 362787; + this.uiSymbolLabel8.SymbolOffset = new System.Drawing.Point(4, 0); + this.uiSymbolLabel8.SymbolSize = 26; + this.uiSymbolLabel8.TabIndex = 39; + this.uiSymbolLabel8.Text = "启用歌词"; + this.uiSymbolLabel8.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + // + // uiSwitch1 + // + this.uiSwitch1.ActiveColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(190)))), ((int)(((byte)(172))))); + this.uiSwitch1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiSwitch1.Location = new System.Drawing.Point(128, 10); + this.uiSwitch1.MinimumSize = new System.Drawing.Size(1, 1); + this.uiSwitch1.Name = "uiSwitch1"; + this.uiSwitch1.Size = new System.Drawing.Size(70, 25); + this.uiSwitch1.Style = Sunny.UI.UIStyle.Colorful; + this.uiSwitch1.TabIndex = 38; + this.uiSwitch1.Text = "uiSwitch1"; + this.uiToolTip1.SetToolTip(this.uiSwitch1, "歌词功能使用说明\r\n 1.需要lrc文件与midi同名且放置在同一目录下\r\n 2目前仅支持发送到说话频道\r\n 3.需要选择midi文件和轨道,建议制作一条仅" + + "有两个音的轨道\r\n 4.歌词开始时间=midi开始播放时间,暂时不需要调整延迟"); + this.uiSwitch1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + this.uiSwitch1.ValueChanged += new Sunny.UI.UISwitch.OnValueChanged(this.uiSwitch1_ValueChanged); + // // uiLinkLabel1 // this.uiLinkLabel1.ActiveLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(155)))), ((int)(((byte)(40))))); @@ -441,6 +538,7 @@ private void InitializeComponent() this.uiLinkLabel1.Text = "视频教程"; this.uiLinkLabel1.VisitedLinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); this.uiLinkLabel1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + this.uiLinkLabel1.Click += new System.EventHandler(this.uiLinkLabel1_Click); // // updIntervalMinMs // @@ -554,106 +652,11 @@ private void InitializeComponent() this.uiToolTip1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(239))))); this.uiToolTip1.OwnerDraw = true; // - // uiPanel4 - // - this.uiPanel4.Controls.Add(this.uiIntegerUpDown1); - this.uiPanel4.Controls.Add(this.uiSymbolLabel9); - this.uiPanel4.Controls.Add(this.uiSymbolLabel8); - this.uiPanel4.Controls.Add(this.uiSwitch1); - this.uiPanel4.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); - this.uiPanel4.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); - this.uiPanel4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiPanel4.Location = new System.Drawing.Point(277, 0); - this.uiPanel4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.uiPanel4.MinimumSize = new System.Drawing.Size(1, 1); - this.uiPanel4.Name = "uiPanel4"; - this.uiPanel4.RadiusSides = Sunny.UI.UICornerRadiusSides.None; - this.uiPanel4.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(190)))), ((int)(((byte)(172))))); - this.uiPanel4.Size = new System.Drawing.Size(209, 100); - this.uiPanel4.Style = Sunny.UI.UIStyle.Colorful; - this.uiPanel4.TabIndex = 37; - this.uiPanel4.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; - this.uiPanel4.Visible = false; - this.uiPanel4.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - // - // uiSymbolLabel8 - // - this.uiSymbolLabel8.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiSymbolLabel8.Location = new System.Drawing.Point(3, 6); - this.uiSymbolLabel8.MinimumSize = new System.Drawing.Size(1, 1); - this.uiSymbolLabel8.Name = "uiSymbolLabel8"; - this.uiSymbolLabel8.Padding = new System.Windows.Forms.Padding(30, 0, 0, 0); - this.uiSymbolLabel8.Size = new System.Drawing.Size(108, 35); - this.uiSymbolLabel8.Style = Sunny.UI.UIStyle.Colorful; - this.uiSymbolLabel8.Symbol = 362787; - this.uiSymbolLabel8.SymbolOffset = new System.Drawing.Point(4, 0); - this.uiSymbolLabel8.SymbolSize = 26; - this.uiSymbolLabel8.TabIndex = 39; - this.uiSymbolLabel8.Text = "启用歌词"; - this.uiSymbolLabel8.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - // - // uiSwitch1 - // - this.uiSwitch1.ActiveColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(190)))), ((int)(((byte)(172))))); - this.uiSwitch1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiSwitch1.Location = new System.Drawing.Point(128, 10); - this.uiSwitch1.MinimumSize = new System.Drawing.Size(1, 1); - this.uiSwitch1.Name = "uiSwitch1"; - this.uiSwitch1.Size = new System.Drawing.Size(70, 25); - this.uiSwitch1.Style = Sunny.UI.UIStyle.Colorful; - this.uiSwitch1.TabIndex = 38; - this.uiSwitch1.Text = "uiSwitch1"; - this.uiToolTip1.SetToolTip(this.uiSwitch1, "歌词功能使用说明\r\n 1.需要lrc文件与midi同名且放置在同一目录下\r\n 2目前仅支持发送到说话频道\r\n 3.需要选择midi文件和轨道,建议制作一条仅" + - "有两个音的轨道\r\n 4.歌词开始时间=midi开始播放时间,暂时不需要调整延迟"); - this.uiSwitch1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - this.uiSwitch1.ValueChanged += new Sunny.UI.UISwitch.OnValueChanged(this.uiSwitch1_ValueChanged); - // - // uiSymbolLabel9 - // - this.uiSymbolLabel9.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiSymbolLabel9.Location = new System.Drawing.Point(3, 43); - this.uiSymbolLabel9.MinimumSize = new System.Drawing.Size(1, 1); - this.uiSymbolLabel9.Name = "uiSymbolLabel9"; - this.uiSymbolLabel9.Padding = new System.Windows.Forms.Padding(30, 0, 0, 0); - this.uiSymbolLabel9.Size = new System.Drawing.Size(93, 35); - this.uiSymbolLabel9.Style = Sunny.UI.UIStyle.Colorful; - this.uiSymbolLabel9.Symbol = 362787; - this.uiSymbolLabel9.SymbolOffset = new System.Drawing.Point(4, 0); - this.uiSymbolLabel9.SymbolSize = 26; - this.uiSymbolLabel9.TabIndex = 40; - this.uiSymbolLabel9.Text = "端口号"; - this.uiSymbolLabel9.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - // - // uiIntegerUpDown1 - // - this.uiIntegerUpDown1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); - this.uiIntegerUpDown1.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(251)))), ((int)(((byte)(250))))); - this.uiIntegerUpDown1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiIntegerUpDown1.HasMaximum = true; - this.uiIntegerUpDown1.HasMinimum = true; - this.uiIntegerUpDown1.Location = new System.Drawing.Point(91, 46); - this.uiIntegerUpDown1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.uiIntegerUpDown1.Maximum = 65535; - this.uiIntegerUpDown1.MaximumEnabled = true; - this.uiIntegerUpDown1.Minimum = 1000; - this.uiIntegerUpDown1.MinimumEnabled = true; - this.uiIntegerUpDown1.MinimumSize = new System.Drawing.Size(100, 0); - this.uiIntegerUpDown1.Name = "uiIntegerUpDown1"; - this.uiIntegerUpDown1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(190)))), ((int)(((byte)(172))))); - this.uiIntegerUpDown1.ShowText = false; - this.uiIntegerUpDown1.Size = new System.Drawing.Size(112, 26); - this.uiIntegerUpDown1.Style = Sunny.UI.UIStyle.Colorful; - this.uiIntegerUpDown1.TabIndex = 32; - this.uiIntegerUpDown1.Text = "uiIntegerUpDown2"; - this.uiIntegerUpDown1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; - this.uiIntegerUpDown1.Value = 2345; - this.uiIntegerUpDown1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - this.uiIntegerUpDown1.ValueChanged += new Sunny.UI.UIIntegerUpDown.OnValueChanged(this.uiIntegerUpDown1_ValueChanged); - // // SettingPage // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.ClientSize = new System.Drawing.Size(510, 350); + this.ControlBoxFillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(203)))), ((int)(((byte)(189))))); this.Controls.Add(this.uiPanel3); this.Controls.Add(this.uiLine3); this.Controls.Add(this.uiPanel1); diff --git a/Daigassou/Forms/SettingPage.cs b/Daigassou/Forms/SettingPage.cs index 8f10996..ca3c2f2 100644 --- a/Daigassou/Forms/SettingPage.cs +++ b/Daigassou/Forms/SettingPage.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using Daigassou.Properties; @@ -163,5 +164,10 @@ private void uiSwitch1_ValueChanged(object sender, bool value) { lyricPoster.IsLrcEnable = value; } + + private void uiLinkLabel1_Click(object sender, EventArgs e) + { + Process.Start("https://www.bilibili.com/video/BV1w44y1S7D9"); + } } } \ No newline at end of file diff --git a/Daigassou/Forms/SettingPage.resx b/Daigassou/Forms/SettingPage.resx index 6ade554..d5f6379 100644 --- a/Daigassou/Forms/SettingPage.resx +++ b/Daigassou/Forms/SettingPage.resx @@ -123,7 +123,4 @@ 184, 17 - - 184, 17 - \ No newline at end of file