Commit Graph

1001 Commits

Author SHA1 Message Date
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
Anna Schumaker b4daf0e48c db: Set check_same_thread=False
Apparently, the about-to-finish signal is called in a different thread
than the main thread. SQLite complains about the connection getting used
from a different thread, so we need to set this check to False so the
code skips it.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:15 -05:00
Anna Schumaker 688bd1aa29 playlist: Remove old playlist code
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker 7d5b9b8ba1 ui: Switch over to the new playlist.Panel class
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker dbad19ad46 playlist: Create a new Panel class
Containing the ControlBox, PlaylistWindow, and FooterBox

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker 50bf64faf3 playlist: Create a Footer box
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker 289a980390 playlist: Create a Runtime label
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker 0ed71f8792 playlist: Create a VisibleTracks label
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker 44370b265b playlist: Create a Header box
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker b09baf3d99 playlist: Add a ControlBox box
Containing the RandomToggle, LoopToggle, and SortButton

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker c5aff410b4 playlist: Create a SortButton menu button
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker 94cb57dbfc playlist: Create RandomToggle and LoopToggle toggles
These both inherit from a PropertyToggle that does most of the work for
us

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker c136b8660a playlist: Create a FilterEntry entry
This derives from the lib.filter.Entry to set the playlist filter and
increase the margins.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker 3b15318f7c playlist: Create a SortOrderPopover
For use by a Gtk.MenuButton to show the SortOrderView

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker d0049e4951 playlist: Create a SortOrderView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
Anna Schumaker fd728a7a99 playlist: Create a PlaylistWindow scrolled window
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00