This is called to get the requested playlist. I also reworked
playlist_get_queue() to call this function.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
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>
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 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>
This is needed to handle track database defragmentation, but could also
be expanded on later to save playlists from a generic place.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I query the underlying playlist to see if it is selectable, and then
update the settings file if it is.
Implements #10: Select default playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I need to have integer playlist ids to store into the settings database
once I allow changing the default playlist.
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>
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>
The history playlist uses a noop function, since changing random or
repeat settings doesn't make sense for this playlist. The collection
playlist uses a custom function to save changes after setting a flag.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I set the history playlist to use a noop function, since changing the
history doesn't really make sense.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Scanning new library paths should also add artist playlists, otherwise
they won't show up until Ocarina is restarted.
Fixes#79: Artist playlists not updated when tracks are added
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
System playlists cannot be created or deleted, so these functions simply
return false in this case. Library playlists will use this to add new
library paths to Ocarina.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I also take the opportunity to add in a generic lookup function to
convert a library path into a playlist.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This function is for both adding and removing tracks, and only returns
false. Tracks will only be added and removed through the update
function.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The pl_library_init() function is used to allocate a playlist for each
library path already in the database, and pl_library_deinit() is then
used to free this memory during cleanup.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>