Commit 394a9e2c authored by Ilkka Ollakka's avatar Ilkka Ollakka

QT4: connect signal from inputmanager metaChanged to playlist-model so it updates item.

input: send inputEvent when length if input changes

This one should fix #2435
parent da62a8be
...@@ -528,6 +528,14 @@ void PLModel::customEvent( QEvent *event ) ...@@ -528,6 +528,14 @@ void PLModel::customEvent( QEvent *event )
rebuild(); rebuild();
} }
void PLModel::updateMeta ( input_item_t *p_item )
{
if( p_item )
{
ProcessInputItemUpdate( p_item->i_id );
}
}
/**** Events processing ****/ /**** Events processing ****/
void PLModel::ProcessInputItemUpdate( int i_input_id ) void PLModel::ProcessInputItemUpdate( int i_input_id )
{ {
...@@ -623,6 +631,9 @@ void PLModel::rebuild( playlist_item_t *p_root ) ...@@ -623,6 +631,9 @@ void PLModel::rebuild( playlist_item_t *p_root )
/* And signal the view */ /* And signal the view */
emit layoutChanged(); emit layoutChanged();
addCallbacks(); addCallbacks();
/* Connect item update for metachanges */
CONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
this, updateMeta( input_item_t *) );
} }
/* This function must be entered WITH the playlist lock */ /* This function must be entered WITH the playlist lock */
......
...@@ -178,6 +178,7 @@ private slots: ...@@ -178,6 +178,7 @@ private slots:
void popupSave(); void popupSave();
void popupExplore(); void popupExplore();
void viewchanged( int ); void viewchanged( int );
void updateMeta( input_item_t * );
}; };
#endif #endif
...@@ -69,9 +69,12 @@ void input_SendEventTimes( input_thread_t *p_input, ...@@ -69,9 +69,12 @@ void input_SendEventTimes( input_thread_t *p_input,
val.i_time = i_time; val.i_time = i_time;
var_Change( p_input, "time", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "time", VLC_VAR_SETVALUE, &val, NULL );
/* FIXME ugly + what about meta change event ? */ /* FIXME ugly */
if( var_GetTime( p_input, "length" ) != i_length ) if( var_GetTime( p_input, "length" ) != i_length )
{
input_item_SetDuration( p_input->p->p_item, i_length ); input_item_SetDuration( p_input->p->p_item, i_length );
input_SendEventMeta( p_input );
}
val.i_time = i_length; val.i_time = i_length;
var_Change( p_input, "length", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "length", VLC_VAR_SETVALUE, &val, NULL );
......
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