This will eventually replace the GenreManager instance, and makes use of
the new playlist node code
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We'll use this do display the node in the UI. I add a newline so we
don't have to implement some kind of spacer class.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
My intention is to try to match the GtkTreeModel interface in terms of
functionality. This way, each node can act as its own iterator.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This helps reduce code duplication, since we can just call a single
function to handle sending the changed() signal.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I guess this could be lifted later if anybody asks for it, but I don't
think this really makes sense as a playlist source.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The collection playlist always has loop=True, so we'll never pop it from
the stack under normal conditions. Let's clear the list when selecting
this playlist so we don't keep a list of unreachable playlists.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I'm going to keep a list of playlists that have been selected so we can
switch playlists automatically when one ends.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This will eventually display the remaining time before the pause takes
effect, but for now just show the widget.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I either round to the nearest minute or nearest 5-second interval
depending on how much time is left. This will eventually be used to
populate a GtkPopover to display the remaining time.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We need to do this in a couple of different places, so let's make it
easier to do the conversion manually. Additionally, the datetime module
was having some trouble handling times over one hour. The new code
should handle it just fine, though.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I'm planning to use this for the automatic pausing code to tell the user
how much longer until we pause.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Users tell us how many tracks they would like to listen to, and then we
pause when that is complete. I make sure we test the about-to-finish
signal with this patch, since we hadn't been doing that up until now.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We have to do this because the "input" signal attached to a real
Gtk.SpinButton is broken, and likes to increment from -1 to 1, bypassing
0 all together.
Of course, this is only a problem when I try to have "This Track" and
"Next Track" text displayed instead of numbers, but I think everything
looks nicer this way.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Now we only toggle the show-more button state if the entry is already
focused. Otherwise, we allow the grab focus.
Additionally, I rename "updown_button" to "show_more" to match how it's
being used.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I change the keyboard shortcuts up slightly with this patch:
- ctrl+m shows and hides the search widgets
- ctrl+f now shows the widgets and focuses the track filtering entry
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
If everything goes well and the test passes, then this line will never
be reached. Let's move it so it doesn't skew the code coverage report.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
- Make sure we properly test the idle_id
- Make sure we're testing all the can_activate_accel() code
- Provide a generic main_loop() function that can be used by other test
code
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The following shortcuts are currently supported:
- Backspace: Previous song
- Return: Next Song
- Space: Toggle play / pause
- Ctrl+f: Open search bar
- Ctrl+s: Open search bar and focus search entry
- Ctrl+r: Toggle random
- Ctrl+Up: Increase volume
- Ctrl+Down: Decrease volume
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Otherwise we could end up sending notifications that don't make any
sense after their corresponding test ends.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This patch allows the user to filter playlists based on text that they
enter. I use the python regex module to handle searching, which gives
the user more flexibility in how they search. If the user inputs an
invalid regular expression, then I apply the "warning" style class to
the entry to let them know something has gone wrong.
I needed to change how the new-playlist signal is handled when I
switched over to using the playlist entry. For some reason the
GtkTreeModelFilter would glitch out whenever I sent the row-added
signal, so instead I let the filter model detect new rows when their
size is set instead. This seems to work, even if it's not how everything
is intended to be used.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We really need the UI to know about playlists as early as possible, so
send that notification as soon as playlists are allocated to avoid
potential ordering issues with the track scanning thread.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>