Commit Graph

839 Commits

Author SHA1 Message Date
Anna Schumaker 7975988dcc Emmental 2.6
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-18 13:37:50 -04:00
Anna Schumaker 6f9fb34792 db: Give playlists a delete() function
So we can remove playlists from the database when needed.

Implemets: Issue #29 (Give playlists a delete() function)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-16 17:37:23 -04:00
Anna Schumaker 2aad28f708 db: Give Playlists an "icon-name" property
This will be used by the sidebar to display playlist rows

Implements: Issue #20 (Give Playlist database items a icon-name property)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-15 16:11:34 -04:00
Anna Schumaker 063b93b66f db: Convert the TrackTable into a table.Table
Implements: Issue #11 (Cache database items fields)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-15 16:09:59 -04:00
Anna Schumaker 4235e794bd db: Convert the UserTable to a playlist.Model
Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-15 16:09:58 -04:00
Anna Schumaker 67238ed385 db: Give Albums a find_disc() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 17:03:19 -04:00
Anna Schumaker 44a002ecac db: Convert the DiscTable into a playlist.ChildModel
Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 17:02:04 -04:00
Anna Schumaker 737d135d41 db: Give Artists a find_album() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker a1f54839bb db: Convert the AlbumTable into a playlist.ChildModel
Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker 0728579cc4 db: Convert the ArtistTable into a playlist.Model
Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker f7907e4142 db: Convert the GenreTable into a playlist.Model
Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker 90c6593921 db: Give Decades a find_year() function
And adjust the Year table and Track table to take a Decade as an
argument.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker 4141ca211c db: Convert the YearTable into a playlist.ChildModel
Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker 8365afc0e3 db: Convert the DecadeTable into a playlist.Model
Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker e6a65f8fe3 db: Convert the LibraryTable into a table.Model
I actually turn it into a playlist.Model, which is a table.Model that
handles playlist states for us.

Implements: Issue #11 (Cache database items fields)
Implements: Issue #14 (Convert Tables into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker 84ad195716 db: Convert the PlaylistStateTable into a table.Table
This gives us access to the new functions and built-in caching. I also
change the PlaylistState object to cache its values rather than querying
the database for everything.

Implements: Issue #11 (Cache database items fields)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker ca3a88557f db: Create new playlist.Model and playlist.ChildModel classes
These take the table.Model and table.Child classes and add playlist
state management to them.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:57 -04:00
Anna Schumaker 6d796e0a89 db: Create new Playlist and ParentPlaylist classes
These are the base classes that will be used by all our Playlist-like
objects.

Implements: Issue #11 (Cache database items fields)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-14 13:22:56 -04:00
Anna Schumaker a4fbd5f2f3 db: Rename playlist.py -> user.py
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-11 11:58:43 -04:00
Anna Schumaker 658be5bef1 db: Create a new Child class
This inherites from the Table, but takes a parent instance for some
functions and calculates offsets for items that descend from this
parent.

Implements: Issue #1 (Have SQLite sort our sidebar tables)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-11 11:58:43 -04:00
Anna Schumaker feeee8809d db: Create a new Model class
This inherits from the Table, but also implements the Gio.ListModel
interface with sorting for use in the sidebar Gtk.ListView

Implements: Issue #1 (Have SQLite sort our sidebar tables)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-11 11:58:43 -04:00
Anna Schumaker 427b9fb925 db: Create a new Table class
This is a simlified Table that can be inherited from to implement a
Table-based Gio.ListModel. This gives us the chance to have some tables
that aren't ListModel's, since not everything will need that interface
and unnecessary position-finding slows everything down.

