]> git.sesse.net Git - vlc/commitdiff
beos/*:
authorEric Petit <titer@videolan.org>
Sun, 28 Dec 2003 01:49:12 +0000 (01:49 +0000)
committerEric Petit <titer@videolan.org>
Sun, 28 Dec 2003 01:49:12 +0000 (01:49 +0000)
  + fixed a possible crash with Alt+X shortcuts
  + fixed volume slider update

modules/gui/beos/MediaControlView.cpp
modules/gui/beos/VideoOutput.cpp
modules/gui/beos/VideoWindow.h

index 9aba3b7ae6cc0775ee56bbd53ee1426709c8be65..481c59b5ac432770fe638f8602390f6d4df99785 100644 (file)
@@ -2,7 +2,7 @@
  * MediaControlView.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: MediaControlView.cpp,v 1.20 2003/09/07 22:53:09 fenrir Exp $
+ * $Id: MediaControlView.cpp,v 1.21 2003/12/28 01:49:12 titer Exp $
  *
  * Authors: Tony Castley <tony@castley.net>
  *          Stephan Aßmus <stippi@yellowbites.com>
 /* VLC headers */
 #include <vlc/vlc.h>
 #include <vlc/intf.h>
+extern "C"
+{
+  #include <audio_output.h>
+}
 
 /* BeOS interface headers */
 #include "VlcWrapper.h"
@@ -279,6 +283,10 @@ MediaControlView::Pulse()
        InterfaceWindow* window = dynamic_cast<InterfaceWindow*>(Window());
        if (window && window->IsStopped())
                        fPlayPause->SetStopped();
+
+    unsigned short i_volume;
+    aout_VolumeGet( p_intf, (audio_volume_t*)&i_volume );
+    fVolumeSlider->SetValue( i_volume );
 }
 
 // SetProgress
index 23fd0c4fd9b199e4774b64e564a9934d19c6027e..4fae241ea9f2d9e00b914804acf9f4b4a57aabda 100644 (file)
@@ -2,7 +2,7 @@
  * vout_beos.cpp: beos video output display method
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: VideoOutput.cpp,v 1.28 2003/12/22 11:14:25 titer Exp $
+ * $Id: VideoOutput.cpp,v 1.29 2003/12/28 01:49:12 titer Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -349,39 +349,6 @@ VideoWindow::VideoWindow(int v_width, int v_height, BRect frame,
     AddShortcut( '2', 0, new BMessage( RESIZE_100 ) );
     AddShortcut( '3', 0, new BMessage( RESIZE_200 ) );
 
-    // workaround to have Alt+X shortcuts working
-    BMessage * message;
-    for( unsigned i = 1; /* skip KEY_UNSET */
-         i < sizeof( vlc_keys ) / sizeof( key_descriptor_t ); i++ )
-    {
-        /* Alt+X */
-        message = new BMessage( SHORTCUT );
-        message->AddInt32( "key", vlc_keys[i].i_key_code | KEY_MODIFIER_ALT );
-        AddShortcut( ConvertKeyFromVLC( vlc_keys[i].i_key_code ),
-                     0, message );
-
-        /* Alt+Shift+X */
-        message = new BMessage( SHORTCUT );
-        message->AddInt32( "key", vlc_keys[i].i_key_code |
-                KEY_MODIFIER_ALT | KEY_MODIFIER_SHIFT );
-        AddShortcut( ConvertKeyFromVLC( vlc_keys[i].i_key_code ),
-                     B_SHIFT_KEY, message );
-
-        /* Alt+Ctrl+X */
-        message = new BMessage( SHORTCUT );
-        message->AddInt32( "key", vlc_keys[i].i_key_code |
-                KEY_MODIFIER_ALT | KEY_MODIFIER_CTRL );
-        AddShortcut( ConvertKeyFromVLC( vlc_keys[i].i_key_code ),
-                     B_CONTROL_KEY, message );
-
-        /* Alt+Shift+Ctrl+X */
-        message = new BMessage( SHORTCUT );
-        message->AddInt32( "key", vlc_keys[i].i_key_code |
-                KEY_MODIFIER_ALT | KEY_MODIFIER_SHIFT | KEY_MODIFIER_CTRL );
-        AddShortcut( ConvertKeyFromVLC( vlc_keys[i].i_key_code ),
-                     B_SHIFT_KEY | B_CONTROL_KEY, message );
-    }
-
     _SetToSettings();
 }
 
@@ -1249,7 +1216,7 @@ VLCView::MouseDown(BPoint where)
        
                                menu->AddSeparatorItem();
        
-                               // Windwo Feel Items
+                               // Window Feel Items
 /*                             BMessage *winNormFeel = new BMessage(WINDOW_FEEL);
                                winNormFeel->AddInt32("WinFeel", (int32_t)B_NORMAL_WINDOW_FEEL);
                                BMenuItem *normWindItem = new BMenuItem("Normal Window", winNormFeel);
@@ -1366,9 +1333,9 @@ VLCView::Pulse()
 }
 
 /*****************************************************************************
- * VLCVIew::KeyDown
+ * VLCVIew::KeyUp
  *****************************************************************************/
-void VLCView::KeyDown( const char *bytes, int32 numBytes )
+void VLCView::KeyUp( const char *bytes, int32 numBytes )
 {
     if( numBytes < 1 )
     {
@@ -1376,9 +1343,13 @@ void VLCView::KeyDown( const char *bytes, int32 numBytes )
     }
 
     uint32_t mods = modifiers();
-    vlc_value_t val;
 
+    vlc_value_t val;
     val.i_int = ConvertKeyToVLC( *bytes );
+    if( mods & B_COMMAND_KEY )
+    {
+        val.i_int |= KEY_MODIFIER_ALT;
+    }
     if( mods & B_SHIFT_KEY )
     {
         val.i_int |= KEY_MODIFIER_SHIFT;
index 6453d4fd72efc7facb20d5686f1aee1fffd601a4..077c754931adfcaa1185cf1d0f0b391f749f6cb9 100644 (file)
@@ -2,7 +2,7 @@
  * VideoWindow.h: BeOS video window class prototype
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: VideoWindow.h,v 1.10 2003/12/22 11:14:25 titer Exp $
+ * $Id: VideoWindow.h,v 1.11 2003/12/28 01:49:12 titer Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Tony Castley <tcastley@mail.powerup.com.au>
@@ -117,7 +117,7 @@ class VLCView : public BView
                                                                           const BMessage* dragMessage);
        virtual void                    Pulse();
        virtual void                    Draw(BRect updateRect);
-       virtual void                    KeyDown(const char* bytes, int32 numBytes);
+       virtual void                    KeyUp(const char* bytes, int32 numBytes);
 
  private:
             vout_thread_t   *p_vout;