elementary / videos

Video player and library app designed for elementary OS
https://elementary.io
GNU General Public License v3.0
59 stars 18 forks source link

Create PlaybackManager #319

Closed danirabbit closed 1 year ago

danirabbit commented 1 year ago

Currently things like playback state, actions, the queue, etc are all stored across different widget-based classes. It's a huge mess with classes having to reach across each other and keep track of their instances to do anything.

This does the least to create a PlaybackManager class with a single instance where we can eventually store the queue, take actions, etc in a way that doesn't depend on the UI and doesn't involve passing objects around between classes etc

It's obviously kind of garbage right now because it doesn't actually hold the queue or the playbin, but hopefully it makes sense how eventually we'll get there and how even just this stops some of the reaching into other classes. Especially some obviously ridiculous lines like: ((Audience.Window)((Gtk.Application) Application.get_default ()).active_window).player_page.set_subtitle (external_subtitle_file.get_uri ());