]> git.sesse.net Git - vlc/blobdiff - plugins/beos/MediaControlView.cpp
Improved scaling, correct aspect ratio even in full screen mode.
[vlc] / plugins / beos / MediaControlView.cpp
index 243d925b480c5ce09ccb748e3e82e6a4877fc7d3..9ef461f19339e1eb7409fb3011454e5030117950 100644 (file)
@@ -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.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"
 }
 
@@ -147,13 +143,33 @@ 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 )
+    {
+    }
 }
 
 void MediaControlView::SetEnabled(bool enabled)
@@ -167,12 +183,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 +264,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;
 }