Commit Graph

3592 Commits

Author SHA1 Message Date
Anna Schumaker e4e90f165e tests/core/audio: Process idle queue on EOS
Otherwise idle tasks will register as memory leaks.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-29 14:50:36 -04:00
Anna Schumaker 4250757b83 core/playlists: Don't leak playlist names while loading
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>
2016-09-29 14:50:36 -04:00
Anna Schumaker cb2af114c5 core/playlists/user: Free playlist name during deinit
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-29 12:44:17 -04:00
Anna Schumaker b4d78b0d3d core/playlists/library: Free scan path when we're done with it
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-29 12:44:17 -04:00
Anna Schumaker d5de8e5dbf tests/core/queue: Deinitialize queues after testing
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-29 12:44:17 -04:00
Anna Schumaker 6120366da3 core/tags/album: __album_query_artist() needs to initialize "found"
Otherwise we could end up checking this variable uninitialized.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-29 12:44:17 -04:00
Anna Schumaker eb16d9c6fb tests/core/tags/album: Deinitialize genre after testing
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>
2016-09-28 16:53:20 -04:00
Anna Schumaker 1d7cfa0e6d tests/core/tags: Don't call *_db_init() twice in unit tests
This could lead to a false-positive when looking for memory leaks.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-28 15:55:32 -04:00
Anna Schumaker 99faa0cf39 tests: g_assert_cmpstr_free() stores the lhs in a temporary variable
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>
2016-09-28 15:20:24 -04:00
Anna Schumaker 0407486316 tests: Rename CONFIG_TESTING_ALBUM_ARTWORK to CONFIG_TESTING_ARTWORK
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>
2016-09-28 15:20:19 -04:00
Anna Schumaker 9a216fee1e gui/queue: Remove unused GQ_CAN_REPEAT and GQ_CAN_DISABLE flags
These go unused as a result of our recent playlist changes, so we can
remove them now.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-28 10:04:28 -04:00
Anna Schumaker ae916eaf40 gui/queue: No need to change random image sensitivity
GtkThemes should be taking care of this indicator for us.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-28 10:00:25 -04:00
Anna Schumaker 9d279fe21e gui/playlist: Don't show Collection on startup
__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>
2016-09-28 09:33:27 -04:00
Anna Schumaker e25b8407b0 gui: Widget spacing tweaks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-28 09:12:17 -04:00
Anna Schumaker d7709fd5fb gui: Replace "Add New ..." button with a single GtkButton
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>
2016-09-27 14:12:21 -04:00
Anna Schumaker eb8a23f2ff core/tags/track: Add support for re-keying the track database
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>
2016-09-26 15:41:56 -04:00
Anna Schumaker 811509ff80 core/database: Add a db_rekey() function
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>
2016-09-26 14:58:30 -04:00
Anna Schumaker cf4eedb592 core/database: Autosave databases if the file version changes
To make sure the latest changes are recorded to disk.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 12:02:45 -04:00
Anna Schumaker 93d1550763 core/settings: Check for a NULL key
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>
2016-09-26 12:02:23 -04:00
Anna Schumaker 2e38b3551e tests: Add a switch for disabling GUI tests
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>
2016-09-26 08:26:45 -04:00
Anna Schumaker ec3b9f7c8e .gitlab-ci.yml: Update for CMake conversion
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 08:23:09 -04:00
Anna Schumaker 142af976b3 Ocarina 6.5-rc
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 08:21:55 -04:00
Anna Schumaker 5a41eef8a2 gui/ocarina: Add basic command line options
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>
2016-09-26 08:07:36 -04:00
Anna Schumaker 419d31d4c3 core/playlists/system: Drop support for looking up the "Banned" playlist
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>
2016-09-26 08:07:36 -04:00
Anna Schumaker afbf9e0b1a gui/playlist: Change headers to "Playlists" and "Dynamic"
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>
2016-09-26 08:07:36 -04:00
Anna Schumaker ef8a764780 core/playlists: Allocate artist and library playlists during startup
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>
2016-09-26 08:07:36 -04:00
Anna Schumaker 27436115c7 core/database: Remove dbe_setup()
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>
2016-09-26 08:07:36 -04:00
Anna Schumaker 1b18177d0a core/database: Remove db_load_idle()
This was added to help show the window faster.  Recent changes have made
it unnecessary.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 08:07:35 -04:00
Anna Schumaker 21a47ec3b8 gui: Rename ocarina6.glade -> ocarina.ui
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker b39c4c9ba4 core/file: File version is OCARINA_MINOR_VERSION
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker 43a0ffd54c ocarina: Add OCARINA_{MAJOR, MINOR}_VERSION constants
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker 0cb44aaf3a gui/queue: Remove Repeat button
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker 4a4ec3fa36 gui/audio: Add GtkVolumeButton for changing volume
Implements #38: Add volume slider
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 08:07:35 -04:00
Anna Schumaker d8c3fb9ace core/audio: Add support for changing audio volume
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 08:07:35 -04:00
Anna Schumaker f02dff4177 gui/view: Sort the user playlists menu
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 08:07:35 -04:00
Anna Schumaker ddb564ed82 gui/view: Create a menu item for adding tracks to user playlists
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker ecebd20a0b core/playlists: Select queued tracks playlist when adding tracks
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker f0e9e1f1e4 gui/playlist: Add user playlists during init
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 08:07:35 -04:00
Anna Schumaker e2d4dd61fb gui/view: Add "New Playlist" menu options
And pop up a dialog mox to ask the user for the name of the new
playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 08:07:35 -04:00
Anna Schumaker 1b9101cf26 gui/collection: Replace Add Library Path GtkButton with a GtkMenuButton
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker dcbf2dff72 core/playlists/user: Add support for user created playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-26 08:07:35 -04:00
Anna Schumaker d6e5e6c773 core: Defragment databases on startup
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker 85bfe717dd core/tags/library: Remove unused li_size variable
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker 30cebb4a45 core/tags/library: Remove unused "enabled" field
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker 784cd3eb91 core/tags/track: Remove redundant artist and genre tags
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker 71ee59ae22 core/tags/track: Reduce amount of saved data
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker 0cefd158d9 core/tags/album: Add artist and genre information to saved data
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker 0ea75ccb29 core/tags/album: Add artist and genre arguments to album_find()
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker ffd09d410c core/tags/album: Add Genre ID to album keys
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>
2016-09-26 08:07:35 -04:00
Anna Schumaker a85a1df7de core/tags/album: Add Artist ID to album keys
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>
2016-09-26 08:07:35 -04:00