Commit Graph

1016 Commits

Author SHA1 Message Date
Anna Schumaker 18743f05c4 Emmental 2.10
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2022-02-25 13:32:32 -05:00
Anna Schumaker ab6eb556ad db: Fix track_adjusts_current() when the track has been removed
In this case, the call to get_track_index() returns None which can't be
used for the comparisons we're doing. Make sure we handle the None
result explicitely.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2022-02-22 10:08:34 -05:00
Anna Schumaker 1296857189 playlist: Don't leave the Subtitle column blank
Instead, fill in something generated from the disc number but make it
dimmed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2022-01-10 11:36:42 -05:00
Anna Schumaker 73ba296d74 playlist: Use the new match / case statement in __init__.py:key_pressed()
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 17:33:26 -05:00
Anna Schumaker f9cec5e1b3 audio: Use the new match / case statement in scale.py:format_value()
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 17:24:09 -05:00
Anna Schumaker 0c7a4a4a4c db: Use the new match / case statement in user.py:do_factory()
This is cleaner than using a bunch of elif-s to pick the right playlist
type

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 17:23:57 -05:00
Anna Schumaker 289420e504 playlist: Add a Favorite toggle button
For adding / removing the currently playing track from the Favorites
playlist

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:50:11 -05:00
Anna Schumaker 15059db59a playlist: Create a TrackBox containing the JumpButton
And put it before the filter entry in the ui

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:50:11 -05:00
Anna Schumaker c4adea15bb playlist: Split out the ControlBox as a base class
And create a PlaylistBox inheriting from it containing the buttons.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:50:11 -05:00
Anna Schumaker 328dce0be2 scanner: Fix scanner.update_library() function
We were scheduling the CheckTask, but not following up with a
DirectoryTask to scan for new files. I use this function during the
Gtk.Application startup to automatically update the libraries.

Implements #31 (Automatically update the database during startup)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:50:11 -05:00
Anna Schumaker 295202443f scanner: Add a function for clearing the TaskQueue
And call this function when closing the player

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:50:08 -05:00
Anna Schumaker b245b2073e scanner: Rename tests
To remove a bunch of redundant names from the test functions

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:49:52 -05:00
Anna Schumaker 7b89f54e8b scanner: Remove the ImportTask
It is no longer needed now that we have updated from the tagdb

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:49:52 -05:00
Anna Schumaker b768d74928 sidebar: Don't change displayed playlist to None
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:49:52 -05:00
Anna Schumaker beca08b833 Implement the Gtk.Application instance in emmental.py
We don't use this during testing, so put it here instead of in a
submodule.

Implements #26 (Move the EmmentalApplication into emmental.py)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-28 15:49:50 -05:00
Anna Schumaker db2d122211 lib: Replace version.DEBUG with the __debug__ constant
Implements #27 (Check __debug__ constant instead of a .debug file)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-26 13:18:24 -05:00
Anna Schumaker 10c5fd4cef lib: set version.TESTING based on if the unittest module is loaded
This is cleaner than needing to set an environment variable before
running unit tests.

Implements #28 (Check if unittest is loaded to determine if we are testing)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-26 13:05:08 -05:00
Anna Schumaker 2daefa932c lib: Remove unused files
These are no longer needed now that tagdb has been removed

