We have a find_playlist() function, so let's stick with a more generic
notification name so we don't have to repeat a lot of code.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Now that we push row_added notifications into the main thread, we can
enable this optimization that makes the treeview more efficient.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Reset is used to make testing a little easier, since we won't have to
manually set set everything up again during each setUp function.
Stop is used to stop the library thread before shutdown.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Keeping this as a class that can never be instantiated seems like
overkill when we could just use plain functions.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This eases up some of the work on the UI side, since we don't need to
spend time trying to figure out where the track is in the playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Gtk really doesn't like notifications coming from other threads, so we
need to handle notifications from the main thread through an idle task.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Gtk really doesn't like updates coming from outside of the main thread,
so let's add a way to register callbacks that can be queued up and run
later.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We could put a lot of effort into deleting all the rows and resetting
them, but it's easier just to clear the model and set it again.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I noticed that I was getting some unexpected behavior due to the global
Audio class still running in parallel with my testing class. This patch
fixes that by adding an easy disconnect function for signals, and also
implements some other improvements to waiting for state changes.
Additionally, I added a check to see if we have already set the
playbin's "uri" property before picking the next track when calling
next().
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This playlist is designed to hold all the tracks that have been selected
for playback, and iterate through them backwards if needed.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We still fix the value, but if we ever add extra handling in the base
class then we'll be able to catch it.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This doesn't change which playlist is currently playing music, but it
does change which one the user sees.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Selecting a playlist during scanning caused a segmentation fault so I
had to push row-changed signals into the main thread through the use of
an idle task.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And change the GtkPaned widget to have a small handle. This sets the
division between the playlist manager and the playlist to a single line,
which I think looks really slick
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is a small detail, but I like the idea of having an indicator when
tracks are loaded or not.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We use this to load the next track without changing the pipeline state,
which should give us smoother audio switching.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The common setup and tear down code helps keep everything in sync.
Additionally, we no longer need to wait for duration changes, which have
always been unreliable.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This helps us prepare for the about-to-finish signal by setting this
information when gstreamer starts playing the next track.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We don't have a reason to set this anything other than True, so let's
just automatically start playing the track. Additionally, change the
playbin to READY instead of NULL to help playback start a little faster.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I put a smaller progress bar into the header area that users can use for
seeking or checking the current position. I also add two labels to show
time played and time remaining in the current track.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Users might have images or ripping logs mixed in with their tracks, so
let's make sure we don't crash if we try to scan one of these.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets me control size and justification of the text. Additionally, I
put everything into a scrolled window just in case a track has a really
long title name.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I switch around the sidebar icons again, and also make the header bar
icons larger to make them easier to press with touchscreens
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Library paths are directories on disk, so it makes sense to use the
folder-music icon to represent them.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I'll eventually make this more complex when I add in more playlists, but
for now it just calls next on the Collection playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Converting between a TreeIter and a playlist is very useful, so
implement that functionality now.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Some tracks in my library aren't formatted as expected, so let's improve
our parsing code to better handle integers.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>