Commit Graph

36 Commits

Author SHA1 Message Date
Anna Schumaker ba06eca07f audio: Switch to the Collection playlist if the current playlist has finished
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-09 17:51:02 -05:00
Anna Schumaker 594f7991f2 audio: Pick next track from the Previous playlist first
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>
2021-12-05 13:49:24 -05:00
Anna Schumaker 27ad8d72b4 audio: Pick the next track from the current playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-12-05 13:49:24 -05:00
Anna Schumaker 45b7f9595c audio: Give the Player a set_playlist() function
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>
2021-12-05 13:49:24 -05:00
Anna Schumaker 880f0a686b audio: Replace load_track() with change_track()
To mark tracks played and then emit the track-changed signal to start
the next track.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-18 16:49:58 -05:00
Anna Schumaker 97a05efe7e audio: Give the Player a play_track() function
To load and play a different track

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-11-18 16:49:58 -05:00
Anna Schumaker 6fc0fb6b26 audio: Create a new Selector object
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>
2021-09-30 11:07:20 -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 8efb752614 audio: Add support for gapless playback
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>
2021-09-08 10:07:46 -04:00
Anna Schumaker ba1a444bdf audio: Have the player handle Autopause adjustments
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>
2021-09-08 10:07:46 -04:00
Anna Schumaker 3a50235c38 audio: Rework the Artwork widget
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>
2021-09-08 10:07:45 -04:00
Anna Schumaker f55377cc69 audio: Remove the Player get_state() function
We can just check the playing property from the BasePlayer instead

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 15:55:11 -04:00
Anna Schumaker 8e509345bf audio: Clean up loading tracks
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 15:55:07 -04:00
Anna Schumaker 39794c0830 audio: Move play_track() out of the Player
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-07 15:55:03 -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
Anna Schumaker 76bf68f484 audio: Replace the old Controls widget with AudioControls
And grab the global Player instance during construction.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-02 16:26:58 -04:00
Anna Schumaker e4f6018195 audio: Replace the old Seeker widget with a ScaleButtonbox
And make the widget separate from the audio Player

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-09-02 16:15:43 -04:00
Anna Schumaker e884dc5a6e audio: Clean up the NowPlaying widget
It now uses the TrackTitle and TrackArtist labels. Additonally, I move
it out of the Player class and create a shortcut function for
instantiating one using the global Player instance

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-31 15:13:18 -04:00
Anna Schumaker 5c2e4bb016 audio: Convert the Player into a GObject
And give it "state-changed" and "track-changed" signals.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-30 17:30:55 -04:00
Anna Schumaker e24999bb2f audio: Give the Player a playpause() function
This makes it easy for others to pause if playing, or play if paused

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-08-02 10:25:00 -04:00
Anna Schumaker f78402f258 Rename trackdb -> tagdb
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-26 11:15:15 -04:00
Anna Schumaker b1ece1cd1d audio: Give Players a TrackChanged publisher
The playlist model can use this to make the current track bold

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:56:35 -04:00
Anna Schumaker 500d0757d1 audio: Add an Artwork object to the Player
And add it to the Sidebar box while we're at it

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:56:35 -04:00
Anna Schumaker 5633d50024 audio: Watch for EOS messages from the gstreamer bus
Mark the track as played if it has run for more than 2/3 of the running
time. Also check the "continue" field when choosing the next song from
the stack.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:56:17 -04:00
Anna Schumaker 878102a246 audio: Add the NowPlaying widgets to the player
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:56:17 -04:00
Anna Schumaker 4f43a3faf4 audio: Add a Seeker to the Player
And related functions needed for operation

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:56:17 -04:00
Anna Schumaker 7a042dd381 audio: Add Controls to the Player
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:56:17 -04:00
Anna Schumaker d29f4c1b47 audio: Save and restore the current track through the settings module
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:56:17 -04:00
Anna Schumaker 0fde1f58e2 audio: Add a Player class
I provide a way to load, play, and pause tracks. I also add functions
for picking the next and previous tracks from the tagdb.Stack

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
2021-07-23 12:56:17 -04:00