35 Commits

Author SHA1 Message Date
Bart De Vries
d1618943f5 Update based on review by Tobias Fella 2021-05-01 21:09:07 +02:00
Bart De Vries
6edbd91f18 Set setPreventSleep in play() and pause()
Making it toggle based on the playerState did not work properly because
the stream is toggling between pause and play several times in the
prepareAudioStream method.
2021-04-30 21:45:11 +02:00
Bart De Vries
cbf0d9c622 Comment out some qDebug() statements 2021-04-30 19:13:43 +02:00
Bart De Vries
ead73ac2fe Safeguard against QMediaPlayer::InvalidMedia
In case of the InvalidMedia status, skip to next track and delete the
invalid enclosure.
2021-04-30 11:57:39 +02:00
Bart De Vries
36ad248e55 Do some additional checks on entry before loading in AudioManager 2021-04-29 11:28:59 +02:00
Bart De Vries
51db7ea1cf Only use custom gst-pipeline on linux
GStreamer is not used as QMediaPlayer backend on other platforms, so
audio will not start with a custom gst-pipeline on Android and Windows.
Still needs a solution to get rid of the horrible pitch change on
Android and Windows, though.
2021-04-23 10:55:59 +02:00
Bart De Vries
e2d59a69b0 Move audio positioning hack into a separate method
This allows the hack to be re-used in the play() method.  Apparently on
some systems the stream becomes unresponsive again after pausing.  So
probably it's required to ensure that the stream is fully seekable and
buffered before restarting playback.
2021-04-22 16:48:13 +02:00
Bart De Vries
6c7a271970 Use custom gst-pipeline to avoid pitch changes when audio is sped up 2021-04-21 20:25:01 +02:00
Bart De Vries
7be1ed28ec Disable debug output in audiomanager 2021-04-21 14:53:03 +02:00
Bart De Vries
7a900b5921 Update enclosure duration if needed
If the duration that is mentioned in the enclosure doesn't correspond to
the real duration then update to the real duration in the database.
2021-04-21 14:53:03 +02:00
Bart De Vries
4fa45b0075 Save last playing track in database instead of config file 2021-04-21 14:53:03 +02:00
Bart De Vries
23b6b68500 Make sure that canGoNext is accurate when changing anything in queue 2021-04-21 14:53:02 +02:00
Bart De Vries
5f4a24a11d Refactor adding/removing to queue
All adding and removing should now go through the entry itself, using
queueStatus.
2021-04-21 14:53:02 +02:00
Bart De Vries
2e118d9a7e Make sure that canGoNext status is still accurate when queue items have been moved around 2021-04-21 14:53:02 +02:00
Bart De Vries
364dd52f9a Implement swipe to open/close miniplayer/full player 2021-04-21 14:53:02 +02:00
Bart De Vries
49baa7915b More elegant solution for setting MPRIS2 audio duration when changing tracks 2021-04-21 14:53:02 +02:00
Bart De Vries
a624040ef3 Make player robust against having no track loaded at end of queue 2021-04-21 14:53:02 +02:00
Bart De Vries
f85dbd0572 Remove episodes from queue once they've been fully played 2021-04-21 14:53:02 +02:00
Bart De Vries
b2ba953a33 Mark fully played episodes as read 2021-04-21 14:53:02 +02:00
Bart De Vries
32f01b03bd Enable next button in Player
This functionality has safeguards built in, including a canGoNext
property.
This can be extended with streaming playing in the future.
2021-04-21 14:53:02 +02:00
Bart De Vries
7c4658db2d Change implementation of seekable in AudioManager
We cannot simply pass on the value from the underlying QMediaPlayer,
since it is not reliable (see hacks concerning restoring startup player
position).  Instead we keep track of it ourselves and send out the
signal in the proper places.
2021-04-21 14:53:02 +02:00
Bart De Vries
21feef8ce0 Refactor to use skipForward and skipBackward
This is done to make the distinction between skipping time and changing
track.
2021-04-21 14:53:02 +02:00
Bart De Vries
791c25ad19 Use next() and previous() in PlayerControl
Also change to std::min and std::max for the implementation of next and
previous.
2021-04-21 14:53:02 +02:00
Bart De Vries
c7164b3f6b Refactor audiomanager to be closer to MPRIS2 interface 2021-04-21 14:53:02 +02:00
Bart De Vries
d9013ede9d Fix another issue with player startup position recovery 2021-04-21 14:53:02 +02:00
Bart De Vries
f626cee7af Fix saving last playing item when application is shutdown 2021-04-21 14:53:02 +02:00
Bart De Vries
593934bc4f Initial copy and adaptation of MPRIS2 from elisa (WIP)
This MPRIS2 implementation compiles without errors, but is not yet
instantiated within the application itself.
To be continued...
2021-04-21 14:53:02 +02:00
Bart De Vries
7e39d83f90 Restore last playing track on startup 2021-04-21 14:53:02 +02:00
Bart De Vries
f88fb22153 Finally implement restoring playback positions! 2021-04-21 14:53:02 +02:00
Bart De Vries
129707009c Implement the framework for custom audio starting position
What's still needed is the backend for saving the current position
and making the audio player aware of that position when the entry
is changed.
2021-04-21 14:53:02 +02:00
Bart De Vries
527ed67d4a Remove "source" property from audiomanager
Also rename the internal variables of audiomanager to be aligned
with the naming conventions used elsewhere.
2021-04-21 14:53:02 +02:00
Bart De Vries
d531b892e8 Adapt license headers of audiomanager 2021-04-21 14:53:02 +02:00
Bart De Vries
6b62ba2cf9 Add playbackrate capability to AudioManager 2021-04-21 14:53:02 +02:00
Bart De Vries
3aa4b836d2 Make PlayerManager work
Still one issue with the minimized player opening on startup
2021-04-21 14:53:02 +02:00
Bart De Vries
7d94792872 Add audiomanager and powermanagementinterface
Both classes are based on classes taken from Elisa.

The audiomanager class will be adapted to add functionality like saving
and restoring play positions and interfacing with MPRIS2.
2021-04-21 14:53:02 +02:00