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>
I connect this in code so I can pass the column index as data to the
function, avoding the need for a "column index" lookup function.
I restore saved column widths during startup.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I decided to manually connect signals this time so I can pass sort
information instead of needing to look up the column index.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And rename the widget from "o_treeview" to just "treeview".
I wanted to rename gui/view.c to gui/treeview.c at some point. I
decided to gradually rework things into a new file to make it easier to
track progress.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This keeps the treepath conversions contained to the filter code when
finding paths to scroll to.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Right now filtering is split between queue.c and view.c, which can make
things somewhat complicated. I think this is a sign that we need a new
file to manage filtering.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Ocarina is moving in a playlist oriented direction, so move away from
using the queue directly in favor of using the playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This only needs to happen once, so let's do it when we initialize the
model rather than waiting for the first allocation.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is going to represent a playlist soon enough, so let's just name it
something more generic in case it ever has to change again.
Implements #87: Rename GuiQueueModel -> GuiModel
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is cleaner and easier than calling into the gtk builder directly.
I bumped up the window layer so other gui components can use it.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This fixes a problem with restoring treeview columns. Sometimes
"Played" gets allocated way too much space, so I solve this by changing
it's setting key to NULL so the column always gets whatever space is
leftover.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
One word labels are always better. I move the "Favorites" and "Hidden"
playlists under the "Playlists" header because they're manually
configured by the user.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The convention is for gtk builder files named with a ".ui" extension.
Let's rename our file to match, and drop the 6 while we're at it.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Most playlists don't allow changing this, and now that we have user
playlists it doesn't make sense to support repeating queued tracks.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The track tag doesn't need these tags now that they can be found in the
album tag.
Implements #64: Remove Artist and Genre pointers from Tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I need to disable filtering when adding artist playlists to avoid some
weird memory corruption issues.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
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>
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>
- 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>
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>
I think this is cleaner than having an upper layer allocate the results
set manually. This also lets me return NULL in the case that there were
no results.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I don't think it makes sense that callers of file_open() are expected to
check the file version after opening. This should be something handled
by the file code so we can print a consistent error message.
Implements issue #5: Better file versioning
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This function returns the average count of tracks that have been played,
and not the average count of all tracks.
Implements #29: Efficiently calculate average play count of tracks
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Let's save this disk access for when we're idle.
Implements #11: Load initial track through an idle task
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This patch adds support for changing a rows font face to bold for the
currently playing track. This should make it easier to find what track
is playing while quickly skimming through the list.
Fixes#22: Highlight the currently-playing song in the collection
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>