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>
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>
And disable sorting on the Previous playlist, since doing so would
basically be changing history.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>