PlaybackPopover and Music views


Today I’ll talk about how the PlaybackPopover will work.

As I told you in the last post, PlaybackPopover will have three different layouts which will be associated to the view selected by the user.

Right, but what is a view on gnome-music?

Views are all the “screens” that the user can pass by. Technically speaking, each view is a child of a Gtk.Stack widget.

Music contains eight views in total: Empty, InitialState, Albums, Songs, Artists, Playlist, Search and SearchEmpty.

Empty and InitialState views appear when there is no music in user music directory. The only difference between these views is that InitialState only appears at the very first time Music starts.

If the music directory is not empty, the user can access the Albums, Songs, Artists and Playlist views by clicking on its respective buttons on the header bar.

The Search view appears when user types on the search bar. If there is no result, SearchEmpty view is displayed.

But how views do relate with PlaybackPopover? Actually, it is very simple.

Each view, (except for Empty, InitialState and EmptySearch views) produces a different playlist (not the playlist create by user)  which PlaybackPopover consumes.

The PlaybackPopover also has the views idea and it also uses a Gtk.Stack widget.

As I mentioned before, there are three different views for PlaybackPopover. These are the screenshots of the views current implemented (still need works on design, but the logic is almost done):

The first one is for Albums view:
Screenshot from 2016-02-09 20-26-31

The second one is for Playlists view:
Screenshot from 2016-02-09 20-28-50

And the third one is for Artist and Songs view:
Screenshot from 2016-02-09 20-28-13

Screenshot from 2016-02-09 20-38-27

The only difficult that I faced in this part of implementation was to transform the standard playlists into PlaybackPopover playlists. They are different and because of that, I was not able to get all the data that I needed. For example: in the Artists view, the playlist does not return the artist name.

Although the artist view issue is solved, I still don’t have a way to get the albums covers since by default Music just display it for the current track. Until now, I have not  figured out how to solve it. If I add a cover in Music playlist model to feed PlaybackPopover playlist model Music breaks.

So, that’s what I’m going to focus now.

See you! :)

2 thoughts on “PlaybackPopover and Music views

Leave a Reply

Your email address will not be published. Required fields are marked *