Exemplo n.º 1
0
 public void EndPlayEvent()
 {
     //throw new NotImplementedException();
     gw.nowPosition++;
     if (gw.nowPosition > 0 && gw.nowPosition < 4)
     {
         tbHint.Text = "正在校准位置(" + gw.nowPosition + "/4)";
     }
     else if (gw.nowPosition < 8)
     {
         tbHint.Text = "正在校准颜色(" + (gw.nowPosition - 4) + "/4)";
     }
     else
     {
         tbHint.Text = "校准完成";
         return;
     }
     mLaunchpad.Dispatcher.Invoke(
         new Action(
             delegate
     {
         mLaunchpad.SetButtonBorderBackground(gw.truePositions[gw.nowPosition], 2, new SolidColorBrush(Colors.Red));
     }
             ));
     canPlay = true;
 }
Exemplo n.º 2
0
        //private void SearchEquipmentOut(String deviceName)
        //{
        //    for (int j = 0; j < MidiDeviceBusiness.midiOutGetNumDevs(); j++)
        //    {
        //        MidiDeviceBusiness.MIDIOUTCAPS caps = new MidiDeviceBusiness.MIDIOUTCAPS();
        //        MidiDeviceBusiness.midiOutGetDevCaps(new UIntPtr((uint)j), ref caps, Convert.ToUInt32(Marshal.SizeOf(typeof(MidiDeviceBusiness.MIDIOUTCAPS))));
        //        //midiOutOpen(out IntPtr mOut, (uint)j, (IntPtr)0, (IntPtr)0, 0);
        //        String Pname = caps.szPname;
        //        if (Pname.Equals(deviceName)) {
        //            MidiDeviceBusiness.midiOutOpen(out IntPtr nowOutDeviceIntPtr, (uint)j, (IntPtr)0, (IntPtr)0, 0);
        //            UI.PlayUserControl.nowOutDeviceIntPtr = nowOutDeviceIntPtr;
        //            a();
        //            break;
        //        }
        //    }
        //}



        private void DoubleAnimation_Completed1(object sender, EventArgs e)
        {
            mBorderLaunchpad.Visibility = Visibility.Visible;
            DoubleAnimation doubleAnimation = new DoubleAnimation()
            {
                From     = 0,
                To       = 1,
                Duration = TimeSpan.FromSeconds(2)
            };

            mBorderLaunchpad.BeginAnimation(OpacityProperty, doubleAnimation);

            tbHint.Text = "正在校准位置(0/4)";
            DoubleAnimation doubleAnimation2 = new DoubleAnimation()
            {
                To       = 1,
                Duration = TimeSpan.FromSeconds(0.5)
            };

            tbHint.BeginAnimation(OpacityProperty, doubleAnimation2);

            mLaunchpad.SetButtonBorderBackground(11, 2, new SolidColorBrush(Colors.Red));
        }