Commit Graph

3454 Commits

Author SHA1 Message Date
Anna Schumaker 1d1e41916a core/playlists/system: Check that we read a valid playlist name
Otherwise we could crash when we try to access an out of bounds area of
the playlist array.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-28 08:55:53 -04:00
Anna Schumaker 3098282382 gui/artwork: Don't destroy objects twice
The file filter and preview widget are both cleaned up when the file
chooser dialog is destroyed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-27 10:51:59 -04:00
Anna Schumaker 3b62125135 gui/artwork: Show hidden folders when selecting new images
Sometimes Ocarina gets the correct image for CD1, but not for CD2.
Allow traversing into hidden folders so users can select the correct
image out of the artwork cache.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-27 10:51:42 -04:00
Anna Schumaker 4de869d691 gui/artwork: Clear __artwork_cur_album when selecting album art
Otherwise the new image will never be updated due to the "did the album
change?" check in __artwork_set_pixbuf()

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-27 10:48:13 -04:00
Anna Schumaker 160295a6cc gui/artwork: Add a preview widget to the file chooser dialog
This lets users actually see images before selecting them for ablum art.

Implements #59: Add preview widget to album art chooser
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-27 10:45:59 -04:00
Anna Schumaker 343dec5d8d gui/artwork: Fix blurry album art
Using gdk_pixbuf_new_from_file_at_scale() can result in a blurry image
due to something in the gdk backend.  I want to have a sharper image, so
we need to perform the scale manually through Cairo.

Fixes issue #60: Album art is blurry
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-25 10:00:09 -04:00
Anna Schumaker 7dff5412bc gui/artwork: Reduce time spent polling for artwork
Since MusicBrainz limits us to one request each second, it doesn't
really make sense to poll for new artwork every half second.  Instead,
let's just put this into a new timeout function that gets called every
two seconds.  This should also let us stop polling once artwork has been
found.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-22 09:40:03 -04:00
Anna Schumaker 83724c5f6f gui/artwork: Split out album art functions into a new file
I think this is cleaner, and it should make it easier to maintain this
code.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-22 09:40:03 -04:00
Anna Schumaker 8893cdb58b tests: Unit test fixes
These should have been included as part of 6.4.15.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-22 09:40:02 -04:00
Anna Schumaker c5a563c112 Fix PKGBUILD dependency
We depend on the libmusicbrainz5 library, not libmusicbrainz.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-19 17:02:13 -04:00
Anna Schumaker 6ab5d99d71 Ocarina 6.4.16-rc
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-19 17:01:02 -04:00
Anna Schumaker e24ab97545 gui/playlist: Add size information to playlist sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:11 -04:00
Anna Schumaker 2c18f9e715 core/playlist: Add playlist_size() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:11 -04:00
Anna Schumaker 00dd72d46e core/playlist: Remove unused playlist_t enum
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:11 -04:00
Anna Schumaker 5e9b6bc975 core/playlist: Access playlists through a string
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:11 -04:00
Anna Schumaker 90e0b3ed78 core/playlist: Remove remaining dynamic playlist code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:11 -04:00
Anna Schumaker 2ff7113668 core/playlists/system: Move the least played playlist into system.c
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:10 -04:00
Anna Schumaker 9d3cc2e5ab core/playlists/system: Move the most played playlist into system.c
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:09 -04:00
Anna Schumaker 5ab2e63734 core/playlists/system: Move the unplayed tracks playlist into system.c
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:06 -04:00
Anna Schumaker 1527ee0e6d core/playlist: Add playlist_update() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:06 -04:00
Anna Schumaker 5a0fc355e4 core/playlist: Remove __playlist_is_{dynamic, static}() functions
This helps prepare for moving dynamic playlists into the system playlist
code.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:06 -04:00
Anna Schumaker a465577c86 core/playlists/system: Move system playlists into a new file
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:06 -04:00
Anna Schumaker e3d4143565 core/playlist: Add new playlist_type struct
I intend to use this for creating playlists with different properties,
such as using the playlist interface to add library paths.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:06 -04:00
Anna Schumaker 140abe79bc core/playlist: Split out system playlist load and save functions
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:06 -04:00
Anna Schumaker 8026207037 core/playlist: Split out basic system playlist functions
I'm going to use this as a starting point for creating a new playlist
interface.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:06 -04:00
Anna Schumaker 0f5d4e6a34 core/playlist: Remove __playlist_fill_static()
And other support code for filling the obsolete playlist_q with tracks.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-19 16:03:06 -04:00
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