We need to free the playlist name after looking up in case we hit the
case where the playlist isn't found.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Otherwise valgrind will report that we are leaking memory.
Additionally, only initialize the idle queue for sync idle tasks until
album artwork needs it.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Valgrind told me that all calls to g_assert_cmpstr_free() weren't
actually freeing the string. A closer look shows that if we pass a
function as "lhs" then the function will be called twice, allocating
twice as much memory.
Fix this by storing the result of lhs in a temporary variable so
functions are only ever called once.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This makes the flag a little easier to toggle for testing. I also
rename the compiler option for consistency.
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>
Sometimes database entry keys change, so this gives us a way to update
them in the database keys hash table.
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>
NoWheyCreamery.com doesn't run an Xserver, so we can't run UI tests.
Add a switch to disable these so test results can be reported
accurately.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
These options are mostly used to communicate with a running Ocarina
instance to control playback.
Implements #37: Ocarina Command Line Commands
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This playlist has been the same as the hidden playlist for several
releases now. Let's make the change official!
Implements #28: Save hidden playlist as "hidden" instead of "banned"
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
One word labels are always better. I move the "Favorites" and "Hidden"
playlists under the "Playlists" header because they're manually
configured by the user.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than waiting for them to load with an idle task. This speeds up
Ocarina startup dramatically, since playlists can be added to the UI
with the correct size instead of needing extra callbacks to update the
size each time a track is added.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This was added so tracks could bump the libary tag size. Now that the
size field has been removed, we can remove this function.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The convention is for gtk builder files named with a ".ui" extension.
Let's rename our file to match, and drop the 6 while we're at it.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This makes file versioning way easier, since every file will have the
same version. I'll still need to manage minimum-supported versions, but
that shouldn't be too difficult going forward.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
These can be used for version number comparisons as integers, which will
be useful once file version numbers are based off of minor versions.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Most playlists don't allow changing this, and now that we have user
playlists it doesn't make sense to support repeating queued tracks.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This has to be created programmatically due to the dynamic nature of
user playlists. The easiest way to do that is to list user playlists in
a submenu and switch them out as needed.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets me "pause" playing queued tracks in favor of other playlists.
I remember the previous playlist so we can resume track picking once the
queued tracks playlist is empty.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets me add new options without needing to clutter the gui with
lots of rarely-used buttons.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Databases can change either as part of an upgrade or through adding and
removing entries. We can save a bit of memory by removing unallocated
entries during startup.
Implements #47: Automatic database defragment
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This was used to display the number of tracks in each library path. We
can use playlist functions to get this information now.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This was used to enable and disable library paths in previous Ocarina
versions. This isn't used anymore now that we have library-based
playlists.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The track tag doesn't need these tags now that they can be found in the
album tag.
Implements #64: Remove Artist and Genre pointers from Tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Artist and genre information are already saved by the album tag. In
addition, we can save a single date stamp instead of (year, day, month)
triplets.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And perform an upgrade when reading back in. After track tags are read,
we can save the database in the new format and remove the old tags.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And propegate these through the alloc steps to create an album with the
correct artist and genre tags set.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This allows for representing albums with multiple genres. I know this
doesn't happen too often, but it doesn't hurt to be covered. At the
very least, now we have a genre id for constructing new albums!
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I need a way to represent the same album with different artists to
account for multi-artist albums.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The date stamp is a single value that represents year, month, and day.
This should be slightly easier than working with three separate values.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>