Added easy method to retrieve the playback position (of the seek slider [0..1]).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36417 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-04-22 15:28:39 +00:00
parent 63400da873
commit 8e9973a09d
4 changed files with 19 additions and 0 deletions

View File

@ -464,6 +464,13 @@ TransportControlGroup::SetPosition(float value, bigtime_t position,
}
float
TransportControlGroup::Position() const
{
return fSeekSlider->Position();
}
void
TransportControlGroup::SetDisabledString(const char* string)
{

View File

@ -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; }

View File

@ -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
{

View File

@ -32,6 +32,7 @@ public:
// SeekSlider
void SetPosition(float position);
float Position() const;
bool IsTracking() const;
void SetDisabledString(const char* string);