Use system volume when possible

Fixes #1037
This commit is contained in:
Jonas Kvinge
2022-12-03 03:46:59 +01:00
parent 3a4199240e
commit b92ec71810
14 changed files with 203 additions and 129 deletions

View File

@@ -97,11 +97,11 @@ class Base : public QObject {
// Plays a media stream represented with the URL 'u' from the given 'beginning' to the given 'end' (usually from 0 to a song's length).
// Both markers should be passed in nanoseconds. 'end' can be negative, indicating that the real length of 'u' stream is unknown.
bool Play(const QUrl &stream_url, const QUrl &original_url, const TrackChangeFlags flags, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec, const quint64 offset_nanosec);
void SetVolume(const uint value);
static uint MakeVolumeLogarithmic(const uint volume);
void SetVolume(const uint volume);
public slots:
virtual void ReloadSettings();
void UpdateVolume(const uint volume);
protected:
void EmitAboutToEnd();
@@ -153,6 +153,8 @@ class Base : public QObject {
// Always use the state from event, because it's not guaranteed that immediate subsequent call to state() won't return a stale value.
void StateChanged(Engine::State);
void VolumeChanged(uint volume);
protected:
struct PluginDetails {