Commit Graph

597 Commits

Author SHA1 Message Date
Anna Schumaker 9733b82ae8 core/collection: Remove file
I have replaced everything in this file with the code in
core/playlists/library.c

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker bddbd04ef5 gui: Remove stack widget
It isn't needed now that we pop up a file choose dialog for selecting
library paths.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker b3476e15e9 gui/collection: Remove unused collection code
And the now unused sidebar widget.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 73c70678bb gui/collection: add button for adding library paths
This is easier than responding to events from the treeview.  Let's just
pop up a dialog and let the user select from there, rather than doing
something complicated with a stack.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 62e1b27b6c gui/playlist: Add support for deleting playlists
System playlists cannot be deleted, but library playlists can.  Deleting
a library playlist removes the library and associated tracks from the database.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 382ee79c2e gui/playlist: Add artist playlists to the playlist sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker f2597a8e6c gui/playlist: Add library playlists to the playlist sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 8abc45b1ae gui/playlist: Store the playlist type in the sidebar treemodel
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 871bf88b94 gui/queue: Store playlist in the gui queue
I'll need to know the playlist type to set artist information properly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker cfeca9ae4b core/playlist: Add playlist_type enum
I'm going to use this to distinguish between various playlist types that
are about to be added.  Let's update the playlist functions first, and
then add more types in a future patch.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 004d4578d4 gui/queue: Set gq_queue->gq_search to NULL after freeing
Otherwise we can attempt to free the search text again when the queue is
destroyed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-13 08:26:00 -04:00
Anna Schumaker 085701ad9d gui/queue: Set gq_queue->gq_visible to NULL after destroying
Otherwise the existance check will still pass the next time
__queue_filter() is called, and we will attempt to destroy it again.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-13 08:21:22 -04:00
Anna Schumaker f7e9e8b321 gui/queue: Remember search text when switching queues
I wasn't doing this, but I also wasn't refiltering queues when they were
changed.  This resulted in showing a filtered queue, but without a way
to clear it.  Remembering the text lets me simply set the text, instead
of refiltering queues whenever they are changed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-10 07:31:03 -04:00
Anna Schumaker 44a6ad0d78 gui/playlist: Make sure we free text from tree_model_get()
Otherwise this leads to a memory leak.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-01 12:06:25 -04:00
Anna Schumaker 34447007f9 core/history: Remove unused queue
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:09:38 -04:00
Anna Schumaker 5a54fb69b6 core/collection: Remove unused queue
And remove collection_ops from the core initdata

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:09:33 -04:00
Anna Schumaker dc07d637f6 gui/history: Remove unused gui queue code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00
Anna Schumaker 64fc5a9a0d gui/collection: Remove unused gui queue code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00
Anna Schumaker 15ed068e13 gui/playlist: Select Collection playlist during startup
This preserves the original behavior, where the collection is always
selected from the beginning.  This can be improved upon later, once
queued tracks are implemented as a playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-29 17:06:06 -04:00
Anna Schumaker 696173b03e gui/playlist: Add Collection and History playlists to the sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00
Anna Schumaker dfae74dd50 gui/playlist: Set gui queue name based on passed playlist
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00
Anna Schumaker 5d4de9c5b0 core/playlist: Add playlist_sort() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:03 -04:00
Anna Schumaker 44a57ed863 core/queue: Add extra paramater to queue_init()
This is used to pass through a value to the GUI during queue
initialization.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:03 -04:00
Anna Schumaker 93fb40360d core/filter: filter_search() returns a new GHashTable
I think this is cleaner than having an upper layer allocate the results
set manually.  This also lets me return NULL in the case that there were
no results.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:05:59 -04:00
Anna Schumaker fda3f761a0 core/filter: Call GHashTable functions directly
Implements #43: Filter code can use a GHashTable directly
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:05:54 -04:00
Anna Schumaker 29b2b6f6f4 core/filter: Store track pointers directly
I was storing database indexes, but this assumes that database indexes
are constant.  I intend to change this with database defragmentation.

Implements #46: Filter stores a track pointer
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:05:47 -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 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 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 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 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 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 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 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 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 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 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 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 9e0f017e61 core/file: Build in minimum version checks
I don't think it makes sense that callers of file_open() are expected to
check the file version after opening.  This should be something handled
by the file code so we can print a consistent error message.

Implements issue #5: Better file versioning
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker bc513532c1 gui/idle: Add a function to disable processing idle tasks
This is needed during ocarina shutdown to prevent a segfault.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:09:39 -04:00