Commit Graph

1213 Commits

Author SHA1 Message Date
Anna Schumaker f6a016f74d rind: Add an entry for searching playlists
The actual search function isn't implemented yet. We show or hide this
widget based on the up / down button state.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-31 14:37:45 -04:00
Anna Schumaker c6f8a48b0d rind: add an up / down toggle button
I'm going to use this to show and hide the text entries for playlist
filtering and autopause controls.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-31 14:18:14 -04:00
Anna Schumaker ace07b74eb rind: More UI refinements
- Change top left controls into a buttonbox
- Change new library button to list-add-symbolic
- Remove "can focus" from buttons
- Make play / pause / next / previous buttons pill-shaped and
homogeneous

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-31 11:07:53 -04:00
Anna Schumaker d69661ef3b rind: Give the new library button the "osd" style class
This style class is for on-screen-display widgets, which lines up with
how we're using this button.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-31 09:36:19 -04:00
Anna Schumaker 215ebb8653 rind: Add volume button
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-30 17:26:02 -04:00
Anna Schumaker ff3b9c4b5a rind: Add a New Libray button
Clicking the button shows a popover with a file chooser widget, which
can be used to select a library path.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-30 17:25:25 -04:00
Anna Schumaker b03877129d rind: Make play / pause / next / previous buttons circular
I think this looks a little nicer. While I'm at it, I also shove all the
headerbar widgets into two boxes packed on either side.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-30 09:25:06 -04:00
Anna Schumaker d77b1a9c09 rind: Only expand library playlist paths when added
Otherwise genres fill the list and make everything look cluttered.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-29 15:39:47 -04:00
Anna Schumaker 85f07fea36 rind: Escape playlist names
Otherwise gtk will complain about unescaped markup.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-29 15:37:12 -04:00
Anna Schumaker 2aa530119a curds: Title case Genre playlist names
This way we group together tracks that have the same genres but with
different casing.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-29 15:36:32 -04:00
Anna Schumaker 277edca3e5 rind: Don't change playlist selection if no rows are selected
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-29 15:10:01 -04:00
Anna Schumaker d89ffd3910 rind: Combine Genre and Library playlist manager tests
They were almost identical, so this saves quite a bit of duplication
effort.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-29 14:59:07 -04:00
Anna Schumaker 82dca84a9e rind: Add Genre playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-29 14:29:13 -04:00
Anna Schumaker faaf640bea rind: Clean up playlist manager tests
I simplify most of the code and make it easier to add more playlists in
the future.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-29 14:00:53 -04:00
Anna Schumaker 2c078a3d21 rind: Fixes for playlists that aren't in the toplevel
- do_iter_parent() needs to return None if there is no parent playlist
- do_iter_next() needs to increment user_data2 for lower level playlists
  instead of user_data1

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-29 09:50:02 -04:00
Anna Schumaker 5c0e468c71 curds: Create a generic PlaylistAllocator class
This class contains code shared by the GenerManager and LibraryManager
classes.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-29 09:12:53 -04:00
Anna Schumaker f4032aaf07 curds: Add a genre playlist
This uses the genre field in each track to make automatic playlists.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-29 09:12:09 -04:00
Anna Schumaker d95809c233 curds: Use folder-music for the toplevel library heading
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-28 14:14:40 -04:00
Anna Schumaker ce4011c069 rind: Fix up automatically picking the next track
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-28 14:14:16 -04:00
Anna Schumaker 071c356dbc curds: Replace new-library-playlist with new-playlist notification
We have a find_playlist() function, so let's stick with a more generic
notification name so we don't have to repeat a lot of code.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-27 16:16:08 -04:00
Anna Schumaker 9633e20de5 rind: Set fixed-height-mode on the playlist treeview
Now that we push row_added notifications into the main thread, we can
enable this optimization that makes the treeview more efficient.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-27 11:20:13 -04:00
Anna Schumaker 685b78cbf9 curds: Add stop() and reset() functions
Reset is used to make testing a little easier, since we won't have to
manually set set everything up again during each setUp function.

