Пример #1
0
 public Form1()
 {
     InitializeComponent();
     cb_mode.SelectedIndex = 1;
     text_music.AllowDrop  = true;
     KeyBoardListenerr.GetKeyDownEvent((key) =>
     {
         if (key == "CtrlI")
         {
             btn_play_Click(null, null);
         }
         if (key == "CtrlO")
         {
             btn_Stop_Click(null, null);
         }
     });
     Task.Run(() =>
     {
         string path = Console.ReadLine();
         Console.WriteLine("开始加载midi谱" + new FileInfo(path).Name);
     });
 }
 //public static Form1 MainForm;
 public Record()
 {
     InitializeComponent();
     KeyBoardListenerr.GetKeyDownEvent((key) =>
     {
         if (key == "CtrlP")
         {
             if (!isStart)
             {
                 Music.Start(DateTime.Now);
                 isStart = true;
             }
             else
             {
                 Music.End();
                 isStart = false;
             }
         }
         else
         {
             Music.Add(DateTime.Now, key);
         }
     });
 }