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 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.