[vlc-devel] commit: QT4: connect signal from inputmanager metaChanged to playlist-model so it updates item . (Ilkka Ollakka )

git version control git at videolan.org
Sun Feb 15 12:57:50 CET 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Feb 15 13:51:06 2009 +0200| [394a9e2c128f34c183a2c4d9b7efc5ca5679afa7] | committer: 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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=394a9e2c128f34c183a2c4d9b7efc5ca5679afa7
---

 .../gui/qt4/components/playlist/playlist_model.cpp |   11 +++++++++++
 .../gui/qt4/components/playlist/playlist_model.hpp |    1 +
 src/input/event.c                                  |    5 ++++-
 3 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 4cb8c2c..eb1d55c 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -528,6 +528,14 @@ void PLModel::customEvent( QEvent *event )
         rebuild();
 }
 
+void PLModel::updateMeta ( input_item_t *p_item )
+{
+    if( p_item )
+    {
+        ProcessInputItemUpdate( p_item->i_id );
+    }
+}
+
 /**** Events processing ****/
 void PLModel::ProcessInputItemUpdate( int i_input_id )
 {
@@ -623,6 +631,9 @@ void PLModel::rebuild( playlist_item_t *p_root )
     /* And signal the view */
     emit layoutChanged();
     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 */
diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index 2dcaccb..1057e2f 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -178,6 +178,7 @@ private slots:
     void popupSave();
     void popupExplore();
     void viewchanged( int );
+    void updateMeta( input_item_t * );
 };
 
 #endif
diff --git a/src/input/event.c b/src/input/event.c
index 9224478..9fde713 100644
--- a/src/input/event.c
+++ b/src/input/event.c
@@ -69,9 +69,12 @@ void input_SendEventTimes( input_thread_t *p_input,
     val.i_time = i_time;
     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 )
+    {
         input_item_SetDuration( p_input->p->p_item, i_length );
+        input_SendEventMeta( p_input );
+    }
     val.i_time = i_length;
     var_Change( p_input, "length", VLC_VAR_SETVALUE, &val, NULL );
 




More information about the vlc-devel mailing list