Commit Graph

3483 Commits

Author SHA1 Message Date
Anna Schumaker fc88f68d6b tests: Build file test with ctest
This changes test output slightly, in that files are now placed under
subdirectories of $XDG_USER_DATA_DIR/ocarina-test/ instead of in this
directory directly.  This should help avoid conflicting files, and lets
me use a single "rm" command to remove everything before testing.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-09-23 16:11:02 -04:00
Anna Schumaker 9f2811a343 tests: Build string test with CTest
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-09-23 16:11:02 -04:00
Anna Schumaker 2f559b2fb3 tests: Build version test with CTest
This begins the conversion to CTest and the GLib unit test framework.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-09-23 16:11:02 -04:00
Anna Schumaker 0e171012ce Add CMakeLists.txt
For using cmake to generate a makefile instead of building through
scons.

Implements issue #3: Investigate CMake
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-09-23 16:11:02 -04:00
Anna Schumaker 17150b1791 Ocarina 6.4.20
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-23 16:04:45 -04:00
Anna Schumaker 257ef3612f gui/audio: Enable idle polling when the track changes
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>
2016-09-19 14:45:11 -04:00
Anna Schumaker b35b1eb132 Ocarina 6.4.20-rc
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:52:29 -04:00
Anna Schumaker 1bc43a9e2c gui/queue: Remove unused fields from struct gui_queue
Now that we have a single model and filter there is no need to attach
them to every gui_queue.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:52:29 -04:00
Anna Schumaker 336c0a01af gui/queue: Only allocate a single GtkTreeModelFilter
The view is now responsible for allocating the filter, but the gui_queue
still needs to set the filter function during an init step.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:52:29 -04:00
Anna Schumaker 65b43c7ae5 gui/model: Make sure that the queue model can represent a NULL queue
Otherwise this could lead to crashes or buggy behavior.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:52:29 -04:00
Anna Schumaker 40bce8cc59 gui/model: Don't require a GuiQueueModel for public functions
We can get by without this now that the model is shared across all
queues.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:52:29 -04:00
Anna Schumaker 5c426fc8d7 gui/model: Update runtime label when the model changes
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:52:29 -04:00
Anna Schumaker f58cc8da46 gui/model: Add a function for getting the current queue
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:52:29 -04:00
Anna Schumaker a28b5c4ec5 gui/model: Create a static, shared GuiQueueModel
Now that we can switch between different queues we no longer need to
allocate multiple models.

Implements #72: Only allocate a single GuiQueueModel for all playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:52:29 -04:00
Anna Schumaker a9aa3c297d gui/model: Add support for changing the represented queue
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:52:27 -04:00
Anna Schumaker 53285534b9 gui/model: Improve the efficiency of gui_queue_model_clear()
We can cut out several thousand function calls and allocations by
reusing the same GtkTreePath structure.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:50:50 -04:00
Anna Schumaker c2178bc265 core: Cut back on hardcoded dbe_index uses
The dbe_index of a given database item might change in the future, so we
can't rely on it everywhere.  Let's just use it for saving and loading
files, with the expectation that changes will happen sometime after
startup.

Implements #69: Reduce use of dbe_index in Ocarina code
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:50:45 -04:00
Anna Schumaker e82beb719f core/tags/track: Reduce the size of the track tag
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:50:34 -04:00
Anna Schumaker d222c306e0 core/date: Force struct date into 32bits
Three unsigned integers is overkill for handling dates.

Implements #65: Date structure can be represented with a single 32bit
value
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:50:22 -04:00
Anna Schumaker 65b547f60b core/tags/album: Add pointer to genre tag
Albums tend to have a single genre for all tracks, so it makes more
sense for an album to point to genre information.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:25:43 -04:00
Anna Schumaker 629f81da17 Ocarina 6.4.19
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-09-11 10:22:40 -04:00
Anna Schumaker 76d8b00ecc core/playlists/library: Use library tag path when allocating playlists
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>
2016-09-01 12:05:02 -04:00
Anna Schumaker 00c4c8a418 gui/collection: Set dialog default response
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>
2016-08-31 15:35:10 -04:00
Anna Schumaker ae851ab4ea core/playlists/library: Remove tracks from artist playlist when deleting
Otherwise we could leave artist playlists with invalid pointers.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-31 15:34:29 -04:00
Anna Schumaker 21718c4179 gui/collection: Select user's music directory when creating file chooser
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>
2016-08-30 07:47:07 -04:00
Anna Schumaker 15807434a4 gui/view: Unit test cleanups
- Define __queue_filter_how_changed() for tests that need queue
  callback functions
