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:
parent
63400da873
commit
8e9973a09d
@ -464,6 +464,13 @@ TransportControlGroup::SetPosition(float value, bigtime_t position,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float
|
||||||
|
TransportControlGroup::Position() const
|
||||||
|
{
|
||||||
|
return fSeekSlider->Position();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TransportControlGroup::SetDisabledString(const char* string)
|
TransportControlGroup::SetDisabledString(const char* string)
|
||||||
{
|
{
|
||||||
|
@ -68,6 +68,7 @@ public:
|
|||||||
void SetVolume(float value);
|
void SetVolume(float value);
|
||||||
void SetPosition(float value, bigtime_t position,
|
void SetPosition(float value, bigtime_t position,
|
||||||
bigtime_t duration);
|
bigtime_t duration);
|
||||||
|
float Position() const;
|
||||||
|
|
||||||
PeakView* GetPeakView() const
|
PeakView* GetPeakView() const
|
||||||
{ return fPeakView; }
|
{ return fPeakView; }
|
||||||
|
@ -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
|
bool
|
||||||
SeekSlider::IsTracking() const
|
SeekSlider::IsTracking() const
|
||||||
{
|
{
|
||||||
|
@ -32,6 +32,7 @@ public:
|
|||||||
|
|
||||||
// SeekSlider
|
// SeekSlider
|
||||||
void SetPosition(float position);
|
void SetPosition(float position);
|
||||||
|
float Position() const;
|
||||||
bool IsTracking() const;
|
bool IsTracking() const;
|
||||||
void SetDisabledString(const char* string);
|
void SetDisabledString(const char* string);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user