Commit Graph

1334 Commits

Author SHA1 Message Date
Anna Schumaker 5292a69a20 curds: Give playlist nodes a sort_key() function
And use it for doing less-than checks

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-31 13:34:01 -04:00
Anna Schumaker 054b9d05c2 curds: Give tracks their own sort_key() function
I'm about to give playlists a sort_key(), so clean up the existing
function first

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-31 11:23:48 -04:00
Anna Schumaker 4d5a347cc0 curds: Add check for adding a track multiple times to a playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-29 14:50:50 -04:00
Anna Schumaker d5f03710e5 curds: Clean up genre node test
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-29 14:09:40 -04:00
Anna Schumaker 6ff1d34d0c curds: Clean up collection playlist test
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-29 09:53:33 -04:00
Anna Schumaker 3097e425a4 curds: Clean up previous playlist test
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-29 09:31:21 -04:00
Anna Schumaker 5920fa4d8a curds: Clean up user playlist test
Split this up into more focused tests

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-29 09:13:05 -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 8acd119630 curds: Add a function for moving tracks in a playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 11:08:21 -04:00
Anna Schumaker 214ffab2b7 curds: Add a playlist.remove() function
For removing tracks from playlists

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 11:08:21 -04:00
Anna Schumaker 1e422a1711 curds: Clean up playlist sorting test
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 10:02:35 -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 ce269d496d curds: Rewrite playlist loop and random tests
Split these up to make them simpler

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 08:54:20 -04:00
Anna Schumaker c42d73a902 curds: Rearrange playlist next and peek tests
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-24 08:44:43 -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
Anna Schumaker 419e80d983 rind: Clean up playlist track add tests
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-05-23 15:52:41 -04:00
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