コード例 #1
0
ファイル: Push2.cs プロジェクト: Nagitch/Shining-of-Lives
        public static TouchStrip GetTouchStrip()
        {
            TouchStrip t = _TouchStrip.touchStrip.Clone();

            t.position = MidiMaster.GetBend();
            return(t);
        }
コード例 #2
0
ファイル: Parts.cs プロジェクト: Nagitch/Shining-of-Lives
        public TouchStrip Clone()
        {
            TouchStrip t = new TouchStrip();

            t.touched  = this.touched;
            t.position = this.position;
            t.number   = this.number;
            t.message  = this.message;
            t.name     = this.name;
            return(t);
        }
コード例 #3
0
ファイル: Push2.cs プロジェクト: Nagitch/Shining-of-Lives
        static void NoteOn(MidiChannel channel, int note, float velocity)
        {
            Pads.All.ForEach(pad =>
            {
                if (note != pad.number)
                {
                    return;
                }
                Pad p      = pad.Clone();
                p.pressure = velocity;
                if (padPressedDelegate != null)
                {
                    padPressedDelegate(p, velocity);
                }
            });

            RotaryEncoders.All.ForEach(encoder =>
            {
                if (note != encoder.touch.number)
                {
                    return;
                }
                RotaryEncoder e = encoder.Clone();
                e.touch.touched = true;
                if (encoderTouchedDelegate != null)
                {
                    encoderTouchedDelegate(e);
                }
            });

            if (note == _TouchStrip.touchStrip.number)
            {
                TouchStrip t = _TouchStrip.touchStrip.Clone();
                if (velocity == 1.0f)
                {
                    t.touched = true;
                    if (touchStripTouchedDelegate != null)
                    {
                        touchStripTouchedDelegate(t);
                    }
                }
                else if (velocity == 0.0f)
                {
                    t.touched = false;
                    if (touchStripReleasedDelegate != null)
                    {
                        touchStripReleasedDelegate(t);
                    }
                }
            }
        }