Commit Graph

3428 Commits

Author SHA1 Message Date
Anna Schumaker 3d85f0fdc5 Ocarina 6.4.18
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-28 10:08:10 -04:00
Anna Schumaker 1633946981 core/file: Check if a file is too new to be opened
I'm hitting this problem while developing 6.5, since file formats are
going to change.  Let's handle this situation gracefully rather than
segfaulting.

This patch changes versioning problems into fatal errors to prevent us
from overwriting data already on disk.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-28 10:07:27 -04:00
Anna Schumaker 3806577154 gui/playlists: Add artist playlists when they are created
We only need to do this after Ocarina init has completed, otherwise
artist playlists will be added twice.

Fixes #79: Artist playlists not updated when tracks are added
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-28 09:48:12 -04:00
Anna Schumaker a430c5b117 core/playlists/artist: Add artist playlists as artists are added
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>
2016-08-28 09:46:16 -04:00
Anna Schumaker 3d31349cca gui/playlist: Random state isn't saved when random button is clicked
We were calling the queue function directly, rather than passing through
the playlist layer.  This means random state isn't saved when the button
is clicked and Ocarina is closed.

Fixes #78: Call playlist_set_random() when clicking random button
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-28 09:06:33 -04:00
Anna Schumaker f855eaea58 gui/collection: Run FileChooserDialog on startup
But only if the library database is empty.  This patch also changes the
prompt of the dialog to "Add Music" so users know what is going on.

Fixes #80: Pop up FileChooserDialog the first time Ocarina is run
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-16 13:38:58 -04:00
Anna Schumaker 5964c508ce core/playlists/artists: Load each playlist with a different idle task
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>
2016-08-13 09:50:24 -04:00
Anna Schumaker 73b33e9718 gui: UI spacing improvements
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-13 09:49:21 -04:00
Anna Schumaker f3360f6da5 Ocarina 6.4.18-rc
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-13 09:07:26 -04:00
Anna Schumaker 9733b82ae8 core/collection: Remove file
I have replaced everything in this file with the code in
core/playlists/library.c

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker bddbd04ef5 gui: Remove stack widget
It isn't needed now that we pop up a file choose dialog for selecting
library paths.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker b3476e15e9 gui/collection: Remove unused collection code
And the now unused sidebar widget.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 73c70678bb gui/collection: add button for adding library paths
This is easier than responding to events from the treeview.  Let's just
pop up a dialog and let the user select from there, rather than doing
something complicated with a stack.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 62e1b27b6c gui/playlist: Add support for deleting playlists
System playlists cannot be deleted, but library playlists can.  Deleting
a library playlist removes the library and associated tracks from the database.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 382ee79c2e gui/playlist: Add artist playlists to the playlist sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker f2597a8e6c gui/playlist: Add library playlists to the playlist sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 8abc45b1ae gui/playlist: Store the playlist type in the sidebar treemodel
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 871bf88b94 gui/queue: Store playlist in the gui queue
I'll need to know the playlist type to set artist information properly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker f70b2b940f core/playlists/artist: Add basic artist operations
For now, hidden tracks are shown in artist queues.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 24448aefec core/playlists/artist: Add tracks to the artist playlists
I use a single idle task to scan the track database and add to the
appropriate playlist.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 12ae7cfee6 core/playlists/artist: Add pl_artist_{init, deinit}() functions
The pl_artist_init() function is used to allocate a playlist for each
artist already in the database, and pl_artist_deinit() is then used to
free up this memory during cleanup.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 11430f89cf core/playlists/library: Add pl_library_update() function
This is called to find and add new tracks to the library.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker e1a722d04b core/playlists/library: Adding a library starts a directory scan
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker c448db2665 core/playlists: Add playlist_{new, delete}() functions
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>
2016-08-13 08:31:30 -04:00
Anna Schumaker 78aa0f9ff6 core/playlists/library: Add pl_library_sort() function
Used to sort library playlists.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 7f867199cb core/playlists/library: Add pl_library_set_flag() function
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>
2016-08-13 08:31:30 -04:00
Anna Schumaker 1599897fbf core/playlists/library: Add pl_library_add_rm() function
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>
2016-08-13 08:31:30 -04:00
Anna Schumaker c5a0a3470e core/playlists/library: Add pl_library_get_queue() function
Called to access the track queue associated with the given playlist.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 4d5569ef7a core/playlists/library: Add tracks to library playlists
This needs to happen in an idle task since the track database is loaded
when idle.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 261f6d91d7 core/playlists/library: Add pl_library_{init, deinit}() functions
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>
2016-08-13 08:31:30 -04:00
Anna Schumaker e4930704a2 core/playlists/system: Add pl_system_delete_track()
Called to remove a track from all system playlists.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 03ed7c4b84 core/playlists/system: Add pl_system_new_track()
Called to tell system playlists that a new track has been added to the
database.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 20e0a85a5d core/tags/artist: Add an artist_db_get() function
This will be called to scan the artist database when setting up
playlists.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker b3922cc731 core/tags/artist: Add an artist_lookup() function
For looking up artist tags without allocating a new one.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker e41f554b2e core/tags/artist: Add a pointer to store a playlist
Similar to the library tag, this is a void pointer that should only be
used by the playlist layer.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 938bbc92f2 core/tags/library: Add a library_lookup() function
I want a way to lookup library paths without allocating new ones, so
let's add this now.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 6e02f75262 core/tags/library: Add a pointer to store a playlist
I decided to set this as a void pointer to keep other layers from using
the playlist without our knowledge.  The only user of this variable
should be the playlist code.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker cfeca9ae4b core/playlist: Add playlist_type enum
I'm going to use this to distinguish between various playlist types that
are about to be added.  Let's update the playlist functions first, and
then add more types in a future patch.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-08-13 08:31:30 -04:00
Anna Schumaker 6019f07bd3 Ocarina 6.4.17
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-13 08:27:55 -04:00
Anna Schumaker 004d4578d4 gui/queue: Set gq_queue->gq_search to NULL after freeing
Otherwise we can attempt to free the search text again when the queue is
destroyed.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-13 08:26:00 -04:00
Anna Schumaker 085701ad9d gui/queue: Set gq_queue->gq_visible to NULL after destroying
Otherwise the existance check will still pass the next time
__queue_filter() is called, and we will attempt to destroy it again.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-13 08:21:22 -04:00
Anna Schumaker f7e9e8b321 gui/queue: Remember search text when switching queues
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>
2016-08-10 07:31:03 -04:00
Anna Schumaker 44a6ad0d78 gui/playlist: Make sure we free text from tree_model_get()
Otherwise this leads to a memory leak.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-08-01 12:06:25 -04:00
Anna Schumaker e578e0e6dd Ocarina 6.4.17-rc
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-29 17:09:39 -04:00
Anna Schumaker 34447007f9 core/history: Remove unused queue
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:09:38 -04:00
Anna Schumaker 5a54fb69b6 core/collection: Remove unused queue
And remove collection_ops from the core initdata

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:09:33 -04:00
Anna Schumaker dc07d637f6 gui/history: Remove unused gui queue code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00
Anna Schumaker 64fc5a9a0d gui/collection: Remove unused gui queue code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00
Anna Schumaker 15ed068e13 gui/playlist: Select Collection playlist during startup
This preserves the original behavior, where the collection is always
selected from the beginning.  This can be improved upon later, once
queued tracks are implemented as a playlist.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2016-07-29 17:06:06 -04:00
Anna Schumaker 696173b03e gui/playlist: Add Collection and History playlists to the sidebar
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-29 17:06:06 -04:00