This fixes a bug where a different track would be selected when hitting
"Play" after an autopause
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The playbin's about-to-finish signal triggers in a different thread,
which Gtk is very much not happy about, and often results in both the
about-to-finish and eos handlers getting called (and therefore multiple
tracks getting picked from the queue).
Fix this by checking how much time is left during the regular position
changed timeout function and triggering about-to-finish manually
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets us move up and down the Previous playlist through the buttons,
in case we go back too far by accident.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
With a callback to notify when the current playlist changes.
Additionally, I make sure to reset playlist.current if the playlist has
previously finished playing.
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>
This is used to query for the next or previous track. The Playlist layer
will implement our playlist stack as one of these objects, and set it on
the Player
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The Gtk.MenuButton doesn't have the same issue with staying "pressed in"
after changing replaygain settings that our custom version does.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I use output-switcher and funnel elements so we can disable the
replaygain plugins by routing the stream around them if necessary.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
By responding to the about-to-finish signal. If it looks like we're
about to pause, then we let the EOS handler handle it instead.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Putting this in the playlist layer was an experiment, but it's easier to
do from the Player now that we've abstracted out all the Gstreamer stuff
into the BassClass
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
It now sets artwork based on the signals sent by the player, allowing us
to move it out of the Player class and create instances based on the
global Player instead.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
For calculating what percentage of a song has been played, which is used
to determine if a track can be marked as played or not
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I use the state change callbacks to send a position-changed signal on a
regular interval when playback is going. Seeking is handled by setting
the position property to a new value.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
To set either Gst.State.PLAYING or Gst.State.PAUSED on the playbin. I
also add two signals for playback-start and playback-paused that the
PlayPause button can use.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
My intention is to use this to handle GStreamer stuff so I can separate
out the higher level functions like next(), previous(), and load_track()
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This mimics the behavior of the Gtk.MenuButton(), except it allows
updating the ToggleButton child widget with the current autopause count.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>