Commit Graph

224 Commits

Author SHA1 Message Date
Anna Schumaker 4e1e2b0d0a rind: Set album artwork through an idle task
This lets us set the album art once per track, rather than up to three
times.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-01-02 17:25:11 -05:00
Anna Schumaker 1891bc8f61 rind: Calculate a fixed height for album art
And make sure we center the pixbuf in the GtkImage by allowing the image
to expand to its maximum width.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-01-02 16:40:49 -05:00
Anna Schumaker a7438b2be3 rind: Set a default image when there is no artwork
This acts as a placeholder, and keeps the sidebar from bouncing around
when tracks are changed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-31 10:55:35 -05:00
Anna Schumaker 0b334ddbee rind: Scale artwork when the sidebar position is changed
I always scale from the original reference image, and never from the
displayed pixbuf. This avoids artifacts due to lossy scaling algorithms.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-31 10:27:54 -05:00
Anna Schumaker d2c71f83a8 rind: Add an artwork widget
And look for the "image" tag from the gstreamer pipeline when setting.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-31 08:41:55 -05:00
Anna Schumaker 99de9c0f7d curds: Move Current playlist handling out of the Root node
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 10:18:25 -05:00
Anna Schumaker 75a8c8d169 curds: Move playlist selection out of the Root node
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 09:56:19 -05:00
Anna Schumaker d25a026282 curds: Move playlist.peek() out of the Root node
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 09:04:12 -05:00
Anna Schumaker 1088bb16ce curds: Move Root's self.track function into __init__.py
And keep it as a global variable. This reduces the amount of work in the
root node, and makes things a little easier to follow

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-15 09:10:40 -05:00
Anna Schumaker 21f6bd62a8 curds: Give playlists their own plist_lock
Rather than continuing to use the tree lock. This lets us be a little
more focused in what the locks protect, while also allowing tree
operations to happen in parallel with playlist operations.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-13 15:52:42 -05:00
Anna Schumaker 440f0901f4 rind: Have the node view look for the child-inserted notification
The child-inserted notification is more specific than node-inserted, and
carries the child's path with it as an argument. This saves some work on
the UI side, and avoids potential deadlocks.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-12 14:38:21 -05:00
Anna Schumaker a8cd9a84f3 rind: Node model cleanups
- Listen for the "first-child" notification rather than "node-inserted"
- Use the walrus operator in more places to tidy up the code
- Use the playlist_iter() function to get iterators directly

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-12 14:32:16 -05:00
Anna Schumaker 735f2bba6e curds: Rename notification "main" parameter to "idle"
And always run tasks marked for the idle queue in the idle queue, even
if we're in the main thread.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-12 12:06:37 -05:00
Anna Schumaker 3a939f92e1 curds: Replace str(node) with node.get_markup()
This lets us save str(node) to be used for something else, and it gives
playlists a chance to escape their names before returning to the UI

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-12 10:57:54 -05:00
Anna Schumaker 3fa56facde curds: Remove unnecessary calls to append_child()
I really want to remove this function, so let's start by swapping out
calls to append_child() with insert_child()

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-12 09:04:20 -05:00
Anna Schumaker 1fc448996e curds: Switch over to the new track database system
It is way faster during scanning due to the db key changes, which I
wasn't expecting at the time.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-09 14:34:16 -05:00
Anna Schumaker 5f079d6a58 curds: Rename curds/tags/ -> curds/trak/
The "tags" name doesn't really fit anymore now that we removed the Album
class. Let's change the name to something more accurate.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-09 10:05:00 -05:00
Anna Schumaker 6db713a993 curds: Improvements to the notifications system
- Clean up the code
- Kick off a GLib idle handler when events are added
- If we are already running in the main thread, then we don't need to
  use the idle handler.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-04 10:42:31 -05:00
