1cd9780cdf
trackdb: Have the UpNextPlaylist use Track.remove_from_playlist()
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:55:13 -04:00
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
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
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
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
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
54498f174a
lib: Track the runtime of Tags
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:31 -04:00
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
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
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
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
9fe3867eae
lib: Give Tags a random next() function
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:25 -04:00
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
6d2a817a9b
lib: Give Tags a next() function
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:51:22 -04:00
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
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
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
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
5c89fc8d85
lib: Test comparisons between Tags and SuperTags
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 13:27:12 -04:00
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
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
2d9502f62a
lib: Create a TagSuperStore
...
For storing SuperTags
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:36 -04:00
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
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
4da6c6b36e
lib: Give TagStores an init_track() function
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:33 -04:00
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
0b7d505688
lib: Give TagStores a reset() function
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:30 -04:00
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
d03a0ff422
lib: Give TagStores Added and Removed publishers
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:28 -04:00
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
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
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
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
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
a6a35f37e7
lib: Add locking to the Tag class
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:33:21 -04:00
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
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
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
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
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
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
47c688324c
lib: Give settings a reset function
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-17 12:29:44 -04:00
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
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
e2bb85b854
lib: Enable reading and writing text DataFiles
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-01 16:46:07 -04:00
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
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
a1fcf032b5
lib: Create a library for idle callbacks
...
I use a fake idle queue for testing, but fall back on the main GLib idle
code for production. I made the fake idle queue threadsafe just to be
cautious.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-26 17:25:21 -04:00
cc2b74eaa3
lib: Convert DataFiles to using pathlib Paths
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-18 17:16:11 -04:00
08a37fef87
lib: Copy over existing DataFile class
...
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2020-10-18 16:25:49 -04:00