private void InputDevicesComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (InputDevicesComboBox.SelectedIndex != 0) { inputDeviceName = InputDevicesComboBox.SelectedItem.ToString(); } else { inputDeviceName = null; } if (MidiEventListenerWorker.IsBusy) { listeningMidiEvents = false; MidiEventListenerWorker.CancelAsync(); } }
private void SlowRefreshUITimer_Tick(object sender, EventArgs e) { InitOrRefreshDevicesList(); if (inputDeviceName != null && !MidiEventListenerWorker.IsBusy) { listeningMidiEvents = true; MidiEventListenerWorker.RunWorkerAsync(); } if (listening) { ListeningLabel.Visible = !ListeningLabel.Visible; } else { ListeningLabel.Visible = false; } }