* 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.7 2001/12/30 07:09:54 sam Exp $
*
* Authors: Tony Castley <tony@castley.net>
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#include "defs.h"
/* System headers */
#include <InterfaceKit.h>
#include <AppKit.h>
+#include <string.h>
/* VLC headers */
extern "C"
{
-#include "config.h"
-#include "common.h"
-#include "threads.h"
-#include "mtime.h"
-#include "main.h"
-#include "tests.h"
+#include <videolan/vlc.h>
+
#include "stream_control.h"
#include "input_ext-intf.h"
+
#include "interface.h"
-#include "intf_msg.h"
#include "intf_playlist.h"
}
{
}
-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 )
+ {
+ }
}
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();
}
void SeekSlider::MouseDown(BPoint where)
{
BSlider::MouseDown(where);
+ seekTo = ValueForPoint(where);
fOwner->fScrubSem = create_sem(0, "Vlc::fScrubSem");
+ release_sem(fOwner->fScrubSem);
fMouseDown = true;
}