Commit 6f8690b5 authored by Eric Petit's avatar Eric Petit

beos/*:

  + fixed a possible crash with Alt+X shortcuts
  + fixed volume slider update
parent aab4bf7b
...@@ -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.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> * Authors: Tony Castley <tony@castley.net>
* Stephan Aßmus <stippi@yellowbites.com> * Stephan Aßmus <stippi@yellowbites.com>
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
/* VLC headers */ /* VLC headers */
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/intf.h> #include <vlc/intf.h>
extern "C"
{
#include <audio_output.h>
}
/* BeOS interface headers */ /* BeOS interface headers */
#include "VlcWrapper.h" #include "VlcWrapper.h"
...@@ -279,6 +283,10 @@ MediaControlView::Pulse() ...@@ -279,6 +283,10 @@ MediaControlView::Pulse()
InterfaceWindow* window = dynamic_cast<InterfaceWindow*>(Window()); InterfaceWindow* window = dynamic_cast<InterfaceWindow*>(Window());
if (window && window->IsStopped()) if (window && window->IsStopped())
fPlayPause->SetStopped(); fPlayPause->SetStopped();
unsigned short i_volume;
aout_VolumeGet( p_intf, (audio_volume_t*)&i_volume );
fVolumeSlider->SetValue( i_volume );
} }
// SetProgress // SetProgress
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method * vout_beos.cpp: beos video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * 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> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -349,39 +349,6 @@ VideoWindow::VideoWindow(int v_width, int v_height, BRect frame, ...@@ -349,39 +349,6 @@ VideoWindow::VideoWindow(int v_width, int v_height, BRect frame,
AddShortcut( '2', 0, new BMessage( RESIZE_100 ) ); AddShortcut( '2', 0, new BMessage( RESIZE_100 ) );
AddShortcut( '3', 0, new BMessage( RESIZE_200 ) ); 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(); _SetToSettings();
} }
...@@ -1249,7 +1216,7 @@ VLCView::MouseDown(BPoint where) ...@@ -1249,7 +1216,7 @@ VLCView::MouseDown(BPoint where)
menu->AddSeparatorItem(); menu->AddSeparatorItem();
// Windwo Feel Items // Window Feel Items
/* BMessage *winNormFeel = new BMessage(WINDOW_FEEL); /* BMessage *winNormFeel = new BMessage(WINDOW_FEEL);
winNormFeel->AddInt32("WinFeel", (int32_t)B_NORMAL_WINDOW_FEEL); winNormFeel->AddInt32("WinFeel", (int32_t)B_NORMAL_WINDOW_FEEL);
BMenuItem *normWindItem = new BMenuItem("Normal Window", winNormFeel); BMenuItem *normWindItem = new BMenuItem("Normal Window", winNormFeel);
...@@ -1366,9 +1333,9 @@ VLCView::Pulse() ...@@ -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 ) if( numBytes < 1 )
{ {
...@@ -1376,9 +1343,13 @@ void VLCView::KeyDown( const char *bytes, int32 numBytes ) ...@@ -1376,9 +1343,13 @@ void VLCView::KeyDown( const char *bytes, int32 numBytes )
} }
uint32_t mods = modifiers(); uint32_t mods = modifiers();
vlc_value_t val;
vlc_value_t val;
val.i_int = ConvertKeyToVLC( *bytes ); val.i_int = ConvertKeyToVLC( *bytes );
if( mods & B_COMMAND_KEY )
{
val.i_int |= KEY_MODIFIER_ALT;
}
if( mods & B_SHIFT_KEY ) if( mods & B_SHIFT_KEY )
{ {
val.i_int |= KEY_MODIFIER_SHIFT; val.i_int |= KEY_MODIFIER_SHIFT;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* VideoWindow.h: BeOS video window class prototype * VideoWindow.h: BeOS video window class prototype
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * 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> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au> * Tony Castley <tcastley@mail.powerup.com.au>
...@@ -117,7 +117,7 @@ class VLCView : public BView ...@@ -117,7 +117,7 @@ class VLCView : public BView
const BMessage* dragMessage); const BMessage* dragMessage);
virtual void Pulse(); virtual void Pulse();
virtual void Draw(BRect updateRect); virtual void Draw(BRect updateRect);
virtual void KeyDown(const char* bytes, int32 numBytes); virtual void KeyUp(const char* bytes, int32 numBytes);
private: private:
vout_thread_t *p_vout; vout_thread_t *p_vout;
......
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