Rather than going through playlist-type operations. Additionally, I
take this opportunity to change playlist_add() to take a playlist struct
directly.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than going through the playlist-type operations. Additionally, I
take this opportunity to change playlist_delete() to take a playlist
struct directly.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is much more useful than a boolean status, since we can use the
playlist pointer right away.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
It's frequently useful to get the playlist directly, rather than looking
up type and name first. Let's add a function to do just that!
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This pointer can be used immediately by testing code instead of simply
looking at the return status.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is useful for user playlists so they can store their playlist-id
directly, letting us remove the entire playlist_get_id() function.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This flag was only used by the History playlist, but we have a noop
function to handle this instead.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Otherwise we could end up changing the random setting on the previous
playlist when displaying a new one.
Fixes#106: Switching playlists clears random setting
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I cleaned up several of the functions and added tests for making sure
everything is set correctly.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This patch also adds a unit test checking that the image is initialized
properly. In addition, I simplify things by changing the image widget
to be a direct child of the GtkButton.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This keeps all the audio operations together, and matches how we define
operations structs throughout the rest of Ocarina.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This code is obsolete now that gui/playlist.c handles keypress and
right-click events on the main treeview.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This function isn't easy to test without knowledge of screen
coordinates, so I didn't include a unit test this time.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Looks like this wasn't happening automatically, so let's be sure to
update the previous playlist's row after selecting a new playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Putting this code in a new file helps make gui/playlist.c less complex,
and better matches the organization of files in core/
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Finding the header first makes a lot of sense, and avoids iterating
through every playlist while trying to find the library playlist to
update.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This functionality needs to be tested better. I can't really test the
dialog, since it runs in the main thread, but I can test adding library
paths with the selected directory.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>