Commit Graph

1198 Commits

Author SHA1 Message Date
Anna Schumaker 32e2469efb curds: Track playlist visibility
This lets us delay sorting playlists until the first time they are shown
to make adding tracks faster. Additionally, we don't need to send
add-track notifications for playlists that aren't visible.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-02 07:36:32 -04:00
Anna Schumaker c2484c43ad curds: Pass sort order through Playlist init
This is cleaner than calling the sort function several times, or
overriding the sort_order array after construction.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-02 07:36:32 -04:00
Anna Schumaker 07f5b9b78d curds: Use a bisect for insertion sorts
This drastically cuts down the number of comparisons needed to make an
insertion.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-02 07:36:30 -04:00
Anna Schumaker b6830dc337 curds: Add default sorting orders to each playlist
And disable sorting on the Previous playlist, since doing so would
basically be changing history.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-27 15:28:09 -04:00
Anna Schumaker 9b80a93804 rind: Adjust main loop timing for the node manager test
This shaves off 20 - 30 seconds of the time it takes to run all the
tests

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-27 14:25:39 -04:00
Anna Schumaker e272f4adab rind: Sort playlists by clicking on the treeview headers
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-27 14:15:41 -04:00
Anna Schumaker d2ae3e3d18 curds: Normalize track fields for sorting
I want to strip out special characters an lowercase the strings for
sorting.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-27 08:40:16 -04:00
Anna Schumaker 10a8eef1fb curds: Add sorting support to playlists
We only support sorting in ascending order, but we take into account
multiple track fields.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-26 17:50:34 -04:00
Anna Schumaker 413ce6f2e8 rind: Add a discnumber field to the playlist view
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-26 11:31:26 -04:00
Anna Schumaker e49999f754 rind: Activate next track button with keypad Enter key
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-26 10:52:53 -04:00
Anna Schumaker c62ab123b1 rind: Increase window width
I'm going to be adding more columns to the playlist display, so let's
increase the default width a little to accomidate this.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-26 10:51:15 -04:00
Anna Schumaker 92e9dcd497 rind: Add unicode handling to our regex search
This way we can type in ascii characters, but still match strings with
unicode accents.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-26 10:07:58 -04:00
Anna Schumaker 27a598dacc rind: Add a Loop button
Similar to the Random button, this button sets the playlist loop
property. I also increase the length of the position slider slightly to
give the buttons above a little more room.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-25 16:48:55 -04:00
Anna Schumaker b71e9c9a91 rind: Change RandomButton state when changing playlists
We need to change both the sensitivity and the current state based on
the random and can_random playlist variables.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-25 16:48:40 -04:00
Anna Schumaker 82cf07ff36 curds: Have the playlist track if loop and random values can change
This way, we control it all from one place instead of needing to derive
a new playlist to set these values. Additionally, the UI can use these
values to enable or disable the corresponding buttons

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-25 14:33:17 -04:00
Anna Schumaker b0cbcd7f9d rind: Select the currently playing track in the playlist
And also scroll so the selected path is visible.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-25 13:44:22 -04:00
Anna Schumaker 2d6d4444bf curds: Send next-track notification when changing tracks
This lets the UI know that something changed so scrolling can happen in
the UI.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-25 13:39:38 -04:00
Anna Schumaker 2815724b5c rind: Suppress filtering warnings during testing
These don't show up when running normally, but they can show up during
testing when gtk signals show up after their corresponding test ends.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-25 13:38:39 -04:00
Anna Schumaker b94cc5bd87 rind: Set the playbin video-sink to a fakesink element
I have a few tracks that have their album art embedded as a separate
stream. This results in emmental popping up a window with an image, and
sending an EOS when the image is closed. Suppress any video elements by
setting a fakesink instead of letting the playbin handle this
automatically.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-24 16:43:05 -04:00
Anna Schumaker 52df4373b5 rind: Hide separators when "show more" area is hidden
I think it just looks nicer this way

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-24 15:54:22 -04:00
Anna Schumaker dc5e843d94 rind: Check playlist children when determining visibility
Otherwise nested playlists might not show up, even if we search for them

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-24 10:18:34 -04:00
Anna Schumaker c7d45754a0 curds: Add Album playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-24 09:30:12 -04:00
Anna Schumaker e3e51ee899 rind: Automatically size the node icon column
Images were getting cut off when descending into the node tree, so
automatically changing the sizes keeps the icon visible

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-24 09:09:22 -04:00
Anna Schumaker 9ef6c865c6 curds: Add playlists for individual years
They show up nested under the corresponding decade playlist

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-24 09:09:09 -04:00
Anna Schumaker fb5477da57 curds: Don't hide exceptions during the new-track signal
We need to be able to see what's going on in order to fix the code, so
let's not fail silently and pretend that nothing went wrong.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-24 08:42:52 -04:00
Anna Schumaker 3aa6b93e0e rind: Update NodeTreeModel to use the new walk() function
This cleans up the test a bit and makes it more straightforward.
Additionally, it checks some extra cases that we hadn't checked up until
then.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-23 16:22:51 -04:00
Anna Schumaker 718d44a8d8 curds: Add a way to walk the node tree
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-23 14:11:06 -04:00
Anna Schumaker 8f3178bfc7 rind: Switch node iterators from user_data3 to user_data
These other variables are unused now, so let's just use the first one
for simplicity.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-23 10:59:53 -04:00
Anna Schumaker dcc2f7e6d0 rind: Don't set node iterators based on path
Instead, use the node id and node cache to find playlists.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-23 10:46:17 -04:00
Anna Schumaker e4d96755e9 curds: Make sure PlaylistNode ids are still mapped after a reset
This is mostly in case the node map gets cleared at some point during
testing.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-23 10:44:22 -04:00
Anna Schumaker e116b7a784 rind: Use tree paths when working with the filter model
We already have the filtered path, so it doesn't take too much work to
convert it to the child path and look up the corresponding node.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 17:13:09 -04:00
Anna Schumaker 545854ca35 rind: Remove NodeTreeModel iter_valid() function
We can calculate this more efficiently without the extra function call.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 17:06:16 -04:00
Anna Schumaker f3987543ed rind: Set the next iterator using PlaylistNode.next_child
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 17:06:16 -04:00
Anna Schumaker 16bbdb7105 rind: Add the node id to the GtkTreeIter
We don't use user_data3 for anything yet, so let's use it to find
playlists easier.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 17:06:16 -04:00
Anna Schumaker 02f271bba0 rind: Refactor iter_playlist() and playlist_iter()
I want these two functions to be the foundation of the NodeTreeModel, so
they have to be defined without using the GtkTreeModel interface.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 17:06:16 -04:00
Anna Schumaker cf8b88b833 rind: Remove playlist_valid_iter()
I'm about to change how iterators work, so remove this function to
simplify the code.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 17:06:16 -04:00
Anna Schumaker b49e81f580 curds: Rename ManagerModel to NodeTreeModel
This reflects how we're using the custom model to display the playlist
node tree.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 17:06:16 -04:00
Anna Schumaker 8f6be9b6f5 curds: Rename PlaylistManager -> PlaylistRoot
This is the root node of the Playlist Tree, so give it a name reflecting
that.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 17:06:16 -04:00
Anna Schumaker b9ad790abf curds: Reorganize the imports
And instantiate the PlaylistManager instance a little earlier

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 17:06:16 -04:00
Anna Schumaker c834359cdb curds: Keep a map of PlaylistNode ids
Making it easy to look up a PlaylistNode by the python object id means
we can use the object id in the GtkTreeIter rather than storing the
entire path

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 17:06:15 -04:00
Anna Schumaker cfee39ce17 curds: Add a function for finding the root node of the PlaylistNode tree
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-22 08:56:02 -04:00
Anna Schumaker 33e2af2c2d curds: Make sure we're properly setting prev / next pointers
I noticed that the toplevel playlist siblings were always set to None,
so make sure we're properly setting these so they can be used.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-21 10:16:03 -04:00
Anna Schumaker de9c7b0745 curds: Add the DecadeNode to the PlaylistManager
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-20 13:04:33 -04:00
Anna Schumaker a8a9dada49 curds: Add a DecadeNode and DecadePlaylist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-20 12:49:59 -04:00
Anna Schumaker 0eca51eae1 curds: Change genre and artist node icons
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-19 17:00:39 -04:00
Anna Schumaker 68953c273d curds: Add the ArtistNode to the PlaylistManager
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-19 14:46:13 -04:00
Anna Schumaker 42a26832eb curds: Implement an artist playlist node
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-19 14:45:39 -04:00
Anna Schumaker 0cd702c908 rind: Remove do_iter_previous() from ManagerModel
I haven't seen this get run in the wild, so let's remove it

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-19 12:17:06 -04:00
Anna Schumaker b2dc1b8c5e curds: Remove GenrePlaylist
It is now unused

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-19 12:17:06 -04:00
Anna Schumaker bfe7e3550b rind: Set the row height of PlaylitNodes
If the node is a playlist, then we can use their natural height.
Otherwise, we set a height based on the first playlist in the model.
This way every row has the same height.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-04-19 11:08:24 -04:00