Implements: Issue #8 (Split up db/objects.py)
Implements: Issue #12 (Make database items unique)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-11 11:58:27 -04:00
Anna Schumaker 9cf1df7c33 db: Move SQLite Connection stuff into a new file
I find this cleaner than importing from the toplevel module

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-07 13:58:09 -04:00
Anna Schumaker 96a6bb1687 Emmental 2.5 AUR commit
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-07 09:31:03 -04:00
Anna Schumaker 715914c4e3 Emmental 2.5
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-07 09:29:24 -04:00
Anna Schumaker f14d73ce67 tagdb: Mark tracks as played using datetime.datetime.now()
So that we caputere the timestamp that the track finished at. I also
update tha sqlite importer code to account for the possibility of
receiving either a datetime.date or a datetime.datetime

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-10-01 11:16:02 -04:00
Anna Schumaker 6fc0fb6b26 audio: Create a new Selector object
This is used to query for the next or previous track. The Playlist layer
will implement our playlist stack as one of these objects, and set it on
the Player

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-30 11:07:20 -04:00
Anna Schumaker e38ce61cf7 audio: Convert our MenuButton into a Gtk.MenuButton
The Gtk.MenuButton doesn't have the same issue with staying "pressed in"
after changing replaygain settings that our custom version does.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-28 16:56:16 -04:00
Anna Schumaker 9c5b409d02 audio: Add ReplayGainComboBox and ReplayGainControl widgets
For setting the replaygain mode on the player

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-14 14:30:04 -04:00
Anna Schumaker 4f4e9efa28 audio: Set a ReplayGainSink as the playbin's audio sink
And create a rplaygain property that acts as a passthrough for
controlling the element.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-14 14:29:14 -04:00
Anna Schumaker 6792971ef7 audio: Add a custom ReplayGainSink
I use output-switcher and funnel elements so we can disable the
replaygain plugins by routing the stream around them if necessary.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-14 14:26:54 -04:00
Anna Schumaker d6a442277f audio: Clean up imports
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-08 10:07:46 -04:00
Anna Schumaker 8efb752614 audio: Add support for gapless playback
By responding to the about-to-finish signal. If it looks like we're
about to pause, then we let the EOS handler handle it instead.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-08 10:07:46 -04:00
Anna Schumaker ba1a444bdf audio: Have the player handle Autopause adjustments
Putting this in the playlist layer was an experiment, but it's easier to
do from the Player now that we've abstracted out all the Gstreamer stuff
into the BassClass

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-08 10:07:46 -04:00
Anna Schumaker 3a50235c38 audio: Rework the Artwork widget
It now sets artwork based on the signals sent by the player, allowing us
to move it out of the Player class and create instances based on the
global Player instead.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-08 10:07:45 -04:00
Anna Schumaker f55377cc69 audio: Remove the Player get_state() function
We can just check the playing property from the BasePlayer instead

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 15:55:11 -04:00
Anna Schumaker 8e509345bf audio: Clean up loading tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 15:55:07 -04:00
Anna Schumaker 39794c0830 audio: Move play_track() out of the Player
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 15:55:03 -04:00
Anna Schumaker b95ad55c9a audio: Give the BassPlayer an artwork signal
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:46:29 -04:00
Anna Schumaker 08696dd17a audio: Give the BassPlayer signals for eos and about-to-finish
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:46:00 -04:00
Anna Schumaker e467b784e4 audio: Give the BassPlayer a play_percent property
For calculating what percentage of a song has been played, which is used
to determine if a track can be marked as played or not

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:46:00 -04:00
Anna Schumaker 51e8bc295d audio: Give the BassPlayer a volume property
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:46:00 -04:00
Anna Schumaker fa2cbcc261 audio: Give the BassPlayer a position property
I use the state change callbacks to send a position-changed signal on a
regular interval when playback is going. Seeking is handled by setting
the position property to a new value.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:45:42 -04:00
Anna Schumaker a4595eab93 audio: Give the BassPlayer a duration property
I also add a duration-changed signal so the seek scale can update its
range.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:45:42 -04:00
Anna Schumaker a4464cd7d9 audio: Give the BassPlayer a playing property
To set either Gst.State.PLAYING or Gst.State.PAUSED on the playbin. I
also add two signals for playback-start and playback-paused that the
PlayPause button can use.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:45:34 -04:00
Anna Schumaker c2c6ac7890 audio: Give the BassPlayer a uri property
With both setter and getter to change the playbin uri

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-06 10:48:03 -04:00
Anna Schumaker 574e49ef09 audio: Give the BassPlayer a bus property
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-04 08:33:15 -04:00
Anna Schumaker 990a8047d9 audio: Create a new BassPlayer class
My intention is to use this to handle GStreamer stuff so I can separate
out the higher level functions like next(), previous(), and load_track()

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-04 08:32:14 -04:00
Anna Schumaker 94235b1ce8 Emmental 2.4
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-02 16:33:18 -04:00
Anna Schumaker 76bf68f484 audio: Replace the old Controls widget with AudioControls
And grab the global Player instance during construction.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-02 16:26:58 -04:00