Commit Graph

462 Commits

Author SHA1 Message Date
Anna Schumaker dc4803eb46 curds: Add playlist tests for __func__() overrides
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-23 10:23:29 -04:00
Anna Schumaker e7ed3a2777 curds: Do bounds checking in the playlist __getitem__() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-23 10:11:00 -04:00
Anna Schumaker 1060fca929 curds: Improvements to the playlist test
- Create a test_album variable instead of making each test build the
  same path
- Create a single self.plist for test playlists
- Create a helper function for adding tracks

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-23 09:24:41 -04:00
Anna Schumaker fbfe17b828 rind: Add tracks to the Starred playlist through button clicks
There is currently no way to remove tracks from playlists, but this is a
start.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-22 11:21:20 -04:00
Anna Schumaker e3e8f4eb5d rind: Have the playlist treeview look for the row-activated signal
And use it as an indicator that the user wants us to play the selected
track.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-22 09:25:24 -04:00
Anna Schumaker 9fad64e972 rind: Create a function for loading and playing specific tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-22 09:25:01 -04:00
Anna Schumaker 0e74303b13 rind: Clean up playlist view test
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-19 21:35:18 -04:00
Anna Schumaker 5ef15bfab3 rind: Set runtime label when switching playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-19 11:09:10 -04:00
Anna Schumaker f38f77d0d2 rind: Scroll to current track when switching playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-19 10:14:06 -04:00
Anna Schumaker 61a3c32c79 rind: Various testing improvements
- Add a gtk.notify_loop() for running any queued notifications
- Add a gtk.timeout_loop() for running a main loop for a specificed
  amount of time
