public AlbumDetailView GetAlbumDetails(int id)
        {
            Album           album = GetAlbumById(id);
            AlbumDetailView model = new AlbumDetailView()
            {
                ArtistName  = GetArtistById(album.ArtistId).Name,
                GenreName   = GetGenreById(album.GenreId).Name,
                Price       = album.Price,
                AlbumTitle  = album.Title,
                AlbumArtUrl = album.AlbumArtUrl,
                Album       = GetAlbumById(album.AlbumId)
            };

            return(model);
        }
Example #2
0
        public AlbumDetails()
        {
            this.BackColor = Color.Black;

            this.Click += (s, e) => { this.RequestAction(QActionType.AdvanceScreen); };

            artwork                  = new Artwork();
            artwork.Click           += (s, e) => { this.RequestAction(QActionType.AdvanceScreen); };
            artwork.HideMousePointer = false;
            this.Controls.Add(artwork);

            txtDescription = new QTextArea();
            this.Controls.Add(txtDescription);

            btnLink                = new QButton(Localization.Get(UI_Key.Album_Details_View_On_Web), false, false);
            btnLink.BackColor      = this.BackColor;
            btnLink.ButtonPressed += new QButton.ButtonDelegate(link_ButtonPressed);
            btnLink.Enabled        = false;
            this.Controls.Add(btnLink);

            btnPlay                = new QButton(Localization.Get(UI_Key.Album_Details_Play_This_Album), false, false);
            btnPlay.BackColor      = this.BackColor;
            btnPlay.ButtonPressed += new QButton.ButtonDelegate(btnLink_ButtonPressed);
            btnPlay.Enabled        = true;
            this.Controls.Add(btnPlay);

            btnNext                = new QButton(Localization.Get(UI_Key.Album_Details_Next_Screen), false, false);
            btnNext.BackColor      = this.BackColor;
            btnNext.ButtonPressed += new QButton.ButtonDelegate(btnNext_ButtonPressed);
            btnNext.Enabled        = true;
            this.Controls.Add(btnNext);

            btnCopyToClipboard                = new QButton(Localization.Get(UI_Key.Album_Details_Copy_Info_To_Clipboard), false, false);
            btnCopyToClipboard.BackColor      = this.BackColor;
            btnCopyToClipboard.ButtonPressed += new QButton.ButtonDelegate(btnCopyToClipboard_ButtonPressed);
            btnCopyToClipboard.Enabled        = true;
            this.Controls.Add(btnCopyToClipboard);

            this.view = AlbumDetailView.Lyrics;

            artwork.SendToBack();

            txtDescription.Focus();
        }
Example #3
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;
            }
        }