Commit Graph

1133 Commits

Author SHA1 Message Date
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
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
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
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
981e98818d sidebar: Make the current playlist bold
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
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
7f31e39779 sidebar: Change the currently displayed playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
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
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
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
da708a9810 playlist: Make the current track bold
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
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
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
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
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
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
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
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
688bd1aa29 playlist: Remove old playlist code
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
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
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
50bf64faf3 playlist: Create a Footer box
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
289a980390 playlist: Create a Runtime label
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
0ed71f8792 playlist: Create a VisibleTracks label
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
44370b265b playlist: Create a Header box
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
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
c5aff410b4 playlist: Create a SortButton menu button
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
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
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
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
d0049e4951 playlist: Create a SortOrderView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
fd728a7a99 playlist: Create a PlaylistWindow scrolled window
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
2311a3a697 playlist: Add a LastPlayed column to the PlaylistView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
67d0ba4e44 playlist: Add a PlayCount column to the PlaylistView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
36893317c2 playlist: Add a Year column to the PlaylistView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
81dc5f1b76 playlist: Add a Subtitle column to the PlaylistView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
7c009655ed playlist: Add an Album column to the PlaylistView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
d7f1f64506 playlist: Add an Artist column to the PlaylistView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
2ac2ce04aa playlist: Add a Length column to the PlaylistView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
0cdc83c21e playlist: Add a Title column to the PlaylistView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
8e7db2c472 playlist: Add a Track Number column to the PlaylistView
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
4e24124755 playlist: Create a PlaylistView column view
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
296f0c53b4 playlist: Create a new Column class
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
df4074f1de playlist: Create a new LabelFactory
For creating the labels used by the ColumnView columns

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
979071cd14 playlist: Create a sort Factory
For creating SortRows and handling their signals

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
8adfb51082 playlist: Create a SortRow
To collect all the widgets used for a single row of sorting and emit
signals when they are interacted with.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
5d4ad35131 playlist: Create a FieldLabel label
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
768a3388d7 playlist: Create a DirectionButton button
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
9cfbf2acc9 playlist: Create an UpDownBox
Containing Up and Down arrow buttons that are intended to be used to
rearrange the sort order.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-26 17:26:09 -05:00
c4954c5bbc playlist: Create a FlatSortModel
To concatenate items from the SortPlaylistModel and the
DisabledOptionsModel with extra functions for enabling and disabling
sort order fields

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