- Prevent filtering warnings produced by some tests

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-19 09:28:01 -04:00
Anna Schumaker 2e98dc2feb rind: Move playlist switch function into the view module
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-18 08:37:10 -04:00
Anna Schumaker ac7001c3bf curds: Add helpful playlist shortcuts
- curds.playlist.current() for the currently selected playlist
- curds.playlist.lookup() for lookups

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-17 09:49:52 -04:00
Anna Schumaker 729dad28e3 rind: Handle stream-start notifications in the playlist view
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-17 08:05:21 -04:00
Anna Schumaker 6597f5979e rind: Have the audio module send a stream-start notifciation
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-17 07:38:33 -04:00
Anna Schumaker 129c7366a4 rind: Move the add-track handler into the view
This lets me register this handler once, and not worry about it again
when changing playlists.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-16 21:29:19 -04:00
Anna Schumaker d46e612004 rind: Move playlist-changed handler into the playlist.view
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-16 21:29:19 -04:00
Anna Schumaker bc675a1fc9 rind: Move treeview into the playlist.view module
I move over the column clicked handler at the same time

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-16 21:29:19 -04:00
Anna Schumaker ec86ec7910 curds: Two small playlist improvements
- Make a shortcut to the Starred playlist for the UI
- Always sort playlists, rather than sorting as soon as they become
visible

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-16 21:29:18 -04:00
Anna Schumaker e179fe6153 rind: rewrite playlist model unit tests
Rather than testing the entire model in one giant function, split this
up into several functions for each virtual function.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-15 11:10:56 -04:00
Anna Schumaker 32d2a2705a rind: Add track_iter() and iter_track() functions
These match the playlist_iter() and iter_playlist() functions in the
node model.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-14 20:51:00 -04:00
Anna Schumaker e655d820e1 rind: Initialize a new playlist and model for each model test
This matches how we do the node tests

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-14 20:08:37 -04:00
Anna Schumaker 54c5768171 rind: Pass a playlist to the PlaylistModel constructor
I'm intending to create a new model whenever the currently visible
playlist is changed, so this helps to prepare for that.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-14 19:58:32 -04:00
Anna Schumaker 537fdb5443 rind: Remove *args and **kwargs from custom tree models
These haven't been used by anything, so simplify by dropping them

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-14 19:47:01 -04:00
Anna Schumaker 677ad97007 rind: Move Loop and Random button toggling into the view file
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-14 16:56:48 -04:00
Anna Schumaker 2f1e8b6965 rind: Move playlist.py into a subdirectory
I'm planning to split this into model and view code, similar to the node
sidebar.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-13 20:41:45 -04:00
Anna Schumaker c8de75e3d7 rind: Move about-to-finish signal into the audo module
This finally lets me remove the gst.py file

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-13 11:42:24 -04:00
Anna Schumaker 45e452c3b9 rind: Move eos handling into the audio module
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-13 11:42:24 -04:00
Anna Schumaker 8b6069eab8 rind: Autopause improvements
I return the next state that the playbin should be set to from the
decrement function so callers don't need to figure this out themselves.
Additionally, I added an about_to_pause() function to tell callers if
the next call to decrement() will return the pause state.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-13 11:41:05 -04:00
Anna Schumaker 670396e8ea rind: Move stream start handling into the audio code
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-12 21:43:51 -04:00
Anna Schumaker fbf3e5942e rind: Move label handling into the new audio module
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-12 21:30:44 -04:00
Anna Schumaker e5ffe89fa5 rind: Hide pause popover when count is at -1
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-12 10:38:17 -04:00
Anna Schumaker 25e5b2df64 rind: Move next and previous handlers into the audio module
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-11 21:59:34 -04:00
Anna Schumaker b97d1fb17f rind: Pass initial state to the playbin set_uri() function
This gives us a single set_uri() function that works for changing
tracks, but also still supports gapless loading.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-11 09:31:50 -04:00
Anna Schumaker 9749e20b80 rind: Move position tracking into the audio widget code
And out of the upper level gst.py module

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-10 20:58:18 -04:00
Anna Schumaker ace4b93030 rind: Pass new state information directly to the autopause handler
Rather than having it wait for a notification

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-09 15:51:27 -04:00
Anna Schumaker 330c492f16 rind: Move pause popover handling into the autopause code
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-09 15:51:25 -04:00
Anna Schumaker 69bf20bf84 rind: Generate the autopause estimate in the autopause code
I also use this as a chance to give a more accurate estimate when there
is over a minute left.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-09 11:14:00 -04:00
Anna Schumaker 14650d9ae1 rind: Move autopause code into the audio module
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-09 09:50:54 -04:00
Anna Schumaker a8333aa8ad rind: Move seeking through the widget into the audio code
This accounts for both the GtkScale widget and left / right keypresses
to step forward or backwards

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-09 09:16:22 -04:00
Anna Schumaker 92c4b4c3b7 rind: Move seek and position tracking code into the audio module
This moves position, duration, remaining, progress, seek by percent, and
seek by step functions all in one patch.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-08 16:14:20 -04:00
Anna Schumaker d393a87727 rind: Move play and pause button controls into the audio module
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-08 11:15:57 -04:00
Anna Schumaker 227ffa314f rind: Move volume setting into the new audio module
I create both a playbin helper function and a handler for the volume
button widget with this patch.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-08 09:20:09 -04:00
Anna Schumaker 7ac0ae495f rind: Move uri handling into the audio/playbin code
We need to make sure the path is properly escaped when loading to
account for any special characters that might be in the filename.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-07 09:28:17 -04:00
Anna Schumaker 24395fbc5c rind: Create a new audio module
The plan is to try to split up the gstreamer code into model and view
files to help make the code easier to work with.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-07 09:08:50 -04:00
Anna Schumaker c69389c156 rind: Move pause entry input into pause.py
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-06 20:42:21 -04:00
Anna Schumaker 63ff57c3fb rind: Remove some of the duplicated pause code
Most of this has been moved into the new pause.py file, so we can remove
it from here.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-06 20:17:52 -04:00
Anna Schumaker 9fb24fd0ce rind: Add pause functions to get the icon and text
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-06 19:46:37 -04:00
Anna Schumaker 27d61a46b1 rind: Handle up and down button clicks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-06 16:51:05 -04:00
Anna Schumaker 84538fdbc2 rind: Move pause widgets into a new file
I'm planning to separate out this code to make things a little easier to
follow and debug.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-06 10:00:09 -04:00
Anna Schumaker 2ca1cbbce4 rind: Fixes for the library test
- Add a delay after setting filename in the chooser
- Stop the library thread before exiting

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-06 10:00:09 -04:00