Implements #24 (Clean up lib/)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-26 10:18:09 -05:00
Anna Schumaker 915e3c8340 Remove unused tagdb module
Implements #23 (Remove tagdb/ code)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-26 10:08:33 -05:00
Anna Schumaker 04dc67a097 Emmental 2.9 AUR Commit
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-21 15:48:06 -05:00
Anna Schumaker 5aa9f36272 Emmental 2.9
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-21 15:43:57 -05:00
Anna Schumaker be7e8e6073 audio: Reset the pipeline whenever we reach EOS
This fixes a bug where a different track would be selected when hitting
"Play" after an autopause

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-10 12:00:20 -05:00
Anna Schumaker a85ac03517 db: Occasionally optimize the database
I do this whenever we commit during scanning, and during application
shutdown.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 22:09:40 -05:00
Anna Schumaker 853594fc26 db: Remove indexes
They aren't doing anything useful to help speed up sorting, so remove
for now and reevaluate later

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 22:05:42 -05:00
Anna Schumaker 798ef20a72 playlist: Give the playlist panel an add_selected_tracks() function
So we can have all the add track functionality in one place that also
allows for keyboard presses to work.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 19:25:16 -05:00
Anna Schumaker ba06eca07f audio: Switch to the Collection playlist if the current playlist has finished
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 17:51:02 -05:00
Anna Schumaker 4cdf4c528a audio: Implement our own about-to-finish handling
The playbin's about-to-finish signal triggers in a different thread,
which Gtk is very much not happy about, and often results in both the
about-to-finish and eos handlers getting called (and therefore multiple
tracks getting picked from the queue).

Fix this by checking how much time is left during the regular position
changed timeout function and triggering about-to-finish manually

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 17:51:02 -05:00
Anna Schumaker 8f26cf9fee db: Fix random next_track() on playlists with only one track
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 17:51:02 -05:00
Anna Schumaker bb0a9face7 ui: Update keyboard shortcuts
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 17:51:02 -05:00
Anna Schumaker 2e14b511a4 sidebar: add_to_playlist() fixes
- Commit after adding tracks
- If tracks were added to the Queued Tracks playlist, then set it as the
  current playlist in the Player

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 17:51:02 -05:00
Anna Schumaker 6c81981570 playlist: Clear selection after iterating
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 17:51:02 -05:00
Anna Schumaker c7b205e404 playlist: Remove selected tracks from the Queued Tracks playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 17:44:09 -05:00
Anna Schumaker 845de3957b playlist: Scroll to the current track if "new" isn't on the playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 17:44:08 -05:00
Anna Schumaker 580358a88e playlist: Add some useful key presses
Escape to clear the list of selected tracks and Delete to remove tracks
from playlists.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:55:37 -05:00
Anna Schumaker 52415cf4da tagdb: Have Tracks schedule an ImportTask when loading
And a CommitTask when we're done. Note: we only load and import the
tagdb if we are creating a new database.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:50:26 -05:00
Anna Schumaker 2f1b7b397f sidebar: Add selected tracks to the selected playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:50:24 -05:00
Anna Schumaker 44f778bdb7 sidebar: Give the AddPlaylistButton an "add-to-playlist" signal
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker 981e98818d sidebar: Make the current playlist bold
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker 44ba5438e2 sidebar: Change the Player's playlist when rows are activated
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker 7f31e39779 sidebar: Change the currently displayed playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker bbe48ccf82 playlist: Create a way to get the current selected tracks
I do this as a generator so we can work with tracks as we find them.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker f15514edd1 playlist: Create a JumpButton
For jumping to the current track

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker cee0f4e075 playlist: Scroll to the current track in the ColumnView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker da708a9810 playlist: Make the current track bold
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker 78647884d6 playlist: Change tracks when rows are activated
And make sure we update plist.current to the selected index.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker 594f7991f2 audio: Pick next track from the Previous playlist first
This lets us move up and down the Previous playlist through the buttons,
in case we go back too far by accident.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker 27ad8d72b4 audio: Pick the next track from the current playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker 45b7f9595c audio: Give the Player a set_playlist() function
With a callback to notify when the current playlist changes.
Additionally, I make sure to reset playlist.current if the playlist has
previously finished playing.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker 574d03bad6 db: Make it easy to know if we can delete tracks from playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:22 -05:00
Anna Schumaker 6913cf992d db: Fix Playlist.get_track_index()
We need to limit the OVER () clause to just pick tracks that are
actually on the requested playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:15 -05:00