mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-06 12:25:10 +01:00
parent
1b8966b3a4
commit
c9caa7f034
@ -410,9 +410,13 @@ void Mpris2::AlbumCoverLoaded(const Song &song, const AlbumCoverLoaderResult &re
|
||||
|
||||
}
|
||||
|
||||
double Mpris2::Volume() const { return app_->player()->GetVolume() / 100.0; }
|
||||
double Mpris2::Volume() const {
|
||||
return app_->player()->GetVolume() / 100.0;
|
||||
}
|
||||
|
||||
void Mpris2::SetVolume(double value) { app_->player()->SetVolume(static_cast<int>(value * 100)); }
|
||||
void Mpris2::SetVolume(const double value) {
|
||||
app_->player()->SetVolume(static_cast<uint>(std::max(std::min(lround(value * 100.0), 100L), 0L)));
|
||||
}
|
||||
|
||||
qint64 Mpris2::Position() const {
|
||||
return app_->player()->engine()->position_nanosec() / kNsecPerUsec;
|
||||
|
@ -145,7 +145,7 @@ class Mpris2 : public QObject {
|
||||
void SetShuffle(bool enable);
|
||||
QVariantMap Metadata() const;
|
||||
double Volume() const;
|
||||
void SetVolume(double value);
|
||||
void SetVolume(const double value);
|
||||
qint64 Position() const;
|
||||
double MaximumRate() const;
|
||||
double MinimumRate() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user