Commit Graph

3428 Commits

Author SHA1 Message Date
Anna Schumaker 151c446635 core/playlist: Use separate queues for favorite and hidden playlists
Implements issue #6: Store playlists as queues
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:04 -04:00
Anna Schumaker e5dc36ca6e core/playlist: Store a struct queue in the playlist_db
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker 90fc9bff0a core/playlist: Convert playlist_db to a GHashTable
I want to manage this container on my own, rather than relying on the
generic index code.  This will eventually make it easier to store a
playlist as a queue, instead of a set.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker c845530812 core/queue: Resort the queue when unsetting Q_ADD_FRONT
This flag is used for bulk inserts to cut down on the number of gui
operations during startup.  Let's just make it standard that unsetting
the flag causes the queue to resort itself.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker 9a98a009e9 core/queue: Add queue_{save|load}_tracks() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker 9ec2497ac5 core/queue: Add a queue_has() function
Used to check if a track is on a queue.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker afb2653f65 core/queue: queue_remove_all() returns count of tracks removed
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker 378ff72307 Remove core/containers/queue
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker db01ed3208 core/queue: Use a GQueue directly
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker 2b426cff48 core/queue: Switch over to using struct queue_iter
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker 9835235acd core/queue: Implement a new queue_iter
I plan to remove the containers/queue implementation, so we need a new
iterator for queue access.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker 6bb08ddbaa core/queue: Call g_queue_*() functions directly
This is a first step to removing core/containers/queue

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker e8d7576704 core/containers/set: Return status of set_insert() and set_remove()
I use this status indicator in the playlist code fairly often, so let's
return it directly rather than needing to code around it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker 5a30a63904 core/string: Add string_match() function
This function is used to determine if both strings exist and have the
same contents.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:13:10 -04:00
Anna Schumaker b7cf2509f7 Ocarina 6.4.15
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 08:10:07 -04:00
Anna Schumaker 9928c3239f core/tags/album: Improve MusicBrainz query accuracy
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-15 09:37:54 -04:00
Anna Schumaker 4f1f76b764 gui/audio: Update album art when manually setting
If the user is fixing broken album art then we need to update the image
immediately, otherwise the user will be confused.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-14 13:36:33 -04:00
Anna Schumaker eb5c0185e7 core/tags/album: Album art fetching improvements
- Allocate CaaCoverArt as needed, rather than sharing one object
- Use MusicBrainz fuzzy search to match more albums
- Escape most special characters in filenames

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-14 11:38:05 -04:00
Anna Schumaker 617088c89b core/tags/album: Fix retrying MB5 query on error 503
Reusing the Mb5Query can have undesireable side effects, such as the
error code not getting reset between queries.  Fix this by allocating a
new Mb5Query before evey request.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-14 11:38:05 -04:00
Anna Schumaker c62a88ce09 gui/audio: Add support for manually setting album art
Implements #58: Manually set album art
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-14 11:37:53 -04:00
Anna Schumaker e30f7f8115 core/tags/album: Add support for importing album artwork
This is needed so the user can manually set album artwork in the cases
where either we don't fetch the right image or no image is found.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-12 14:36:40 -04:00
Anna Schumaker 80d921343d core/file: Add support for importing a file into the cache
This will be needed to allow the user to manually set album art from a
downloaded file.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-12 14:16:46 -04:00
Anna Schumaker 99b51f5257 core/tags/album: Make quotes around artist name configurable
This allows me to search for `"release" AND artist` but also `release
AND "artist"`

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-11 09:43:01 -04:00
Anna Schumaker df3436f68a core/tags/album: Search with quotes around artist instead of album name
I think this results in a slightly better search, although there are
still a few wrong images fetched.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-11 08:05:33 -04:00
Anna Schumaker c8ccf7b844 core/tags/album: Place multiple queries to find artwork
If searching for artist and album fails, then fall back on album and
year or even just album name.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-04 21:30:06 -04:00
Anna Schumaker b4218833c5 core/tags/album: Immediately retry query on 503 error
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-04 20:59:29 -04:00
Anna Schumaker 2ea5104d42 core/tags/album: Fetch album art in the same step as metadata
This will help prepare for running multiple queries to find a release.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-04 20:59:28 -04:00
Anna Schumaker 86b63298a5 gui/idle: Show the idle progress as a tooltip
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-04 20:07:50 -04:00
Anna Schumaker 3c9798a6b7 gui: Remove unused GtkAdjustment
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 11:19:59 -04:00
Anna Schumaker ecc7843ea5 gui: Clean up setting album art
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 10:28:17 -04:00
Anna Schumaker dd66b10dfa gui: Properly load a pixbuf
Using gdk_pixbuf_new_from_file_at_scale() will load a scaled pixbuf,
which looks better than loading a height x height square.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 10:28:17 -04:00
Anna Schumaker 9ef9b17b93 gui: Fix up main GtkGrid
Somewhere along the line the grid formatting got messed up, probably
after several merges while other bugs were fixed.  This patch reworks
the grid so everything is formatted correctly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 10:27:57 -04:00
Anna Schumaker 1ac9e69128 gui: Minor spacing updates
This helps some widgets line up better, instead of looking slightly out
of place.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 09:19:15 -04:00
Anna Schumaker cbb9631877 gui: Add a function for determining the height of widgets
It's eaiser to do it in the builder code, rather than repeating this
code in several places.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 08:18:11 -04:00
Anna Schumaker 1e59968154 gui: Initialize track labels with whitespace
This gives labels the correct initial size, rather than forcing them to
resize after startup.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 08:08:56 -04:00
Anna Schumaker 5b7a985dc6 Ocarina 6.4.15-rc
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 11:13:55 -04:00
Anna Schumaker 54af68a57f gui/audio: Add album art support
Also add the "o_cover" widget to the glade file for setting album art.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker d0dddeacdb core/tags/album: Add album_artwork_path() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 940d2d1dc2 core/tags/album: Query the Cover Art Archive for album art
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 570efda299 core/tags/album: Query MusicBrainz for album release information
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker d79eb2c9b8 core/tags/album: Add album_artwork_exists() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 0d9b7baff6 core/tags/album: Add a pointer to the struct artist
This is needed for album art fetching to get more accurate results for
our MusicBrainz query.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 97c8f80393 core/idle: Add a way to reschedule idle tasks
This will be needed to reschedule MusicBrainz requests if the server is
busy.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 6b52775e58 core/idle: Add support for running idle tasks in a new thread
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 6a44f9e1a1 core/idle: Add idle_sync_t enum
I intend to use this to select between sync and async idle tasks.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker a6bfbbb1c6 core/file: Add file_remove() function
I plan to use this for upgrades to remove obsolete files.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 0344a2088d core/file: Add cache_file_write() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 9db9df619f core/file: Add cache_file_close() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker e137eb0108 core/file: Add cache_file_open() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 3723dff87d core/file: Add cache_file_exists() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00