[vlc-devel] Re: window positioning

Sigmund Augdal sigmunau at stud.ntnu.no
Thu Mar 18 12:03:25 CET 2004


Try this:
var_Get( p_vout, "video-x", &val );
video_x = val.i_int;

The return value of var_Get is an indication of whether the call succeeded
or not.

Sigmund


On Thu, Mar 18, 2004 at 12:44:09PM +0100, Hornsby Adrian wrote:
> Here is what I've done.
> in the libvlc.h :
> 
> #define VIDEO_X_TEXT N_("Video-x")
> #define VIDEO_X_LONGTEXT N_( \
>     "You can define the position of the video window here - x parameter.")    
> 
> #define VIDEO_Y_TEXT N_("Video-y")
> #define VIDEO_Y_LONGTEXT N_( \
>     "You can define the position of the video window here - y parameter.")  
> 
> add_integer( "video-x", 0, NULL, VIDEO_X_TEXT, VIDEO_X_LONGTEXT, VLC_TRUE );
> add_integer( "video-y", 0, NULL, VIDEO_Y_TEXT, VIDEO_Y_LONGTEXT, VLC_TRUE );
> 
> then in the directx/events.c file :
> 
>  /*Add  variables to indicate the position of the video display */
>  var_Create( p_vout, "video-x", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
>  var_Create( p_vout, "video-y", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
>  int video_x = var_Get( p_vout, "video-x", &val );
>  int video_y = var_Get( p_vout, "video-y", &val );
> 
> followed by :
> 
> /* Create the window */
>         p_vout->p_sys->hwnd =
>             CreateWindow( "VLC DirectX",               /* name of window class */
>                     VOUT_TITLE " (DirectX Output)",   /* window title bar text */
>                     WS_OVERLAPPEDWINDOW | WS_SIZEBOX | WS_VISIBLE |
>                     WS_CLIPCHILDREN,                        /* window style */
>                     video_x,                                /* X coordinate */
>                     video_y,                                 /* Y coordinate */
>                     rect_window.right - rect_window.left,    /* window width */
>                     rect_window.bottom - rect_window.top,    /* window height */
>                     NULL,                                 /* no parent window */
>                     NULL,                            /* no menu in this window */
>                     hInstance,               /* handle of this program instance */
>                     (LPVOID)p_vout );             /* send p_vout to WM_CREATE */
> 
> 
> 
> >>>>>>>>> It compiles without error. I can also give the command line parameter --video-x 100 --video-y 300 !! BUT it doesn't effect on the position of the VLC player and it stays at the default position xy 0 0
> 
> Any clue ??
> 
> 
> 
> ************************************************************
> HORNSBY Adrian
> Teräskatu 7 D 67 
> 33720 Tampere
> FINLAND
> 
> #Tel :+358 (0)456376712
> http://www.students.tut.fi/~hornsby/
> ************************************************************

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list