Commit 65fd1e94 authored by Laurent Aimar's avatar Laurent Aimar

* use var_Set/Get "state"/"position"/"rate" instead of old functions.

  I haven't tested thoses changes ...
parent d53d9b9d
...@@ -121,8 +121,7 @@ void VlcWrapper::InputSetRate( int rate ) ...@@ -121,8 +121,7 @@ void VlcWrapper::InputSetRate( int rate )
{ {
return; return;
} }
var_SetInteger( p_input, "rate", rate );
input_SetRate( p_input, rate );
} }
BList * VlcWrapper::GetChannels( int i_cat ) BList * VlcWrapper::GetChannels( int i_cat )
...@@ -423,7 +422,7 @@ void VlcWrapper::PlaylistPause() ...@@ -423,7 +422,7 @@ void VlcWrapper::PlaylistPause()
{ {
if( p_input ) if( p_input )
{ {
input_SetStatus( p_input, INPUT_STATUS_PAUSE ); var_SetInteger( p_input, "state", PAUSE_S );
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* control.c : functions to handle stream control buttons. * control.c : functions to handle stream control buttons.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: control.c,v 1.1 2002/08/04 17:23:43 sam Exp $ * $Id$
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -118,7 +118,7 @@ gboolean GtkControlPause( GtkWidget *widget, ...@@ -118,7 +118,7 @@ gboolean GtkControlPause( GtkWidget *widget,
return FALSE; return FALSE;
} }
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE ); var_SetInteger( p_intf->p_sys->p_input, PAUSE_S );
return TRUE; return TRUE;
} }
...@@ -134,7 +134,7 @@ gboolean GtkControlSlow( GtkWidget *widget, ...@@ -134,7 +134,7 @@ gboolean GtkControlSlow( GtkWidget *widget,
return FALSE; return FALSE;
} }
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_SLOWER ); var_SetVoid( p_intf->p_sys->p_input, "rate-slower" );
return TRUE; return TRUE;
} }
...@@ -150,7 +150,7 @@ gboolean GtkControlFast( GtkWidget *widget, ...@@ -150,7 +150,7 @@ gboolean GtkControlFast( GtkWidget *widget,
return FALSE; return FALSE;
} }
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_FASTER ); var_SetVoid( p_intf->p_sys->p_input, "rate-faster" );
return TRUE; return TRUE;
} }
......
...@@ -463,11 +463,13 @@ static void Manage( intf_thread_t *p_intf ) ...@@ -463,11 +463,13 @@ static void Manage( intf_thread_t *p_intf )
{ {
if( newvalue >= 0. && newvalue < 100. ) if( newvalue >= 0. && newvalue < 100. )
{ {
off_t i_seek = ( newvalue * p_area->i_size ) / 100; double f_fpos = (double)newvalue / 100.0;
/* release the lock to be able to seek */
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
input_Seek( p_input, i_seek, INPUT_SEEK_SET ); var_SetFloat( p_input, "position", f_fpos );
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
} }
/* Update the old value */ /* Update the old value */
......
...@@ -476,11 +476,11 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -476,11 +476,11 @@ static int Manage( intf_thread_t *p_intf )
{ {
if( newvalue >= 0. && newvalue < 100. ) if( newvalue >= 0. && newvalue < 100. )
{ {
off_t i_seek = ( newvalue * p_area->i_size ) / 100; double f_fpos = (double)newvalue / 100.0;
/* release the lock to be able to seek */ /* release the lock to be able to seek */
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
input_Seek( p_input, i_seek, INPUT_SEEK_SET ); var_SetFloat( p_input, "position", f_fpos );
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
} }
......
...@@ -245,7 +245,7 @@ void GtkTitlePrev( GtkButton * button, gpointer user_data ) ...@@ -245,7 +245,7 @@ void GtkTitlePrev( GtkButton * button, gpointer user_data )
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
input_ChangeArea( p_intf->p_sys->p_input, p_area ); input_ChangeArea( p_intf->p_sys->p_input, p_area );
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); var_SetInteger( p_intf->p_sys->p_input, PLAYING_S );
p_intf->p_sys->b_title_update = VLC_TRUE; p_intf->p_sys->b_title_update = VLC_TRUE;
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
...@@ -272,7 +272,7 @@ void GtkTitleNext( GtkButton * button, gpointer user_data ) ...@@ -272,7 +272,7 @@ void GtkTitleNext( GtkButton * button, gpointer user_data )
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
input_ChangeArea( p_intf->p_sys->p_input, p_area ); input_ChangeArea( p_intf->p_sys->p_input, p_area );
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); var_SetInteger( p_intf->p_sys->p_input, PLAYING_S );
p_intf->p_sys->b_title_update = VLC_TRUE; p_intf->p_sys->b_title_update = VLC_TRUE;
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
...@@ -298,7 +298,7 @@ void GtkChapterPrev( GtkButton * button, gpointer user_data ) ...@@ -298,7 +298,7 @@ void GtkChapterPrev( GtkButton * button, gpointer user_data )
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
input_ChangeArea( p_intf->p_sys->p_input, p_area ); input_ChangeArea( p_intf->p_sys->p_input, p_area );
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); var_SetInteger( p_intf->p_sys->p_input, PLAYING_S );
p_intf->p_sys->b_chapter_update = VLC_TRUE; p_intf->p_sys->b_chapter_update = VLC_TRUE;
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
...@@ -324,7 +324,7 @@ void GtkChapterNext( GtkButton * button, gpointer user_data ) ...@@ -324,7 +324,7 @@ void GtkChapterNext( GtkButton * button, gpointer user_data )
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
input_ChangeArea( p_intf->p_sys->p_input, p_area ); input_ChangeArea( p_intf->p_sys->p_input, p_area );
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); var_SetInteger( p_intf->p_sys->p_input, PLAYING_S );
p_intf->p_sys->b_chapter_update = VLC_TRUE; p_intf->p_sys->b_chapter_update = VLC_TRUE;
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
...@@ -405,9 +405,8 @@ void GtkJumpOk( GtkButton *button, ...@@ -405,9 +405,8 @@ void GtkJumpOk( GtkButton *button,
i_seconds = GET_VALUE( "jump_second_spinbutton" ); i_seconds = GET_VALUE( "jump_second_spinbutton" );
#undef GET_VALUE #undef GET_VALUE
input_Seek( p_intf->p_sys->p_input, var_SetTime( p_intf->p_sys->p_input, "time",
i_seconds + 60 * i_minutes + 3600 * i_hours, (int64_t)(i_seconds+60*i_minutes+3600*i_hours)*I64C(1000000));
INPUT_SEEK_SECONDS | INPUT_SEEK_SET );
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* menu.c : functions to handle menu items. * menu.c : functions to handle menu items.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: menu.c,v 1.13 2003/12/22 14:32:56 sam Exp $ * $Id$
* *
* Authors: Sam Hocevar <sam@zoy.org> * Authors: Sam Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -186,7 +186,7 @@ void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem, ...@@ -186,7 +186,7 @@ void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem,
GtkSetupMenus( p_intf ); GtkSetupMenus( p_intf );
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); var_SetInteger( p_intf->p_sys->p_input, "state", PLAYING_S );
} }
} }
...@@ -210,7 +210,7 @@ void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem, ...@@ -210,7 +210,7 @@ void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem,
\ \
p_intf->p_sys->b_program_update = VLC_FALSE; \ p_intf->p_sys->b_program_update = VLC_FALSE; \
\ \
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); \ var_SetInteger( p_intf->p_sys->p_input, "state", PLAYING_S ); \
} }
void GtkMenubarProgramToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) void GtkMenubarProgramToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
...@@ -250,7 +250,7 @@ void GtkMenubarTitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) ...@@ -250,7 +250,7 @@ void GtkMenubarTitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock ); vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
p_intf->p_sys->b_title_update = VLC_FALSE; p_intf->p_sys->b_title_update = VLC_FALSE;
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); var_SetInteger( p_intf->p_sys->p_input, "state", PLAYING_S );
} }
} }
...@@ -289,7 +289,7 @@ void GtkMenubarChapterToggle( GtkCheckMenuItem * menuitem, gpointer user_data ) ...@@ -289,7 +289,7 @@ void GtkMenubarChapterToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
p_intf->p_sys->b_chapter_update = VLC_FALSE; p_intf->p_sys->b_chapter_update = VLC_FALSE;
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); var_SetInteger( p_intf->p_sys->p_input, "state", PLAYING_S );
} }
} }
......
...@@ -377,9 +377,8 @@ void KInterface::slotSliderMoved( int position ) ...@@ -377,9 +377,8 @@ void KInterface::slotSliderMoved( int position )
// XXX is this locking really useful ? // XXX is this locking really useful ?
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
off_t i_seek = ( position * p_intf->p_sys->p_input->stream.p_selected_area->i_size ) / 10000; var_SetFloat( p_intf->p_sys->p_input, "position",
input_Seek( p_intf->p_sys->p_input, i_seek, INPUT_SEEK_SET ); (double)position / 10000.0 );
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
} }
} }
...@@ -573,7 +572,7 @@ void KInterface::slotPlay() ...@@ -573,7 +572,7 @@ void KInterface::slotPlay()
{ {
if( p_intf->p_sys->p_input ) if( p_intf->p_sys->p_input )
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); var_SetInteger( p_intf->p_sys->p_input, "state", PLAYING_S );
} }
} }
...@@ -581,7 +580,7 @@ void KInterface::slotPause() ...@@ -581,7 +580,7 @@ void KInterface::slotPause()
{ {
if ( p_intf->p_sys->p_input ) if ( p_intf->p_sys->p_input )
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE ); var_SetInteger( p_intf->p_sys->p_input, "state", PAUSE_S );
} }
} }
...@@ -627,7 +626,7 @@ void KInterface::slotSlow() ...@@ -627,7 +626,7 @@ void KInterface::slotSlow()
{ {
if( p_intf->p_sys->p_input != NULL ) if( p_intf->p_sys->p_input != NULL )
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_SLOWER ); var_SetVoid( p_intf->p_sys->p_input, "rate-slower" );
} }
} }
...@@ -635,7 +634,7 @@ void KInterface::slotFast() ...@@ -635,7 +634,7 @@ void KInterface::slotFast()
{ {
if( p_intf->p_sys->p_input != NULL ) if( p_intf->p_sys->p_input != NULL )
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_FASTER ); var_SetVoid( p_intf->p_sys->p_input, "rate-faster" );
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* pda.c : PDA Gtk2 plugin for vlc * pda.c : PDA Gtk2 plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: pda.c,v 1.23 2004/03/03 20:39:52 gbazin Exp $ * $Id$
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* Marc Ariberti <marcari@videolan.org> * Marc Ariberti <marcari@videolan.org>
...@@ -468,11 +468,11 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -468,11 +468,11 @@ static int Manage( intf_thread_t *p_intf )
* finished dragging the slider */ * finished dragging the slider */
else if( p_intf->p_sys->b_slider_free ) else if( p_intf->p_sys->b_slider_free )
{ {
off_t i_seek = ( newvalue * p_area->i_size ) / 100; double f_pos = (double)newvalue / 100.0;
/* release the lock to be able to seek */ /* release the lock to be able to seek */
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
input_Seek( p_input, i_seek, INPUT_SEEK_SET ); var_SetFloat( p_input, "position", f_pos );
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
/* Update the old value */ /* Update the old value */
...@@ -502,11 +502,11 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -502,11 +502,11 @@ static int Manage( intf_thread_t *p_intf )
* finished dragging the slider */ * finished dragging the slider */
else if( p_intf->p_sys->b_slider_free ) else if( p_intf->p_sys->b_slider_free )
{ {
off_t i_seek = ( newvalue * p_area->i_size ) / 100; double f_pos = (double)newvalue / 100.0;
/* release the lock to be able to seek */ /* release the lock to be able to seek */
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
input_Seek( p_input, i_seek, INPUT_SEEK_SET ); var_SetFloat( p_input, "position", f_pos );
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
/* Update the old value */ /* Update the old value */
......
...@@ -356,7 +356,7 @@ void onRewind(GtkButton *button, gpointer user_data) ...@@ -356,7 +356,7 @@ void onRewind(GtkButton *button, gpointer user_data)
if (p_intf->p_sys->p_input != NULL) if (p_intf->p_sys->p_input != NULL)
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_SLOWER ); var_SetVoid( p_intf->p_sys->p_input, "rate-slower" );
} }
} }
...@@ -367,7 +367,7 @@ void onPause(GtkButton *button, gpointer user_data) ...@@ -367,7 +367,7 @@ void onPause(GtkButton *button, gpointer user_data)
if (p_intf->p_sys->p_input != NULL) if (p_intf->p_sys->p_input != NULL)
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE ); var_SetInteger( p_intf->p_sys->p_input, "state", PAUSE_S );
} }
} }
...@@ -415,7 +415,7 @@ void onForward(GtkButton *button, gpointer user_data) ...@@ -415,7 +415,7 @@ void onForward(GtkButton *button, gpointer user_data)
if (p_intf->p_sys->p_input != NULL) if (p_intf->p_sys->p_input != NULL)
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_FASTER ); var_SetVoid( p_intf->p_sys->p_input, "rate-faster" );
} }
} }
......
...@@ -370,9 +370,8 @@ void IntfWindow::Manage( void ) ...@@ -370,9 +370,8 @@ void IntfWindow::Manage( void )
* finished dragging the slider */ * finished dragging the slider */
else if( p_slider->b_free ) else if( p_slider->b_free )
{ {
off_t i_seek = ( i_value * p_area->i_size ) / SLIDER_MAX; double f_pos = (double)i_value / (double)SLIDER_MAX;
var_SetFloat( p_intf->p_sys->p_input, "position", f_pos );
input_Seek( p_intf->p_sys->p_input, i_seek, INPUT_SEEK_SET );
/* Update the old value */ /* Update the old value */
p_slider->setOldValue( i_value ); p_slider->setOldValue( i_value );
...@@ -400,7 +399,7 @@ void IntfWindow::PlaybackPlay( void ) ...@@ -400,7 +399,7 @@ void IntfWindow::PlaybackPlay( void )
{ {
if( p_intf->p_sys->p_input != NULL ) if( p_intf->p_sys->p_input != NULL )
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); var_SetInteger( p_intf->p_sys->p_input, "state", PLAYING_S );
} }
} }
...@@ -411,7 +410,7 @@ void IntfWindow::PlaybackPause( void ) ...@@ -411,7 +410,7 @@ void IntfWindow::PlaybackPause( void )
{ {
if( p_intf->p_sys->p_input != NULL ) if( p_intf->p_sys->p_input != NULL )
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE ); var_SetInteger( p_intf->p_sys->p_input, "state", PAUSE_S );
} }
} }
...@@ -422,7 +421,7 @@ void IntfWindow::PlaybackSlow( void ) ...@@ -422,7 +421,7 @@ void IntfWindow::PlaybackSlow( void )
{ {
if( p_intf->p_sys->p_input != NULL ) if( p_intf->p_sys->p_input != NULL )
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_SLOWER ); var_SetVoid( p_intf->p_sys->p_input, "rate-slower" );
} }
} }
...@@ -433,7 +432,7 @@ void IntfWindow::PlaybackFast( void ) ...@@ -433,7 +432,7 @@ void IntfWindow::PlaybackFast( void )
{ {
if( p_intf->p_sys->p_input != NULL ) if( p_intf->p_sys->p_input != NULL )
{ {
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_FASTER ); var_SetVoid( p_intf->p_sys->p_input, "rate-faster" );
} }
} }
......
...@@ -573,11 +573,7 @@ void VlcProc::MoveStream( long Pos ) ...@@ -573,11 +573,7 @@ void VlcProc::MoveStream( long Pos )
if( p_intf->p_sys->p_input == NULL ) if( p_intf->p_sys->p_input == NULL )
return; return;
off_t i_seek = (off_t)(Pos * var_SetFloat( p_intf->p_input, "position", (double)Pos / SLIDER_RANGE );
p_intf->p_sys->p_input->stream.p_selected_area->i_size
/ SLIDER_RANGE);
input_Seek( p_intf->p_sys->p_input, i_seek, INPUT_SEEK_SET );
// Refresh interface // Refresh interface
InterfaceRefresh(); InterfaceRefresh();
......
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