Anna Schumaker 7433154494 curds: Replace the next_child pointer with sibling
next_child becomes a thread-safe function that can be called to access
the next child.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-08-21 16:02:59 -04:00
Anna Schumaker 42f1c76f8f curds: Remove has_sibling() function
We can just use the parent's n_children() function to determine this
instead

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-08-21 13:08:54 -04:00
Anna Schumaker 0b0800ac56 curds: Use the lookup_path() function instead of get_node()
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-08-14 14:23:08 -04:00
Anna Schumaker b319cdc3d7 curds: Switch over to the ETree() child walking function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-08-14 14:23:08 -04:00
Anna Schumaker 1b603ad567 curds: Move the track tag into a new file
And out of the __init__.py stuff

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-08-09 13:57:28 -04:00
Anna Schumaker bc01e95d0b curds: Convert track items to strings in __getitem__()
Rather than doing this in multiple places outside of the track class.
Callers who want the original values can still dereference the value
directly

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-07-08 11:03:37 -04:00
Anna Schumaker eb40293b04 rind: Filter tracks when typing in the entry
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-07-07 21:16:41 -04:00
Anna Schumaker dc561a2d30 rind: Create a filter model for playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-07-07 20:41:59 -04:00
Anna Schumaker 67cde118c5 rind: Track the next position where tracks are added to the model
We just append to the model rather than using the index information
passed to us.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-07-07 13:30:28 -04:00
Anna Schumaker 7630a1723d rind: Give playlist models a do_iter_children() function
Even though this is a ListModel the TreeModelFilter still tries to call
this function, so we need to define it to cut down on warnings printed
to the screen.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-07-07 13:15:34 -04:00
Anna Schumaker 57d77a5abd rind: Parse text entered in the track search entry
And set up a regex pattern that we can use to match tracks later.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-07-07 13:15:34 -04:00
Anna Schumaker 37d621e48d rind: Add extra newlines to the playlist view
The node view file has these extra newlines already, and I think it
makes everything easier to follow.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-07-07 13:15:34 -04:00
Anna Schumaker dfc8c049be curds: Implement a playlist for newly added tracks
This playlist is only to showe new tracks added during the current
session, so we need to clear the list when getting the playlist state
dictionary.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-07-07 13:15:34 -04:00
Anna Schumaker 95f653e1d3 rind: Don't store a global pointer to the playlist root
The root could change during testing, so don't store this pointer

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-07-01 10:40:53 -04:00
Anna Schumaker 59a10181a5 rind: Store the largest known node height
If our filter text has no results, then backing out could lead to
partially cutting off node text.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-06-20 09:30:22 -04:00
Anna Schumaker 24dcd2c263 rind: Have the playlist view respond to the show-more signal
And use it to show the track search entry and separator

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-06-16 19:42:07 -04:00
Anna Schumaker f642f17836 rind: Update the treeview when queued tracks are played
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-06-16 19:42:07 -04:00
Anna Schumaker 70b7757c0a curds: Send track with track-added and track-removed notifications
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-06-16 19:42:07 -04:00
Anna Schumaker 5f0c77e86d rind: Add tracks to the Up Next playlist through a column click
Similar to how we add tracks to the starred playlist. I was having
trouble getting the treeview to update properly, so I take the
heavy-handed approach of redrawing the entire view.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-06-16 19:42:07 -04:00
Anna Schumaker daf7b6180c rind: Add an up-next column to the playlist model
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-06-15 11:22:06 -04:00
Anna Schumaker 76f206c69f rind: Unselect selected rows when doing a scroll_to()
Otherwise we'll select an additional row with every track change, never
unselecting previous tracks.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-06-10 09:52:27 -04:00
Anna Schumaker e610a7a078 curds: Remove node.insert_child() function
This function is now unused, since we're using bisection insertion
instead. We switch remaining callers over to using node.append_child()
while we're at it.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-06-10 08:55:12 -04:00
Anna Schumaker 93098884b4 curds: Move common sort key functions into a new module
And add a convenience function for normalizing unicode text while we're
at it.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-31 15:01:40 -04:00
Anna Schumaker c569e7baf9 curds: Create a playlist.contains() function
And clean up related code to use this rather than an index == None check

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-27 09:00:15 -04:00
Anna Schumaker 9fb3c45886 rind: Enable selecting multiple tracks
I needed to switch starring multiple tracks at once to happen during a
button press instead of release, since the selection changes between
these two events.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-27 08:13:07 -04:00
Anna Schumaker 3eef442ee6 rind: Implement the TreeDragDest interface in the PlaylistModel
Testing this runs into the same problem that the TreeDragSource patch
hit - we're not able to manually allocate a Gtk.SelectionData object. We
can still test the code that does the move but we can't verify that
we're using the interface correctly

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 16:22:47 -04:00
Anna Schumaker 20cbe5aca6 rind: Implement the TreeDragSource interface in the PlaylistModel
We're not able to completely test this implementation due to
Gtk.SelectionData() missing a constructor. Fingers crossed that it gets
added in a future release of python-gobject

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 16:22:47 -04:00
Anna Schumaker 7225c23f94 rind: Add a path_track() function to the PlaylistModel
There are a few places where we need to do this, so make a function that
is more straightforward than using an iterator

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 14:52:27 -04:00
Anna Schumaker ce4ac4848a rind: Handle the remove-track notification
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 11:25:55 -04:00
Anna Schumaker 71a8e9b140 rind: Remove tracks from starred playlist on second click
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 11:08:21 -04:00
Anna Schumaker 213854f3fa curds: Remove playlist.show() function
Let's just set the visible state directly. Additionally, I add a test
for setting visibility back to false when showing a different playlist

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 09:04:50 -04:00
Anna Schumaker 3e8b69d605 curds: Clean up bisect() and add index() function
This lets us clean up add() so we only need to loop over the list once
and we can remove the buggy built-in iterator code.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-23 16:12:54 -04:00