Commit Graph

13 Commits

Author SHA1 Message Date
Anna Schumaker 4cdf4c528a audio: Implement our own about-to-finish handling
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>
2021-12-09 17:51:02 -05:00
Anna Schumaker 4f4e9efa28 audio: Set a ReplayGainSink as the playbin's audio sink
And create a rplaygain property that acts as a passthrough for
controlling the element.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-14 14:29:14 -04:00
Anna Schumaker d6a442277f audio: Clean up imports
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-08 10:07:46 -04:00
Anna Schumaker b95ad55c9a audio: Give the BassPlayer an artwork signal
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:46:29 -04:00
Anna Schumaker 08696dd17a audio: Give the BassPlayer signals for eos and about-to-finish
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:46:00 -04:00
Anna Schumaker e467b784e4 audio: Give the BassPlayer a play_percent property
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>
2021-09-07 14:46:00 -04:00
Anna Schumaker 51e8bc295d audio: Give the BassPlayer a volume property
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:46:00 -04:00
Anna Schumaker fa2cbcc261 audio: Give the BassPlayer a position property
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>
2021-09-07 14:45:42 -04:00
Anna Schumaker a4595eab93 audio: Give the BassPlayer a duration property
I also add a duration-changed signal so the seek scale can update its
range.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 14:45:42 -04:00
Anna Schumaker a4464cd7d9 audio: Give the BassPlayer a playing property
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>
2021-09-07 14:45:34 -04:00
Anna Schumaker c2c6ac7890 audio: Give the BassPlayer a uri property
With both setter and getter to change the playbin uri

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-06 10:48:03 -04:00
Anna Schumaker 574e49ef09 audio: Give the BassPlayer a bus property
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-04 08:33:15 -04:00
Anna Schumaker 990a8047d9 audio: Create a new BassPlayer class
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>
2021-09-04 08:32:14 -04:00