This lets us create a new instance for each test we do, so we don't need
to keep resetting a single static instance.
Implements: #21 (Convert ui.pane.Pane into a class)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This moves the code out of ui/ and turns it into a class for easier
testing.
Implements: Issue #22 (Move Gtk.HeaderBar code into audio/)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
All sinks need to post the EOS message before the pipeline can pass it
on to our application. Using pad negotiation mode 2 means that the
message is only sent to the active path in the output selector, leaving
our application hanging waiting for the inactive path to post EOS as
well.
Fixes: #33 (Fix Autopause not resetting)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Again, we have to be careful not to check positions against playlists
where current == -1 for performance reasons.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We have to be careful not to check track positions against playlists
where current == -1, because this could drastically slow down adding new
tracks because SQLite would need to find the position for every track
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets us sort albums by original release date, so if an artist
releases multiple albums in a year we can sort by month too.
Additionally, this helps us better handle albums with the same name that
were released in different years.
Implements: #40 (Store the full date in the year table)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
previous_track() moves deeper into the previous tracks list while
next_track() moves us closer to the start. I also make sure we reset
current track when new tracks are added to the playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And add a get_current_track() function to make it easier to get the
currently selected track. Clamping behaves differently if random or loop
are enabled to ensure a track is still picked.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
So we can write the current playlist stateid to the settings file and
look it up later.
Implements: #36 (Find playlists based on playlist state id)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This keeps us from ever completely clearing the sort field in the
playlist state, since that would lead to an incomplete SQL query error.
Fixes: #38 (PlaylistStates should not allow completely clearing sort)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
So we can access the disc number when displaying tracks in the tracklist
Implements: Issue #34 (Give Discs a "number" property)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Adding a brief sleep when checking main_context iterations gives the
widget a chance to update the path so the test can pass more reliably.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
So users don't need to re-create their playlists when switching over to
the sqlite database.
Implements: #10 (Import user playlists)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
For enabling or disabling library paths through an idle task
Implements: Issue #37 (Create an Idle Task to enable / disable library paths)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
ProgressBars might be created after tasks have been pushed onto the
queue. Instead of setting initial visibility to False unconditionally,
we can check if queue length is greater than 1
Fixes: Issue #9 (Fix ProgressBar initial visibility)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
For displaying errors in the regex that the user has entered
Implements: Issue #4 (Create common filtering widgets)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We check for an exception coming from Regex.set_pattern(), and use it to
set or clear the "warning" css class to let the user know something is
wrong.
Implements: Issue #4 (Create common filtering widgets)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The intention is to have some common code that can be shared by both the
sidebar and the tracklist so they don't need to re-implement the same
things.
Implements: #4 (Create common filtering widgets)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
lib needs Gtk for some of its widgets, so do the import here to make
sure everything is configured properly. This prevents some warnings at
the very beginning of testing as well.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets us handle changes easier, since we'll catch them as they
happen. This lets us emit the "refreshed" signal when sorting changes,
for example.
Implements: Issue #32 (Passthrough PlaylistState properties)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
So the UI's Gio.ListModel can get the list of tracks when it is created,
instead of needing to look up individual tracks by index through a sql
query.
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The Collection playlist uses this to emit the "refreshed" signal to
notify higher layers that the contents of the playlist has changed.
Eventually, this will also be used to update playlists when sorting.
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And emit a "track-removed" signal to notify the higher layers.
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And emit a "track-added" signal to notify higher layers
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
So we can send an "items-changed" signal once Playlists have been
converted to a Gio.ListModel
Implements: Issue #3 (Sort playlists through SQLite)
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
For finding a single track at a given index into the select query
results, ordered by the configured sort order.
Implements: Issue #3 (Sort playlists through SQLite)
Implements: Issue #15 (Convert Playlists into Gio.ListModels)
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>