* skin-main.cpp: skins plugin for VLC
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.49 2003/10/15 12:24:14 gbazin Exp $
+ * $Id$
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
intf_thread_t *p_intf = (intf_thread_t *)p_this;
g_pIntf = p_intf;
+#if defined X11_SKINS
+ // Open/Test for an X11 display
+ Display *display = XOpenDisplay( NULL );
+ if( !display ) return VLC_EGENERIC;
+#endif
+
// Allocate instance and initialize some members
p_intf->p_sys = (intf_sys_t *) malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
p_intf->p_sys->i_index = -1;
p_intf->p_sys->i_size = 0;
+ p_intf->p_sys->b_on_top = false;
+
p_intf->p_sys->i_close_status = VLC_NOTHING;
p_intf->p_sys->p_input = NULL;
#if defined X11_SKINS
// Initialize X11
- Display *display = XOpenDisplay( NULL );
p_intf->p_sys->display = display;
vlc_mutex_init( p_intf, &p_intf->p_sys->xlock );
// Fake window to receive broadcast events
Window root = DefaultRootWindow( display );
- p_intf->p_sys->mainWin = XCreateSimpleWindow( display, root, 0, 0,
+ p_intf->p_sys->mainWin = XCreateSimpleWindow( display, root, 0, 0,
1, 1, 0, 0, 0 );
XStoreName( display, p_intf->p_sys->mainWin, "VLC Media Player" );
VLC_FALSE );
add_bool( "show_in_taskbar", VLC_TRUE, NULL, SKIN_TASKBAR,
SKIN_TASKBAR_LONG, VLC_FALSE );
- set_description( _("Skinnable Interface") );
+ set_description( _("Skinnable interface") );
set_capability( "interface", 30 );
set_callbacks( Open, Close );
set_program( "svlc" );
OSAPI_PostMessage( NULL, CTRL_SET_SLIDER,
(unsigned int)
p_intf->p_sys->p_theme->EvtBank->Get( "volume_refresh" ),
- (long)( volume * SLIDER_RANGE / AOUT_VOLUME_MAX ) );
+ (long)( volume * SLIDER_RANGE / (AOUT_VOLUME_DEFAULT * 2) ) );
// Refresh slider
// if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
- if( p_input->stream.b_seekable )
- {
#define p_area p_input->stream.p_selected_area
+ if( p_input->stream.b_seekable && p_area->i_size )
+ {
// Set value of sliders
- long Value = SLIDER_RANGE *
- p_input->stream.p_selected_area->i_tell /
- p_input->stream.p_selected_area->i_size;
+ long Value = SLIDER_RANGE * p_area->i_tell / p_area->i_size;
// Update sliders
OSAPI_PostMessage( NULL, CTRL_SET_SLIDER, (unsigned int)
p_intf->p_sys->p_theme->EvtBank->Get( "time" ), (long)Value );
// Text char * for updating text controls
- char *text = new char[OFFSETTOTIME_MAX_SIZE];
+ char *text = new char[MSTRTIME_MAX_SIZE];
+
+ int64_t i_seconds, i_length;
+
+ i_seconds = var_GetTime( p_intf->p_sys->p_input, "time" ) / I64C(1000000 );
+ i_length = var_GetTime( p_intf->p_sys->p_input, "length" ) / I64C(1000000 );
+
+ secstotimestr( psz_time, i_seconds );
// Create end time text
- input_OffsetToTime( p_intf->p_sys->p_input, &text[1],
- p_area->i_size - p_area->i_tell );
+ secstotimestr( &text[1], i_length - i_seconds );
text[0] = '-';
p_intf->p_sys->p_theme->EvtBank->Get( "left_time" )
->PostTextMessage( text );
// Create time text and update
- input_OffsetToTime( p_intf->p_sys->p_input, text, p_area->i_tell );
+ secstotimestr( text, i_seconds );
p_intf->p_sys->p_theme->EvtBank->Get( "time" )
->PostTextMessage( text );
// Create total time text
- input_OffsetToTime( p_intf->p_sys->p_input, text, p_area->i_size );
+ secstotimestr( text, i_length );
p_intf->p_sys->p_theme->EvtBank->Get( "total_time" )
->PostTextMessage( text );