Ejemplo n.º 1
0
        private void EncoderMoved(object sender, RotaryMovedHandlerArgs args)
        {
            Direction direction = args.Direction;
            if (!PlayModeActivated)
                return;

            if (!Settings.System.KnobControlEnabled)
                return;

            if (_isKnobPressed)
                return;

            switch (direction)
            {
                case Direction.RotateLeft:
                    _position--;

                    if (_position < 0)
                    {
                        _position = 0;
                        return; // 2014-06-19 : To prevent updating display if already at position 0

                    }

                    break;

                case Direction.RotateRight:
                    _position++;

                    if (_position >= KnobEntries.Count)
                    {
                        // Switch to LCM mode
                        _lcm.LcmActivated = true;
                        PlayModeActivated = false;
                        _position = 0;//_position - 1; // this will be the active position when return from Lcm mode
                        Log.WriteString(LogMessageType.Info, "Enter LCM");
                        return;
                    }
                    break;
            }

            if (KnobEntries.Count > 0)
                OnPositionChanged((AudioCore.MediaEntry) KnobEntries[_position]);
        }
        public void EncoderMoved(object sender, RotaryMovedHandlerArgs args)
        {
            if (!LcmActivated)
                return;

            if (_editConfig != null && _editConfig.IsAlive)
            {
                return;
            }

            _editConfig = new Thread(HandleConfiguration);
            _editConfig.Start();
        }