QApplication::postEvent( im, event );
return VLC_SUCCESS;
}
+
static int VbiEvent( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void *param )
{
InputManager *im = (InputManager*)param;
IMEvent *event = new IMEvent( ItemTeletextChanged_Type, 0 );
- if( event )
- QApplication::postEvent( im, event );
+ QApplication::postEvent( im, event );
return VLC_SUCCESS;
}
/* User togglePlayPause */
void InputManager::togglePlayPause()
{
- vlc_value_t state;
if( hasInput() )
{
- var_Get( p_input, "state", &state );
- state.i_int = ( state.i_int != PLAYING_S ) ? PLAYING_S : PAUSE_S;
- var_Set( p_input, "state", state );
- emit statusChanged( state.i_int );
+ int state = var_GetInteger( p_input, "state" );
+ state = ( state != PLAYING_S ) ? PLAYING_S : PAUSE_S;
+ var_SetInteger( p_input, "state", state );
+ emit statusChanged( state );
}
}
if( hasInput() )
{
int i_type = var_Type( p_input, "next-chapter" );
- vlc_value_t val; val.b_bool = true;
- var_Set( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
- "prev-chapter":"prev-title", val );
+ var_SetVoid( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
+ "prev-chapter":"prev-title" );
}
}
if( hasInput() )
{
int i_type = var_Type( p_input, "next-chapter" );
- vlc_value_t val; val.b_bool = true;
- var_Set( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
- "next-chapter":"next-title", val );
+ var_SetVoid( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
+ "next-chapter":"next-title" );
}
}
if( hasInput() )
{
vlc_value_t val, text;
- vlc_value_t root;
if( var_Change( p_input, "title 0", VLC_VAR_GETLIST, &val, &text ) < 0 )
return;
/* XXX is it "Root" or "Title" we want here ?" (set 0 by default) */
- root.i_int = 0;
+ int root = 0;
for( int i = 0; i < val.p_list->i_count; i++ )
{
if( !strcmp( text.p_list->p_values[i].psz_string, "Title" ) )
- root.i_int = i;
+ root = i;
}
var_Change( p_input, "title 0", VLC_VAR_FREELIST, &val, &text );
- var_Set( p_input, "title 0", root );
+ var_SetInteger( p_input, "title 0", root );
}
}
int i_interval = config_GetInt( p_input, "short-jump-size" );
if( i_interval > 0 )
{
- vlc_value_t val;
- val.i_time = (mtime_t)(i_interval) * 1000000L;
- var_Set( p_input, "time-offset", val );
+ mtime_t val = (mtime_t)(i_interval) * 1000000L;
+ var_SetTime( p_input, "time-offset", val );
}
}
int i_interval = config_GetInt( p_input, "short-jump-size" );
if( i_interval > 0 )
{
- vlc_value_t val;
- val.i_time = -1 *(mtime_t)(i_interval) * 1000000L;
- var_Set( p_input, "time-offset", val );
+ mtime_t val = -1 *(mtime_t)(i_interval) * 1000000L;
+ var_SetTime( p_input, "time-offset", val );
}
}
/* Should be PLItemChanged Event */
if( !p_intf->p_sys->b_isDialogProvider )
{
- vlc_mutex_lock( &p_intf->change_lock );
if( p_input && ( p_input->b_dead || !vlc_object_alive (p_input) ) )
{
emit inputChanged( p_input );
var_DelCallback( p_input, "state", PLItemChanged, this );
vlc_object_release( p_input );
p_input = NULL;
- vlc_mutex_unlock( &p_intf->change_lock );
return;
}
emit inputChanged( p_input );
}
}
- vlc_mutex_unlock( &p_intf->change_lock );
}
else
{
+ /* remove previous stored p_input */
+ if( p_input )
+ {
+ vlc_object_release( p_input );
+ p_input = NULL;
+ }
/* we are working as a dialogs provider */
playlist_t *p_playlist = pl_Hold( p_intf );
p_input = playlist_CurrentInput( p_playlist );
if( p_input )
{
emit inputChanged( p_input );
- vlc_object_release( p_input );
}
pl_Release( p_intf );
}