* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
-#include <stdlib.h> /* free() */
-#include <stdio.h>
-#include <string.h> /* strerror() */
#include <Application.h>
#include <BitmapStream.h>
#include <WindowScreen.h>
/* VLC headers */
-#include <vlc/vlc.h>
-#include <vlc/intf.h>
-#include <vlc/vout.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_interface.h>
+#include <vlc_vout.h>
#include <vlc_keys.h>
#include "InterfaceWindow.h" // for load/save_settings()
};
-#define MOUSE_IDLE_TIMEOUT 2000000 // two seconds
#define MIN_AUTO_VSYNC_REFRESH 61 // Hz
/*****************************************************************************
{
val.i_int |= KEY_MODIFIER_CTRL;
}
- var_Set( p_vout->p_vlc, "key-pressed", val );
+ var_Set( p_vout->p_libvlc, "key-pressed", val );
free( keys );
free( chars );
{
msg_Dbg( p_vout, "using single-buffered overlay" );
bitmap_count = 2;
- if( bitmap[2] ) { delete bitmap[2]; bitmap[2] = NULL; }
+ delete bitmap[2]; bitmap[2] = NULL;
}
}
else
{
msg_Dbg( p_vout, "using simple overlay" );
bitmap_count = 1;
- if( bitmap[1] ) { delete bitmap[1]; bitmap[1] = NULL; }
+ delete bitmap[1]; bitmap[1] = NULL;
}
break;
}
else
{
- if( bitmap[0] ) { delete bitmap[0]; bitmap[0] = NULL; }
+ delete bitmap[0]; bitmap[0] = NULL;
}
}
void
VideoWindow::_FreeBuffers()
{
- if( bitmap[0] ) { delete bitmap[0]; bitmap[0] = NULL; }
- if( bitmap[1] ) { delete bitmap[1]; bitmap[1] = NULL; }
- if( bitmap[2] ) { delete bitmap[2]; bitmap[2] = NULL; }
+ delete bitmap[0]; bitmap[0] = NULL;
+ delete bitmap[1]; bitmap[1] = NULL;
+ delete bitmap[2]; bitmap[2] = NULL;
fInitStatus = B_ERROR;
}
fIgnoreDoubleClick(false)
{
p_vout = p_vout_instance;
+ fMouseHideTimeout = var_GetInteger(p_vout, "mouse-hide-timeout") * 1000;
SetViewColor(B_TRANSPARENT_32_BIT);
}
BMenuItem *zoomItem = new BMenuItem(_("Fullscreen"), new BMessage(TOGGLE_FULL_SCREEN));
zoomItem->SetMarked(videoWindow->IsFullScreen());
menu->AddItem(zoomItem);
-
+
menu->AddSeparatorItem();
-
+
// Toggle vSync
BMenuItem *vsyncItem = new BMenuItem(_("Vertical Sync"), new BMessage(VERT_SYNC));
vsyncItem->SetMarked(videoWindow->IsSyncedToRetrace());
BMenuItem *aspectItem = new BMenuItem(_("Correct Aspect Ratio"), new BMessage(ASPECT_CORRECT));
aspectItem->SetMarked(videoWindow->CorrectAspectRatio());
menu->AddItem(aspectItem);
-
+
menu->AddSeparatorItem();
-
+
// 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);
normWindItem->SetMarked(videoWindow->Feel() == B_NORMAL_WINDOW_FEEL);
menu->AddItem(normWindItem);
-
+
BMessage *winFloatFeel = new BMessage(WINDOW_FEEL);
winFloatFeel->AddInt32("WinFeel", (int32_t)B_FLOATING_APP_WINDOW_FEEL);
BMenuItem *onTopWindItem = new BMenuItem("App Top", winFloatFeel);
onTopWindItem->SetMarked(videoWindow->Feel() == B_FLOATING_APP_WINDOW_FEEL);
menu->AddItem(onTopWindItem);
-
+
BMessage *winAllFeel = new BMessage(WINDOW_FEEL);
winAllFeel->AddInt32("WinFeel", (int32_t)B_FLOATING_ALL_WINDOW_FEEL);
BMenuItem *allSpacesWindItem = new BMenuItem("On Top All Workspaces", winAllFeel);
void
VLCView::MouseUp( BPoint where )
{
- vlc_value_t val;
- val.b_bool = VLC_TRUE;
- var_Set( p_vout, "mouse-clicked", val );
+ var_SetBool( p_vout, "mouse-clicked", true );
}
/*****************************************************************************
var_Set( p_vout, "mouse-x", val );
val.i_int = ( (int)point.y - i_y ) * p_vout->render.i_height / i_height;
var_Set( p_vout, "mouse-y", val );
- val.b_bool = VLC_TRUE;
+ val.b_bool = true;
var_Set( p_vout, "mouse-moved", val );
}
if (!fCursorHidden)
{
if (fCursorInside
- && mdate() - fLastMouseMovedTime > MOUSE_IDLE_TIMEOUT)
+ && mdate() - fLastMouseMovedTime > fMouseHideTimeout)
{
be_app->ObscureCursor();
fCursorHidden = true;
-
+
// hide the interface window as well if full screen
if (videoWindow && videoWindow->IsFullScreen())
videoWindow->SetInterfaceShowing(false);
}
// Workaround to disable the screensaver in full screen:
- // we simulate an activity every 29 seconds
+ // we simulate an activity every 29 seconds
if( videoWindow && videoWindow->IsFullScreen() &&
mdate() - fLastMouseMovedTime > 29000000 )
{
*****************************************************************************
* This function allocates and initializes a BeOS vout method.
*****************************************************************************/
-int E_(OpenVideo) ( vlc_object_t *p_this )
+int OpenVideo ( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
/* Allocate structure */
p_vout->p_sys = (vout_sys_t*) malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
- {
- msg_Err( p_vout, "out of memory" );
- return( 1 );
- }
+ return 1;
p_vout->p_sys->i_width = p_vout->render.i_width;
p_vout->p_sys->i_height = p_vout->render.i_height;
p_vout->p_sys->source_chroma = p_vout->render.i_chroma;
p_vout->output.i_chroma = colspace[p_vout->p_sys->p_window->colspace_index].chroma;
p_vout->p_sys->i_index = 0;
- p_vout->b_direct = 1;
-
p_vout->output.i_rmask = 0x00ff0000;
p_vout->output.i_gmask = 0x0000ff00;
p_vout->output.i_bmask = 0x000000ff;
*****************************************************************************
* Terminate an output method created by DummyCreateOutputMethod
*****************************************************************************/
-void E_(CloseVideo) ( vlc_object_t *p_this )
+void CloseVideo ( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
static int Control( vout_thread_t * p_vout, int i_query, va_list args )
{
- return vout_vaControlDefault( p_vout, i_query, args );
+ return VLC_EGENERIC;
}
/* following functions are local */