diff --git a/src/apps/mediaplayer/TransportControlGroup.cpp b/src/apps/mediaplayer/TransportControlGroup.cpp index 8f78af22a2..da55b27c5f 100644 --- a/src/apps/mediaplayer/TransportControlGroup.cpp +++ b/src/apps/mediaplayer/TransportControlGroup.cpp @@ -464,6 +464,13 @@ TransportControlGroup::SetPosition(float value, bigtime_t position, } +float +TransportControlGroup::Position() const +{ + return fSeekSlider->Position(); +} + + void TransportControlGroup::SetDisabledString(const char* string) { diff --git a/src/apps/mediaplayer/TransportControlGroup.h b/src/apps/mediaplayer/TransportControlGroup.h index 11cefb17ea..6b19f7878a 100644 --- a/src/apps/mediaplayer/TransportControlGroup.h +++ b/src/apps/mediaplayer/TransportControlGroup.h @@ -68,6 +68,7 @@ public: void SetVolume(float value); void SetPosition(float value, bigtime_t position, bigtime_t duration); + float Position() const; PeakView* GetPeakView() const { return fPeakView; } diff --git a/src/apps/mediaplayer/interface/SeekSlider.cpp b/src/apps/mediaplayer/interface/SeekSlider.cpp index b0e5fa58f6..e75ac4b719 100644 --- a/src/apps/mediaplayer/interface/SeekSlider.cpp +++ b/src/apps/mediaplayer/interface/SeekSlider.cpp @@ -299,6 +299,16 @@ SeekSlider::SetPosition(float position) } +float +SeekSlider::Position() const +{ + int32 range = fMaxValue - fMinValue; + if (range == 0) + return 0; + return (float)(Value() - fMinValue) / range; +} + + bool SeekSlider::IsTracking() const { diff --git a/src/apps/mediaplayer/interface/SeekSlider.h b/src/apps/mediaplayer/interface/SeekSlider.h index 2ac5af6a81..d8bad394e2 100644 --- a/src/apps/mediaplayer/interface/SeekSlider.h +++ b/src/apps/mediaplayer/interface/SeekSlider.h @@ -32,6 +32,7 @@ public: // SeekSlider void SetPosition(float position); + float Position() const; bool IsTracking() const; void SetDisabledString(const char* string);