And stores it for future reference, so we don't have to keep looking up
current and previous playlists.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I think "lookup" is a better name for this function, since it's similar
to performing a dictionary lookup.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Additionally, playlist_set_random() uses a playlist-level function
pointer to decide what to do. In most cases this will simply toggle the
flag, but the history playlist does not support random playback.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than going through playlist-type operations. Additionally, I
take this opportunity to change playlist_remove() to take a playlist
struct directly.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
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>
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>
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 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>
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>
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>
This code is obsolete now that the sidebar handles setting the random
button when playlists are changed.
Implements #76: Remove struct gui_queue
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This function scans through the treestore at the current level, without
descending into children. This is because we frequently know what
category playlists are under when searching for a child, so it makes
sense to find that first.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Called to access the GtkPaned widget. I also rename the widget
"sidebar" to match the new convention.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Otherwise we may try to use the gstreamer playbin after destroying it,
leading to various error messages showing up in the console.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Otherwise we'll get a message saying that either the filter or the
treeview is not a GtkTreeModel
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>