Ejemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();
            formUpdate();
            KeyBinding.LoadConfig();
            CommonUtilities.GetLatestVersion();

            cbMidiKeyboard.DataSource = KeyboardUtilities.GetKeyboardList();
        }
Ejemplo n.º 2
0
        public MainForm()
        {
            InitializeComponent();
            formUpdate();
            KeyBinding.LoadConfig();
            timeBeginPeriod(1);

            Text += $@" Ver{Assembly.GetExecutingAssembly().GetName().Version} ";
            cbMidiKeyboard.DataSource = KeyboardUtilities.GetKeyboardList();
            kc.stopHandler           += StopKeyPlay;
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 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;
         }
     }
 }
Ejemplo n.º 6
0
 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);
         }
     }
 }
Ejemplo n.º 7
0
        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;
        }