Track database defragmenting can happen before the new tasks are ever
scheduled, causing a crash when we try to find tracks with changed IDs.
After the crash, the Favorites and Hidden playlist data appears to be
lost.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
__gui_playlist_init_idle() will select the first visible playlist by
default, which is what we want. Let's not override this by showing the
Collection later in this function.
Fixes#95: Startup shows Collection instead of Queued Tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I find that I usually create playlists through either a right click
action or through a keyboard shortcut, so we don't need an extra option
hidden inside a MenuButton. Let's remove the button and show the "Add
Library Path" option directly instead.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets up update track keys to prevent duplicates showing up during a
library path update.
Fixes#93: Library sometimes has duplicated tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This fixes a problem with restoring treeview columns. Sometimes
"Played" gets allocated way too much space, so I solve this by changing
it's setting key to NULL so the column always gets whatever space is
leftover.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Unplayed, Most Played, and Least Played tracks playlists update
themselves with an idle task when tracks have been played. It looks
like we haven't been processing these tasks, so the queue was just
building up after every track. Fix this by enabling the GTK idle
callback whenever a track is played.
Fixes#89: Dynamic playlists aren't updating
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This isn't as important for established playlists, but this string could
quickly become an invalid pointer for new playlists that are added.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This gives users the ability to add new library paths by pressing the
"Enter" key instead of needing to click a button with their mouse.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Most users will have their music in their ~/Music directory, so it makes
sense to select this path by default.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Library playlists call this when deleting tracks, otherwise we could end
up dereferencing invalid pointers the next time we use the artist
playlist.
Fixes#81: Remove deleted tracks from artist playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This seems less efficient overall, since we now need to take several
passes over the track database. What I've noticed is that the
single-pass option creates a lot of UI notifications that makes the gui
unresponsive for a large amount of time. Breaking this into smaller
chunks gives us a chance to handle any user actions between loading each
playlist.
Fixes#71: Initalize artist playlists with more idle tasks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
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>
The thread pool is used to fetch album art in the background, but this
can slow down most tests that aren't interested in album art. Adding a
(testing-only) function for running without the thread pool speeds
things up a bit.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
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>
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>
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>
This patch fixes two issues. First, I disable scrolling when the user
has manually selected a track. I've found that extra scrolling in this
case can be disorienting, and frequently ends up with the wrong track
selected due to how queue iterators are set so it's probably best just
to disable scrolling in this case.
This patch also changes the order of calls to set_cursor() and
scroll_to_cell(). I've found that scrolling before setting the cursor
causes the GtkTreeView to ignore alignment settings unless the row is
already on the screen. Switching the order makes everything work
properly.
Fixes#57: Wrong track is sometimes scrolled to
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This patch adds support for changing a rows font face to bold for the
currently playing track. This should make it easier to find what track
is playing while quickly skimming through the list.
Fixes#22: Highlight the currently-playing song in the collection
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Otherwise the list of tracks is left blank, which the user might not be
expecting.
Fixes#55: Collection should be selected by default
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Tracks information should always be the same height, so we can safely
enable this as a quick speed up to the treeview.
Fixes#52: Enable GtkTreeView fixed height mode
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Enabling all queues by default, even ones read from disk, is incorrect
as it leads to all queues getting reenabled when restarting Ocarina.
Fixes#56: Enabled status of temporary queues not saving
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>