Beispiel #1
0
        private void LoadValuesForFinger()
        {
            MidiFingerMessage fmX = mTouchMessages[(int)numFingers.Value - 1].MessageX;
            MidiFingerMessage fmY = mTouchMessages[(int)numFingers.Value - 1].MessageY;

            //updating current values in numeric boxes
            numCtrlMsgX.Value  = fmX.MidiCtrlr;
            numChannelX.Value  = fmX.MidiChannel;
            numMinValueX.Value = fmX.MinValue;
            numMaxValueX.Value = fmX.MaxValue;

            numCtrlMsgY.Value  = fmY.MidiCtrlr;
            numChannelY.Value  = fmY.MidiChannel;
            numMinValueY.Value = fmY.MinValue;
            numMaxValueY.Value = fmY.MaxValue;
        }
Beispiel #2
0
        private void DoSendMidiMessage(ref WacomMTFingerCollection fingercollection)
        {
            //if we decided to skip early frames
            if (skipEarlyFrames && fingercollection.FrameNumber >= framesToSkip)
            {
                if (!TouchHelper.AllFingersUp(ref fingercollection) && fingercollection.FingerCount <= 5)
                {
                    //X value for messages
                    MidiFingerMessage fmX = mtouchMessages[fingercollection.FingerCount - 1].MessageX;
                    int val = (int)(((fingercollection.GetFingerByIndex(0).X * 10000) * fmX.MaxValue) / 10000) + fmX.MinValue;
                    SendMidiMessage(fmX.MidiCtrlr, val, fmX.MidiChannel);

                    //Y value for messages
                    MidiFingerMessage fmY = mtouchMessages[fingercollection.FingerCount - 1].MessageY;
                    val = (int)(fmY.MaxValue - (((fingercollection.GetFingerByIndex(0).Y * 10000) * fmY.MaxValue) / 10000) + fmY.MinValue);
                    SendMidiMessage(fmY.MidiCtrlr, val, fmY.MidiChannel);
                }
            }
        }
Beispiel #3
0
        /*callback trigered when Save button clicked*/
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (numMinValueX.Value >= numMaxValueX.Value || numMaxValueX.Value <= numMinValueX.Value ||
                numMinValueY.Value >= numMaxValueY.Value || numMaxValueY.Value <= numMinValueY.Value)
            {
                MessageBox.Show("Minimum and maximum Values are not correct...", "Error", MessageBoxButtons.OK);
                numMinValueX.Value = numMinValueX.Minimum;
                numMaxValueX.Value = numMaxValueX.Maximum;
            }
            else
            {
                MidiFingerMessage fmX = mTouchMessages[(int)numFingers.Value - 1].MessageX;
                MidiFingerMessage fmY = mTouchMessages[(int)numFingers.Value - 1].MessageY;

                fmX.MidiCtrlr   = (int)numCtrlMsgX.Value;
                fmX.MidiChannel = (int)numChannelX.Value;
                fmX.MinValue    = (int)numMinValueX.Value;
                fmX.MaxValue    = (int)numMaxValueX.Value;

                fmY.MidiCtrlr   = (int)numCtrlMsgY.Value;
                fmY.MidiChannel = (int)numChannelY.Value;
                fmY.MinValue    = (int)numMinValueY.Value;
                fmY.MaxValue    = (int)numMaxValueY.Value;

                mTouchMessages[(int)numFingers.Value - 1].MessageX = fmX;
                mTouchMessages[(int)numFingers.Value - 1].MessageY = fmY;

                try
                {
                    mParent._conf.SaveConfiguration("Settings.xml", mTouchMessages);
                    MessageBox.Show("Configuration Saved !", "Success", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                catch
                {
                    MessageBox.Show("Error while saving parameters...");
                }
            }
        }