Commit Graph

479 Commits

Author SHA1 Message Date
Anna Schumaker 89b40ab905 tools: Add a script for finding what files are missing a tag
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-18 13:27:31 -04:00
Anna Schumaker 0fc49912ed trackdb: Add support for genre lists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-18 13:27:00 -04:00
Anna Schumaker 31d89d4729 trackdb: Pull out the tags we need from audio files
I have some fallbacks in place in case a tag is missing, and we can
always add more tags later if something interests us.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-18 12:53:57 -04:00
Anna Schumaker 4e4cac25e0 trackdb: Use mutagen to read track tags
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-12 17:02:13 -04:00
Anna Schumaker 7afa16b57d trackdb: Add Track class
I don't read tags yet, but I set up some other variables that will be
useful later.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-12 16:22:27 -04:00
Anna Schumaker c46f73cbc6 trackdb: Add lookup methods for track ids
Playlists will want to use this when reading saved state to figure out
what tracks they hold.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-11 10:03:16 -04:00
Anna Schumaker 977c89068e trackdb: Store tracks in a dictionary instead of a list
And assign unique ID values to each for future use by playlists.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-11 09:50:12 -04:00
Anna Schumaker 3f8ef5812e trackdb: Implement a library reset function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-10 20:23:28 -04:00
Anna Schumaker b3510f059a trackdb: Add library added and library removed notifications
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-10 20:07:53 -04:00
Anna Schumaker 66128e2144 trackdb: Send track added and track removed notifications
Note that these happen in the scanning thread, so callers may need to do
some work to put them in the main thread if needed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-10 18:13:08 -04:00
Anna Schumaker eea6e0999a trackdb: Spin up a thread to scan library paths
This can be pretty slow, so we don't want to do it in the main thread.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-07 16:19:07 -04:00
Anna Schumaker 4327763af8 trackdb: Expand LibraryPath scan() to update the tracklist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-07 15:52:56 -04:00
Anna Schumaker 27441b9b79 trackdb: Add a LibraryPath class for tracking multiple audio sources
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-04 15:28:30 -04:00
Anna Schumaker a9f0ff8f8d trackdb: Add scaffolding for handling library paths
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-04 12:58:15 -04:00
Anna Schumaker 54d7ba6556 lib: Add a class for doing the Publisher / Subscriber pattern
This will eventually replace my current notifications system. Hopefully
it'll be a little easier to work with and maintain

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-04 10:30:52 -04:00
Anna Schumaker f7318f0bc7 Tools: Add a script for finding common tags of music files
I want to know the bare minimum of what tags can be relied on in my
music, so this script can help me set default / fallback tags.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-03 09:33:44 -04:00
Anna Schumaker 3eb55713f2 Tools: Add a script for showing the metadata of a file
This seems generally useful for determining what we should save or try
to display in the track database.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-03 08:47:44 -04:00
Anna Schumaker 4e1e2b0d0a rind: Set album artwork through an idle task
This lets us set the album art once per track, rather than up to three
times.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-01-02 17:25:11 -05:00
Anna Schumaker 1891bc8f61 rind: Calculate a fixed height for album art
And make sure we center the pixbuf in the GtkImage by allowing the image
to expand to its maximum width.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-01-02 16:40:49 -05:00
Anna Schumaker a7438b2be3 rind: Set a default image when there is no artwork
This acts as a placeholder, and keeps the sidebar from bouncing around
when tracks are changed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-31 10:55:35 -05:00
Anna Schumaker 0b334ddbee rind: Scale artwork when the sidebar position is changed
I always scale from the original reference image, and never from the
displayed pixbuf. This avoids artifacts due to lossy scaling algorithms.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-31 10:27:54 -05:00
Anna Schumaker d2c71f83a8 rind: Add an artwork widget
And look for the "image" tag from the gstreamer pipeline when setting.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-31 08:41:55 -05:00
Anna Schumaker 37c2260ebc Add an application icon
I took inspiration from a few other icons I found online, but I hacked
up my own version in Inkscape.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-30 20:41:05 -05:00
Anna Schumaker 21c23cf944 curds: Remove unused tags/ directory
I'm honestly surprised that this is still here

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-19 13:42:29 -05:00
Anna Schumaker b728137588 curds: Remove icon argument from lookup() and alloc_child()
We were ignoring this argument and setting whatever is appropriate in
alloc_child(), so let's just remove it entirely.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-17 12:22:52 -05:00
Anna Schumaker 7f2864ec07 curds: Move the PreviousPlaylist into special.py
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-17 11:55:06 -05:00
Anna Schumaker 9fdf837046 curds: Move the UpNext playlist into special.py
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-17 10:49:21 -05:00
Anna Schumaker e4709a80e2 curds: Collection playlist cleanups
- Use constants for icon and sort fields
- Move into a new special.py file

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-17 10:49:11 -05:00
Anna Schumaker ebd330098a curds: Move the NewPlaylist() into user.py
This could exist as its own file, but it is only ever used from user.py.
Merging helps to simplify the code a little.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-17 10:01:53 -05:00
Anna Schumaker 65af043778 curds: User node cleanups
- Use constants for the starred playlist icon and sort fields list
- Don't keep a reference to the new and starred playlists, and allocate
  new instances after a reset()

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-17 10:00:15 -05:00
Anna Schumaker 1291adb48b curds: Library node cleanups
- Use constants for the sort fields list
- Have alloc_child() set the icon directly, rather than using the one
  passed in by lookup()

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-17 09:32:16 -05:00
Anna Schumaker 09ee71e616 curds: Decade node cleanups
- Use constants for the sort fields list
- Have alloc_child() set the icon directly, rather than using the one
  passed in by lookup()

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-17 09:22:48 -05:00
Anna Schumaker d380a6f329 curds: Genre node cleanups
- Use constants for the sort fields list
- Have alloc_child() set the icon directly, rather than using the one
  passed in by lookup()

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-17 08:56:17 -05:00
Anna Schumaker e7e1838b13 curds: Artist node cleanups
- Use constants for the sort list
- Have alloc_child() set the icon directly, rather than using the one
  passed in

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-17 08:52:11 -05:00
Anna Schumaker 803cb6f186 curds: Replace find_child() with lookup()
We use the allocate version everywhere already, so let's just rename it
to lookup and have a less confusing name.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 16:37:12 -05:00
Anna Schumaker d7ad6c5894 curds: Remove the PlaylistNode class
It is now unused

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 13:43:40 -05:00
Anna Schumaker 88b45a3fee curds: Remove append_child() from the PlaylistNode
And work it into the PlaylistRoot's __init__() function

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 13:25:34 -05:00
Anna Schumaker 8f9657ce8b curds: Remove the node_lock from the PlaylistNode
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 13:21:48 -05:00
Anna Schumaker 1b88795d17 curds: Pop empty playlists earlier during playlist.next()
Rather than waiting until the next next() call, we can detect and remove
them right away.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 10:26:08 -05:00
Anna Schumaker 99de9c0f7d curds: Move Current playlist handling out of the Root node
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 10:18:25 -05:00
Anna Schumaker 75a8c8d169 curds: Move playlist selection out of the Root node
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 09:56:19 -05:00
Anna Schumaker d25a026282 curds: Move playlist.peek() out of the Root node
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-16 09:04:12 -05:00
Anna Schumaker 1943a7bb08 curds: Move playlist.next() implementation into the __init__.py file
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-15 14:17:31 -05:00
Anna Schumaker eb507d96d1 curds: Move playlist previous() function out of Root
And into the package init file

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-15 09:18:39 -05:00
Anna Schumaker 1088bb16ce curds: Move Root's self.track function into __init__.py
And keep it as a global variable. This reduces the amount of work in the
root node, and makes things a little easier to follow

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-15 09:10:40 -05:00
Anna Schumaker 52c68eb3e2 curds: Rename previous.py to prev.py
I want to create a previous() function in the __init__.py file, but this
is causing import errors. We need to rename this file so everything
works as expected.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-15 08:38:06 -05:00
Anna Schumaker 38c6e9d35f curds: Remove extra Root lookup step from these function calls
We still do this internally in the playlist/__init__.py file, so we can
skip it here and make the lines a little shorter.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-14 08:19:30 -05:00
Anna Schumaker f5262278df curds: Remove the __init_common__() function
And fix up the user node so it still works as expected

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-13 16:09:27 -05:00
Anna Schumaker 708ae8ede2 curds: Auto-register new_track() functions for tree nodes
It's pretty easy to detect this in the base class, so let's save
the child classes some work.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-13 15:52:43 -05:00
Anna Schumaker 21f6bd62a8 curds: Give playlists their own plist_lock
Rather than continuing to use the tree lock. This lets us be a little
more focused in what the locks protect, while also allowing tree
operations to happen in parallel with playlist operations.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2019-12-13 15:52:42 -05:00