- Increase column sizes in the view test to make test more reliable

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-29 07:59:11 -04:00
Anna Schumaker 1d02024505 gui/queue: Check for gq_queue before dereferencing it
Otherwise Ocarina will crash.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-29 07:55:15 -04:00
Anna Schumaker 20f10c163d core/playlists/artist: Add pl_artist_delete_track()
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>
2016-08-29 07:53:13 -04:00
Anna Schumaker 4e5ae5e57c Ocarina 6.4.19-rc
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-29 07:38:49 -04:00
Anna Schumaker d7322c1f07 gui/queue: Add a selector for filtering by different fields
Implements #63: Add field selector for filtering
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:33:00 -04:00
Anna Schumaker 11ef52b5de core/string: Remove unused string functions
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:33:00 -04:00
Anna Schumaker aead4939c3 core/filter: Remove filter.c
It is unused now that I have a token matching system in place.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:33:00 -04:00
Anna Schumaker 2e753b6f52 gui/queue: Switch over to using token matches for filtering
This patch also adds the genre field to the list of fields that can be
searched.

Implements #62: Replace filter layer with token matching
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:33:00 -04:00
Anna Schumaker d16e06111d core/tags/track: Add track_match_token() function
This is used to check if a track has a token that begins with the
requested string.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:33:00 -04:00
Anna Schumaker 6ad4325f22 core/tags/track: Convert lowercased string into tokens
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:33:00 -04:00
Anna Schumaker 2e1c27294b core/tags/genre: Add genre_match_token() function
This is called to check if any string in a genre's token list is
prefixed by the given string.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:33:00 -04:00
Anna Schumaker 1ca9bb36c1 core/tags/genre: Convert lowercased string into tokens
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:33:00 -04:00
Anna Schumaker a70b27779f core/tags/artist: Add artist_match_token() function
This is called to check if any string in an artist's token list is
prefixed by the given string.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:33:00 -04:00
Anna Schumaker b643b532d7 core/tags/artist: Convert lowercased string into tokens
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:32:59 -04:00
Anna Schumaker be29f53eaa core/tags/album: Add album_match_token() function
This is called to check if any string in an album's token list is
prefixed by the given string.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:32:59 -04:00
Anna Schumaker c3bc8e9c02 core/tags/album: Convert lowercased string into tokens
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:32:59 -04:00
Anna Schumaker f70920015c core/string: Add a function for matching tokens
This will be used to replace the current filtering code with a token
comparison for each track.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:32:59 -04:00
Anna Schumaker de0446120e core/string: Add a comparison function for tokenized strings
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-29 07:32:59 -04:00
Anna Schumaker b3750aa31c core/playlists/system: Compare playlist names in a loop
This is easier to maintain than a giant switch statement, and should
make it easier to add new playlist types in the future.

Implements #61: Clean up system playlists
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-29 07:32:44 -04:00
Anna Schumaker d3e2f069fd core/playlists/system: Load collection in a separate idle task
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-29 07:31:29 -04:00
Anna Schumaker 81aea3017e core/playlists/system: Trigger an update during playlist init
This is a bit cleaner, and helps to simplify the system playlist
initialization process.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-29 07:31:29 -04:00
Anna Schumaker f4b12c5a83 core/playlists/system: Define each playlist near it's associated functions
I think this is a bit cleaner, and helps to keep similar things
together.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-29 07:31:20 -04:00
Anna Schumaker 532d55ba4f core/playlists/system: Clean up collection save and load function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-28 10:13:03 -04:00
Anna Schumaker 019137e4ed core/playlists/generic: Add a playlist_generic_update() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-28 10:13:03 -04:00
Anna Schumaker dddb098354 core/playlists/generic: Add a playlist_generic_init() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-28 10:13:03 -04:00