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 @@ ...@@ -2,7 +2,7 @@
* MediaControlView.cpp: beos interface * MediaControlView.cpp: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * 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> * Authors: Tony Castley <tony@castley.net>
* *
...@@ -147,13 +147,34 @@ void MediaControlView::MessageReceived(BMessage *message) ...@@ -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) 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) void MediaControlView::SetEnabled(bool enabled)
...@@ -167,12 +188,12 @@ void MediaControlView::SetEnabled(bool enabled) ...@@ -167,12 +188,12 @@ void MediaControlView::SetEnabled(bool enabled)
p_seek->SetEnabled(enabled); p_seek->SetEnabled(enabled);
} }
int32 MediaControlView::GetSeekTo() uint32 MediaControlView::GetSeekTo()
{ {
return p_seek->seekTo; return p_seek->seekTo;
} }
int32 MediaControlView::GetVolume() uint32 MediaControlView::GetVolume()
{ {
return p_vol->Value(); return p_vol->Value();
} }
...@@ -248,7 +269,9 @@ SeekSlider::~SeekSlider() ...@@ -248,7 +269,9 @@ SeekSlider::~SeekSlider()
void SeekSlider::MouseDown(BPoint where) void SeekSlider::MouseDown(BPoint where)
{ {
BSlider::MouseDown(where); BSlider::MouseDown(where);
seekTo = ValueForPoint(where);
fOwner->fScrubSem = create_sem(0, "Vlc::fScrubSem"); fOwner->fScrubSem = create_sem(0, "Vlc::fScrubSem");
release_sem(fOwner->fScrubSem);
fMouseDown = true; fMouseDown = true;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* MediaControlView.h: beos interface * MediaControlView.h: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * 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> * Authors: Tony Castley <tony@castley.net>
* *
...@@ -36,12 +36,12 @@ public: ...@@ -36,12 +36,12 @@ public:
~MediaControlView(); ~MediaControlView();
virtual void MessageReceived(BMessage *message); virtual void MessageReceived(BMessage *message);
void SetProgress(float position); void SetProgress(uint64 seek, uint64 size);
void SetStatus(int status, int rate); void SetStatus(int status, int rate);
void SetEnabled(bool); void SetEnabled(bool);
int32 GetSeekTo(); uint32 GetSeekTo();
int32 GetVolume(); uint32 GetVolume();
sem_id fScrubSem; sem_id fScrubSem;
bool fSeeking; bool fSeeking;
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
thumb_style thumbType = B_TRIANGLE_THUMB); thumb_style thumbType = B_TRIANGLE_THUMB);
~SeekSlider(); ~SeekSlider();
int32 seekTo; uint32 seekTo;
virtual void MouseDown(BPoint); virtual void MouseDown(BPoint);
virtual void MouseUp(BPoint pt); virtual void MouseUp(BPoint pt);
virtual void MouseMoved(BPoint pt, uint32 c, const BMessage *m); 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