Ejemplo n.º 1
0
        public void RequestAction(QActionType Type)
        {
            switch (Type)
            {
            case QActionType.MoveDown:
            case QActionType.MoveTracksDown:
            case QActionType.PageDown:
                txtDescription.FirstVisibleYPixel += 20;
                break;

            case QActionType.SelectNextItemGamePadRight:
                txtDescription.FirstVisibleYPixel += 5;
                break;

            case QActionType.MoveUp:
            case QActionType.MoveTracksUp:
            case QActionType.PageUp:
                txtDescription.FirstVisibleYPixel -= 20;
                break;

            case QActionType.SelectPreviousItemGamePadRight:
                txtDescription.FirstVisibleYPixel -= 5;
                break;

            case QActionType.SelectNextItemGamePadLeft:
            case QActionType.SelectPreviousItemGamePadLeft:
            case QActionType.ReleaseAllFilters:
            case QActionType.ReleaseCurrentFilter:
            case QActionType.NextFilter:
            case QActionType.PreviousFilter:
                // suppress
                break;

            case QActionType.HTPCMode:
                controller.RequestActionNoRedirect(QActionType.HTPCMode);
                setViewMode();
                break;

            case QActionType.AdvanceScreen:
            case QActionType.AdvanceScreenWithoutMouse:
            case QActionType.ShowTrackAndAlbumDetails:
                if (currentTrack == null)
                {
                    // no reason to stay here
                    controller.RequestActionNoRedirect(QActionType.AdvanceScreen);
                }
                else
                {
                    switch (View)
                    {
                    case AlbumDetailView.Lyrics:
                        if (currentTrack.Album.Length == 0)
                        {
                            this.View = AlbumDetailView.ArtistInfo;
                        }
                        else
                        {
                            this.View = AlbumDetailView.AlbumInfo;
                        }
                        break;

                    case AlbumDetailView.AlbumInfo:
                        this.View = AlbumDetailView.ArtistInfo;
                        break;

                    case AlbumDetailView.ArtistInfo:
                        this.View = AlbumDetailView.Lyrics;         // for when we come back
                        controller.RequestActionNoRedirect(QActionType.AdvanceScreen);
                        if (currentTrack != null)
                        {
                            Clock.DoOnNewThread(updateLyrics, 30);
                        }
                        break;
                    }
                }
                break;

            default:
                controller.RequestActionNoRedirect(Type);
                break;
            }
        }