Stop is used to stop the library thread before shutdown.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-27 11:18:15 -04:00
Anna Schumaker 918f76663c curds: Declassify notifications
Keeping this as a class that can never be instantiated seems like
overkill when we could just use plain functions.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-27 09:49:40 -04:00
Anna Schumaker 89a4daedf3 curds: Rename Notify.notify_me() -> Notify.register()
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-27 09:27:29 -04:00
Anna Schumaker 93206b95b2 curds: Rename Notify.notify_cancel() -> Notify.cancel()
It's a little less wordy and redundant this way

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-27 09:21:52 -04:00
Anna Schumaker 92817e1e7a curds: Remove Notify.clear()
And switch callers over to using notify_cancel()

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-27 09:17:01 -04:00
Anna Schumaker 35e5cd1095 curds: Pass track index to the add-track notification
This eases up some of the work on the UI side, since we don't need to
spend time trying to figure out where the track is in the playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-26 15:33:58 -04:00
Anna Schumaker 332cd89fee rind: Check notifications from the main thread
Gtk really doesn't like notifications coming from other threads, so we
need to handle notifications from the main thread through an idle task.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-26 14:56:57 -04:00
Anna Schumaker e38e6ae1b4 curds: Push some notifications onto a queue
Gtk really doesn't like updates coming from outside of the main thread,
so let's add a way to register callbacks that can be queued up and run
later.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-26 14:26:22 -04:00
Anna Schumaker 5c267c8a9d curds: Add helpful library functions
This adds some convenience around controlling the library thread.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-26 11:20:01 -04:00
Anna Schumaker f715945536 curds: Add a tags.clear() function
This makes it a little easier to reset the tags before running a new
test.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-26 10:55:01 -04:00
Anna Schumaker 5469cb9298 rind: Reset the playlist treeview when changing playlists
We could put a lot of effort into deleting all the rows and resetting
them, but it's easier just to clear the model and set it again.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-24 17:35:24 -04:00
Anna Schumaker 16b5e1e990 rind: Add previous button and playlist to the UI
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-24 17:32:16 -04:00
Anna Schumaker e433097309 rind: Gst unit test cleanups
I noticed that I was getting some unexpected behavior due to the global
Audio class still running in parallel with my testing class. This patch
fixes that by adding an easy disconnect function for signals, and also
implements some other improvements to waiting for state changes.

Additionally, I added a check to see if we have already set the
playbin's "uri" property before picking the next track when calling
next().

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-24 17:30:56 -04:00
Anna Schumaker 3afffc54d4 curds: Add the Previous playlist to the playlist manager
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-23 13:43:54 -04:00
Anna Schumaker c794faf95c curds: Add a Previous playlist
This playlist is designed to hold all the tracks that have been selected
for playback, and iterate through them backwards if needed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-23 10:15:17 -04:00
Anna Schumaker a5535a5daa curds: Set collection random value through the Playlist class
We still fix the value, but if we ever add extra handling in the base
class then we'll be able to catch it.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-23 10:13:59 -04:00
Anna Schumaker f765536c86 curds: Don't loop len(1) playlists
We need to check if looping is true, even if length is one, before
setting the current index.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-23 10:12:14 -04:00
Anna Schumaker 61d6221e30 rind: Change to the selected playlist
This doesn't change which playlist is currently playing music, but it
does change which one the user sees.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-22 17:42:15 -04:00
Anna Schumaker 014f2c89ab rind: Only allow selecting playlists in the sidebar
Selecting a playlist during scanning caused a segmentation fault so I
had to push row-changed signals into the main thread through the use of
an idle task.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-22 17:36:02 -04:00
Anna Schumaker e4755aae6d rind: Remove shadows from scrolled windows
And change the GtkPaned widget to have a small handle. This sets the
division between the playlist manager and the playlist to a single line,
which I think looks really slick

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-21 15:37:37 -04:00
Anna Schumaker e403fd6ba9 rind: Show the fill level when tracks are loaded
This is a small detail, but I like the idea of having an indicator when
tracks are loaded or not.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-21 14:22:14 -04:00
Anna Schumaker b9035abf8a rind: Respond to the playbin's about-to-finish signal
We use this to load the next track without changing the pipeline state,
which should give us smoother audio switching.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-21 14:14:43 -04:00
Anna Schumaker c447c9e2b7 rind: Clean up the gstreamer tests
The common setup and tear down code helps keep everything in sync.
Additionally, we no longer need to wait for duration changes, which have
always been unreliable.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-21 13:35:25 -04:00
Anna Schumaker a48a2ada76 rind: Set Title and Artist from gstreamer tags
This helps us prepare for the about-to-finish signal by setting this
information when gstreamer starts playing the next track.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-21 13:11:58 -04:00
Anna Schumaker bd37bfd3f7 gst: Don't pass "play" value to audio.load()
We don't have a reason to set this anything other than True, so let's
just automatically start playing the track. Additionally, change the
playbin to READY instead of NULL to help playback start a little faster.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-21 11:50:32 -04:00
Anna Schumaker a9f48534e5 rind: Add seek support
I put a smaller progress bar into the header area that users can use for
seeking or checking the current position. I also add two labels to show
time played and time remaining in the current track.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-21 09:52:39 -04:00
Anna Schumaker 5885228fd1 rind: Add a random button
We use this to toggle the random property of playlists

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-20 10:45:28 -04:00
Anna Schumaker ae92da8e82 rind: Escape text before setting title and subtitle
We're using GLib markup, so we need to escape special characters so they
can be drawn properly

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-20 10:31:36 -04:00
Anna Schumaker 754a8beadd curds: Add exception handling for invalid tracks
Users might have images or ripping logs mixed in with their tracks, so
let's make sure we don't crash if we try to scan one of these.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-20 10:12:02 -04:00