예제 #1
0
        public void NoteOn(NoteOnMessage msg)
        {
            /**
             * Keeping the control from cross-threading
             */
            if (txtMessages.InvokeRequired)
            {
                NoteOnCallback d = new NoteOnCallback(NoteOn);
                txtMessages.Invoke(d, new object[] { msg });
            }
            else
            {
                PrintMessage("ON / " + msg.Pitch + " / " + msg.Velocity);

                /**
                 * When Pause is ON, just play the test_sound
                 */
                if (checkPause)
                {
                    if (msg.Velocity > VELOCITY_MIN)
                    {
                        this.doPlay();
                    }
                }
                else
                {
                    /**
                     * If the button means NEXT, put the cursor on the next marker
                     */
                    if (msg.Pitch == this.pitchPrevious)
                    {
                        if (msg.Velocity > VELOCITY_MIN)
                        {
                            this.doPrevious();
                        }

                        /**
                         * If the button means STOP, stop everything
                         */
                    }
                    else if (msg.Pitch == this.pitchStop)
                    {
                        if (msg.Velocity > VELOCITY_MIN)
                        {
                            this.doStop();
                        }

                        /**
                         * If the button means NEXT, put the cursor on the next marker
                         */
                    }
                    else if (msg.Pitch == this.pitchNext)
                    {
                        if (msg.Velocity > VELOCITY_MIN)
                        {
                            this.doNext();
                        }

                        /**
                         * If the button means PLAY, play the media marker
                         */
                    }
                    else if (msg.Pitch == this.pitchPlay)
                    {
                        if (msg.Velocity > VELOCITY_MIN)
                        {
                            //Selecting ON ACTION
                            markerButtons[buttonCounter].BackColor = System.Drawing.ColorTranslator.FromHtml("#a1f73b");
                            this.doPlay();
                        }
                        else if (msg.Velocity == VELOCITY_MIN)
                        {
                            this.doNext();
                        }
                    }
                }
            }
        }
예제 #2
0
        public void NoteOn(NoteOnMessage msg)
        {
            /**
             * Keeping the control from cross-threading
             */
            if (txtMessages.InvokeRequired) {
                NoteOnCallback d = new NoteOnCallback(NoteOn);
                txtMessages.Invoke(d, new object[] { msg });
            } else {
                PrintMessage("ON / " + msg.Pitch + " / " + msg.Velocity);

                /**
                 * When Pause is ON, just play the test_sound
                 */
                if (checkPause) {
                    if (msg.Velocity > VELOCITY_MIN) {
                        this.doPlay();
                    }
                } else {
                    /**
                     * If the button means NEXT, put the cursor on the next marker
                     */
                    if (msg.Pitch == this.pitchPrevious) {
                        if (msg.Velocity > VELOCITY_MIN) {
                            this.doPrevious();
                        }

                    /**
                     * If the button means STOP, stop everything
                     */
                    } else if (msg.Pitch == this.pitchStop) {
                        if (msg.Velocity > VELOCITY_MIN) {
                            this.doStop();
                        }

                    /**
                     * If the button means NEXT, put the cursor on the next marker
                     */
                    } else if (msg.Pitch == this.pitchNext) {
                        if (msg.Velocity > VELOCITY_MIN) {
                            this.doNext();
                        }

                    /**
                     * If the button means PLAY, play the media marker
                     */
                    } else if (msg.Pitch == this.pitchPlay) {
                        if (msg.Velocity > VELOCITY_MIN) {
                            //Selecting ON ACTION
                            markerButtons[buttonCounter].BackColor = System.Drawing.ColorTranslator.FromHtml("#a1f73b");
                            this.doPlay();
                        } else if (msg.Velocity == VELOCITY_MIN) {
                            this.doNext();
                        }
                    }
                }
            }
        }