Commit Graph

700 Commits

Author SHA1 Message Date
Anna Schumaker 2455d577df UI: Start basic files for GtkApplication and GtkWindows
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:54 -04:00
Anna Schumaker 1ed25e7d36 lib: Use the new version features for data files
This lets us use a different directory for debugging

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:38 -04:00
Anna Schumaker f08ce13a69 lib: Create a file for getting the current version
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:36 -04:00
Anna Schumaker 52a36a2f83 lib: Add an artistsort() function to the Metadata class
This is used to get the sort order for artists or album artists,
depending on which is set.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:35 -04:00
Anna Schumaker b75d43a304 lib: Create a Counter object
With increment() and decrement() functions that can be used to change
the GtkAdjustment's value. These functions return None if the value did
not change.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:34 -04:00
Anna Schumaker fc82beca3d lib: Don't allow adding a track to a tag multiple times
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:33 -04:00
Anna Schumaker 54498f174a lib: Track the runtime of Tags
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:31 -04:00
Anna Schumaker 3f0fce8c53 lib: Create a fake module for FakeTracks
And anything else that needs it. This lets us define all the fields
expected by other parts of the Emmental system without needed to read a
track file.

I also switch over the test_tag.py and test_tagstore.py files while I'm
at it.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:30 -04:00
Anna Schumaker c3cb3b9847 lib: Add position to the Tag TrackAdded and TrackRemoved publishers
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:29 -04:00
Anna Schumaker 7037483508 lib: Give Tags a stacked() function
This will be called when a tag is added to the tag stack to check if the
current track pointer needs to be reset.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:28 -04:00
Anna Schumaker d51ee8e0e2 lib: Create a metadata parsing class
This will help make Track creation a bit easier

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:26 -04:00
Anna Schumaker 9fe3867eae lib: Give Tags a random next() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:25 -04:00
Anna Schumaker 935087a040 lib: Give Tags an ability to loop during next()
I also provide a can_loop() function that the UI can use to determine
activatability of the loop toogle button.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:24 -04:00
Anna Schumaker 6d2a817a9b lib: Give Tags a next() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:22 -04:00
Anna Schumaker 08a055bbe2 lib: Pass sorting information through the TagStore.add() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:50:36 -04:00
Anna Schumaker 1215db01be lib: Allow iterating over all tags in a SuperTagStore
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:50:35 -04:00
Anna Schumaker 322dc04dd5 lib: Give Tags a get_header() function
The sidebar will want this for giving header widgets to some rows

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:50:33 -04:00
Anna Schumaker 7190feddb2 lib: Give tags support for sort order
Sometimes Musicbrainz will give us an albumsort, artistsort, or
albumartistsort field in the tags. We can use this for sorting sidebar
widgets.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:49:11 -04:00
Anna Schumaker 5c89fc8d85 lib: Test comparisons between Tags and SuperTags
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 13:27:12 -04:00
Anna Schumaker 3493c929b2 lib: Make more things available through the toplevel
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:38 -04:00
Anna Schumaker 04e42d0e37 lib: Implement a Thread class
Basically a wrapper around threading.Thread to make things re-runnable

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:37 -04:00
Anna Schumaker 2d9502f62a lib: Create a TagSuperStore
For storing SuperTags

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:36 -04:00
Anna Schumaker a6b9664231 lib: Create a SuperTag
SuperTags have a parent tag that they are associated with.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:35 -04:00
Anna Schumaker 365c5c6641 lib: Give TagStores item-related functions
For accessing tags by name, iterating over the collected tags, and
finding the number of tags.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:34 -04:00
Anna Schumaker 4da6c6b36e lib: Give TagStores an init_track() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:33 -04:00
Anna Schumaker def33c625a lib: Give TagStores functions for saving and restoring
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:31 -04:00
Anna Schumaker 0b7d505688 lib: Give TagStores a reset() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:30 -04:00
Anna Schumaker 7b6b4051ee lib: Add locking around TagStore add() and remove()
But make sure we don't call the publishers while holding the lock to
avoid deadlocks.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:29 -04:00
Anna Schumaker d03a0ff422 lib: Give TagStores Added and Removed publishers
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:28 -04:00
Anna Schumaker 9196908ccc lib: Allow passing None for the TagStore add and remove track
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:27 -04:00
Anna Schumaker 37282505a7 lib: Create a TagStore with add and remove functions
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:26 -04:00
Anna Schumaker c7ce2b9871 lib: Give Tags TrackAdded and TrackRemoved publishers
So we can respond quickly when individual tags are changed

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:25 -04:00
Anna Schumaker e0c8f6dac6 lib: Return trackids in Tag.__getstate__()
And provide a function for replacing the trackid with an actual track
during startup.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:24 -04:00
Anna Schumaker 51fff44746 lib: Give Tags support for the str() function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:23 -04:00
Anna Schumaker a6a35f37e7 lib: Add locking to the Tag class
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:21 -04:00
Anna Schumaker 5cdf01ddea lib: Give Tags functions for saving and restoring state
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:20 -04:00
Anna Schumaker c342d906e3 lib: Create a Tag class
This will help to avoid some code duplication across multiple tags

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:19 -04:00
Anna Schumaker cd424af848 lib: Implement a bus
My intention is to use this instead of the idle queue so things get
processed on a regular interval instead of waiting for the user to be
idle. It also supports a "running()" function so we know if busses still
have work to do.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:18 -04:00
Anna Schumaker 493c4e5c33 lib: Give settigs a initialize() function
For setting a value only if it doesn't already exist

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:14 -04:00
Anna Schumaker 76338da8fe lib: Implement save and load functions for settings
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:32:41 -04:00
Anna Schumaker e119a6cf19 lib: Add locking to the settings context manager
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:29:47 -04:00
Anna Schumaker 47c688324c lib: Give settings a reset function
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:29:44 -04:00
Anna Schumaker 126f03937b lib: Add get_int(), get_float(), and get_bool() functions to settings
The default returns as a string, so this lets callers avoid casting.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:28:40 -04:00
Anna Schumaker 96971317b5 lib: Begin a settings file
Right now I just have functions for set and get wrapped in a context
manager for splitting the setting string into section and key values.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-01 16:46:07 -04:00
Anna Schumaker e2bb85b854 lib: Enable reading and writing text DataFiles
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-01 16:46:07 -04:00
Anna Schumaker 7b901b8380 lib: Don't suppress errors from inside the DataFile context manager
And fix up the trackdb to check if the file exists before attempting to
unpickle.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-01 16:46:07 -04:00
Anna Schumaker 2083d00c23 Makefile: Disable testing curds/ and rind/ directories
I want to be able to test the new gtk4 code, but I can't do that with
the legacy code still enabled since gtk3 and gtk4 can't both be loaded
at the same time. The solution is to create a new "tests" target for
testing the new stuff.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-01 16:43:46 -04:00
Anna Schumaker 6f0d092414 trackdb: Give LibraryPaths an add_track() function
To mimic how curds.trak.lookup() works, only in the library path itself.

We also take this time to delete the curds/trak directory as nothing
there is used anymore.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-11-15 19:57:59 -05:00
Anna Schumaker 2001639d93 curds: Remove unneeded curds/trak structures
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-11-15 18:05:47 -05:00
Anna Schumaker e73416a2e1 curds: Replace new-track notification with TrackAdded publisher
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-11-15 17:43:07 -05:00