Commit b1c218b2 authored by Tony Castley's avatar Tony Castley

Fixed Slider overflow and slider behaviour.

Also corrected the button status behavour.
parent ee860753
......@@ -2,7 +2,7 @@
* MediaControlView.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MediaControlView.cpp,v 1.1 2001/06/15 09:07:10 tcastley Exp $
* $Id: MediaControlView.cpp,v 1.2 2001/09/12 01:31:37 tcastley Exp $
*
* Authors: Tony Castley <tony@castley.net>
*
......@@ -147,13 +147,34 @@ void MediaControlView::MessageReceived(BMessage *message)
{
}
void MediaControlView::SetProgress(float position)
void MediaControlView::SetProgress(uint64 seek, uint64 size)
{
p_seek->SetValue(position);
p_seek->SetPosition((float)seek/size);
}
void MediaControlView::SetStatus(int status, int rate)
{
switch( status )
{
case PLAYING_S:
case FORWARD_S:
case BACKWARD_S:
case START_S:
p_play->SetPlaying();
break;
case PAUSE_S:
p_play->SetPaused();
break;
case UNDEF_S:
case NOT_STARTED_S:
default:
p_play->SetStopped();
break;
}
if ( rate < DEFAULT_RATE )
{
intf_Msg("Fastler Rate: %d", rate);
}
}
void MediaControlView::SetEnabled(bool enabled)
......@@ -167,12 +188,12 @@ void MediaControlView::SetEnabled(bool enabled)
p_seek->SetEnabled(enabled);
}
int32 MediaControlView::GetSeekTo()
uint32 MediaControlView::GetSeekTo()
{
return p_seek->seekTo;
}
int32 MediaControlView::GetVolume()
uint32 MediaControlView::GetVolume()
{
return p_vol->Value();
}
......@@ -248,7 +269,9 @@ SeekSlider::~SeekSlider()
void SeekSlider::MouseDown(BPoint where)
{
BSlider::MouseDown(where);
seekTo = ValueForPoint(where);
fOwner->fScrubSem = create_sem(0, "Vlc::fScrubSem");
release_sem(fOwner->fScrubSem);
fMouseDown = true;
}
......
......@@ -2,7 +2,7 @@
* MediaControlView.h: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MediaControlView.h,v 1.1 2001/06/15 09:07:10 tcastley Exp $
* $Id: MediaControlView.h,v 1.2 2001/09/12 01:31:37 tcastley Exp $
*
* Authors: Tony Castley <tony@castley.net>
*
......@@ -36,12 +36,12 @@ public:
~MediaControlView();
virtual void MessageReceived(BMessage *message);
void SetProgress(float position);
void SetProgress(uint64 seek, uint64 size);
void SetStatus(int status, int rate);
void SetEnabled(bool);
int32 GetSeekTo();
int32 GetVolume();
uint32 GetSeekTo();
uint32 GetVolume();
sem_id fScrubSem;
bool fSeeking;
......@@ -80,7 +80,7 @@ public:
thumb_style thumbType = B_TRIANGLE_THUMB);
~SeekSlider();
int32 seekTo;
uint32 seekTo;
virtual void MouseDown(BPoint);
virtual void MouseUp(BPoint pt);
virtual void MouseMoved(BPoint pt, uint32 c, const BMessage *m);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment