public MainForm() { InitializeComponent(); formUpdate(); KeyBinding.LoadConfig(); CommonUtilities.GetLatestVersion(); cbMidiKeyboard.DataSource = KeyboardUtilities.GetKeyboardList(); }
public MainForm() { InitializeComponent(); formUpdate(); KeyBinding.LoadConfig(); timeBeginPeriod(1); Text += $@" Ver{Assembly.GetExecutingAssembly().GetName().Version} "; cbMidiKeyboard.DataSource = KeyboardUtilities.GetKeyboardList(); kc.stopHandler += StopKeyPlay; }
public MainForm() { InitializeComponent(); formUpdate(); KeyBinding.LoadConfig(); timeBeginPeriod(1); Task.Run((Action)(() => { CommonUtilities.GetLatestVersion(); this.TimeSync(); })); Text += $@" Ver{Assembly.GetExecutingAssembly().GetName().Version} "; cbMidiKeyboard.DataSource = KeyboardUtilities.GetKeyboardList(); kc.stopHandler += StopKeyPlay; }
protected override void WndProc(ref Message m) { try { const int WM_DEVICECHANGE = 0x0219; switch (m.Msg) { case WM_DEVICECHANGE: cbMidiKeyboard.DataSource = KeyboardUtilities.GetKeyboardList(); break; } } catch (Exception ex) { } base.WndProc(ref m); }
private void btnKeyboardConnect_Click(object sender, EventArgs e) { if (cbMidiKeyboard.SelectedItem != null) { if (cbMidiKeyboard.Enabled) { if (KeyboardUtilities.Connect(cbMidiKeyboard.SelectedIndex) == 0) { cbMidiKeyboard.Enabled = false; btnKeyboardConnect.BackgroundImage = Resources.btn2; } } else { KeyboardUtilities.Disconnect(); cbMidiKeyboard.Enabled = true; cbMidiKeyboard.DataSource = KeyboardUtilities.GetKeyboardList(); btnKeyboardConnect.BackgroundImage = Resources.btn1; } } }
private void btnKeyboardConnect_Click(object sender, EventArgs e) { if (cbMidiKeyboard.SelectedItem != null) { if (cbMidiKeyboard.Enabled) { if (KeyboardUtilities.Connect(cbMidiKeyboard.SelectedItem.ToString(), kc) == 0) { cbMidiKeyboard.Enabled = false; btnKeyboardConnect.BackColor = Color.Aquamarine; } } else { KeyboardUtilities.Disconnect(); cbMidiKeyboard.Enabled = true; cbMidiKeyboard.DataSource = KeyboardUtilities.GetKeyboardList(); btnKeyboardConnect.BackColor = Color.FromArgb(255, 110, 128); } } }
public MainForm() { InitializeComponent(); formUpdate(); KeyBinding.LoadConfig(); timeBeginPeriod(1); ThreadPool.SetMaxThreads(25, 50); Task.Run((Action)(() => { CommonUtilities.GetLatestVersion(); this.TimeSync(); })); if (DateTime.Now > new DateTime(2020, 03, 15)) { Environment.Exit(-2); } Text += $@" Ver{Assembly.GetExecutingAssembly().GetName().Version}"; cbMidiKeyboard.DataSource = KeyboardUtilities.GetKeyboardList(); kc.stopHandler += StopKeyPlay; }