Commit Graph

1016 Commits

Author SHA1 Message Date
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
Anna Schumaker 72a947621c rind: Replace window title and subtitle with a custom widget
This lets me control size and justification of the text. Additionally, I
put everything into a scrolled window just in case a track has a really
long title name.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-20 09:58:23 -04:00
Anna Schumaker c636b3fd5e rind: More icon and spacing changes
I switch around the sidebar icons again, and also make the header bar
icons larger to make them easier to press with touchscreens

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-20 09:58:06 -04:00
Anna Schumaker e1c52e33b7 rind: Import gst from __init__.py
Otherwise it won't be loaded on startup.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-19 12:18:40 -04:00
Anna Schumaker 60da00adf8 rind: Add play, pause, and next buttons
And also change the window title and subtitle when loading a new track

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-19 12:17:58 -04:00
Anna Schumaker eb5b32893d curds: Change collection icon to audio-x-generic
This is a little larger than the emblem, so I think it'll look better

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-19 12:12:26 -04:00
Anna Schumaker 9341a56f11 curds: Change Library Playlist icons folder-music
Library paths are directories on disk, so it makes sense to use the
folder-music icon to represent them.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-19 11:22:20 -04:00
Anna Schumaker b42c654c2c rind: Begin audio code
I don't yet have UI widgets, but this should cover the basics of audio
playback.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-18 17:19:33 -04:00
Anna Schumaker e9e056e925 rind: PlaylistModel.get_value() should check for out-of-bounds iterators
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-18 17:18:16 -04:00
Anna Schumaker b642e762f7 curds: Add a next() function to the PlaylistManager
I'll eventually make this more complex when I add in more playlists, but
for now it just calls next on the Collection playlist

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-18 17:15:16 -04:00
Anna Schumaker 57b642265c rind: Add library playlists to the playlist manager
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-17 11:15:04 -04:00
Anna Schumaker 9f690ae204 curds: Make it easier for the UI to access the LibraryPlaylist class
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-17 10:59:09 -04:00
Anna Schumaker 524af59ec1 curds: Improve the LibraryManager
I change it to a sorted list for easier indexing by the UI iterators.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-17 10:58:44 -04:00
Anna Schumaker 0873f0458c curds: Add a less than operator for playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-17 10:58:14 -04:00
Anna Schumaker e6cc3716eb rind: Add one to MangaerModel iter user_data
This lets us use 0 to represent a child that we haven't descended down.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-16 09:17:22 -04:00
Anna Schumaker 6539299212 rind: Add an iter_playlist() function to the MangaerModel
Converting between a TreeIter and a playlist is very useful, so
implement that functionality now.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-16 09:17:22 -04:00
Anna Schumaker 4c256f7656 curds: Add playlist to string formatting
We could do this in the UI, but it's almost easier to implement in the
backend.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-16 09:17:22 -04:00
Anna Schumaker a983947200 rind: Add another treeview for a playlist selector
Right now it just supports one level of playlists, but others will be
implemented as we go on.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-16 09:17:18 -04:00
Anna Schumaker ad9c79826c curds: Add icons to playlists
This UI is going to use this for the playlist selector

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-15 15:06:05 -04:00
Anna Schumaker 414545818f curds: Improve extracting ints from mutagen metadata
Some tracks in my library aren't formatted as expected, so let's improve
our parsing code to better handle integers.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-15 08:40:25 -04:00
Anna Schumaker 31d7ae26fa rind: Implement the PlaylistModel
This is a special tree model that translates our Playlist object into a
format that GTK understands.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-15 08:40:25 -04:00
Anna Schumaker 94ef044b59 curds: Add the PlaylistManager to the main import
This way the rind can use a global instance, rather than needing to make
their own,

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-14 12:07:30 -04:00
Anna Schumaker 7bbd1df902 curds: Playlists no longer inherit from list
I was having trouble with bound methods when using notifications, since
all empty playlists were getting identified as the same empty list
object. Removing the inheritance fixes the problem.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-14 12:06:07 -04:00
Anna Schumaker 3529aa5395 curds: Rename on-add notification to add-track
This matches the rest of my notification naming style

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-14 10:39:07 -04:00
Anna Schumaker d42492ced5 rind: Add gtk Application and Builder
I also add a basic UI file that contains the main window. I'll add on to
the gui from here.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-13 15:48:35 -04:00
Anna Schumaker 22b3953be0 curds: Create a Collection playlist type
This represents all tracks added to the collection, from across all
library paths. We also fix the value of Playlist.loop to "True" and
prevent changing it

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-13 10:37:47 -04:00
Anna Schumaker 57f32aaa58 curds: Only allow one instance of a track on playlists
This makes removing tracks from playlists way easier, since there is
only ever one instance of the track.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-12 14:54:05 -04:00
Anna Schumaker dca914860b curds: Add extra playlist next() tests
We want to make sure we get the expected results when calling next() on
empty playlists and with playlists that only have one track.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-12 11:09:00 -04:00
Anna Schumaker 63d6168229 curds: Add support for random next
I try to prevent the same track from getting selected twice in a row by
incrementing the current pointer rather than setting it directly, and
reducing the random range slightly.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-12 10:50:12 -04:00
Anna Schumaker 2286665024 curds: Add a function for picking the next track
If "loop" is True, then we loop back to the beginning of the playlist
when we reach the end.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-12 10:00:09 -04:00
Anna Schumaker 1beb3cf869 curds: Replace track.add() with track.lookup()
Now that we have a "new-track" notification, we can replace the add
function with a lookup function that more closely mirrors how we look up
album tags.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-11 17:09:36 -04:00
Anna Schumaker 8a4d3219d2 curds: Create "new-album" and "new-track" notifications
And update the playlist manager to use the new-track, rather than
relying on "on-scan"

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-11 17:02:59 -04:00
Anna Schumaker 752ebece3d curds: Make playlist notifications more generic
We might want to use these outside of the playlist code, so let's move
this to a generic place so it can be easily used.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-11 16:48:51 -04:00
Anna Schumaker 64ab13718c trier: Fix path for a track
The slash in the filepath was being intepreted as a subdirectory, so
let's change it into an underscore so everything is where we expect.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-11 12:10:38 -04:00
Anna Schumaker 96ea582522 curds: Add a Collection playlist
This playlist collects all tracks that the user has added, across all
libraries.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-11 11:54:49 -04:00
Anna Schumaker f53eaa8028 curds: Only trigger "on-scan" when new tracks are created
This cuts down on unnecessary notifications for tracks that already
exist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-11 11:21:38 -04:00
Anna Schumaker 7b1fac0bfb curds: Create a playlist manager class
This replaces the code in playlist/__init__.py and turns it into a
class. This should make things easier to handle during testing, since we
can easily tear down the old instance and create a new one.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-11 11:01:49 -04:00
Anna Schumaker 464631c0d6 curds: Clean up package imports
Create some shortcuts to make the interface easier to work with.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-11 10:09:24 -04:00
Anna Schumaker a751bb4f61 curds: Add a way to cancel notifications
I expect this will mostly get used by testing code as we create and
delete a bunch of different objects.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-11 09:39:32 -04:00
Anna Schumaker a2037d6c59 curds: Begin implementing a playlist manager
This will give us a single place for the UI to look up and control
playlists.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-08 16:33:48 -05:00
Anna Schumaker 713e8b2dd3 curds: Add a playlist notifications system
This is mostly needed by the UI but there are a few cases where we
might need it internally, such as adding newly creating tracks to all
the required playlists.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-08 10:58:35 -05:00
Anna Schumaker b9a563024f curds: Add library playlist
This playlist represents all tracks in a given subdirectory, and is how
we control adding or removing tracks.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-08 08:26:12 -05:00
Anna Schumaker e0763ec727 curds: Add basic playlist class
The intention is that different playlist types will create a subclass of
this class to do whatever work they need.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-07 17:00:58 -05:00
Anna Schumaker 99f103d345 curds: Make Tracks indexable
This lets us convert string fields into the corresponding track tag. I
intend to use this so playlists can have a custom sort function.

I eventually intend to add the matching __setitem__() function for
changing tags.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-07 09:28:04 -05:00
Anna Schumaker 2057721028 Add a toplevel script
I'll eventually need to be able to run everything as a single
application, so let's prepare for that now. This gives us a chance to
get the imports right from the start, rather than needing to go through
and fix things up again.

I also add a test to make sure everything works as expected.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-06 09:23:25 -05:00
Anna Schumaker 5908a8af50 curds: Add save() and load() functions
These functions pickle out the entire tag map onto disk. I also add a
stress test for the entire tags module that scans tracks using the
threadqueue, since that's how I intend everything to be used.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-05 16:50:01 -05:00
Anna Schumaker c28e06730b curds: Add helpful functions to the DataFile
There are cases, mostly during testing, where we might want to check if
a file exists or to remove it if it does.  Let's add those functions
now so we can use them.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-05 16:49:00 -05:00
Anna Schumaker 60f56ba3b7 curds: Add a Track Tag class
This is similar to the Album tag and stores its data in the same
dictionary.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-03-05 16:48:30 -05:00