[vlc-devel] commit: skins2: fix playlist not displaying cuurent playing item correctly (Erwan Tulou )

git version control git at videolan.org
Sat Feb 13 16:33:58 CET 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Sat Feb 13 16:02:45 2010 +0100| [39852e8bdf8734f341f20d60617adf913f187adc] | committer: Erwan Tulou 

skins2: fix playlist not displaying cuurent playing item correctly

This patch
  - ensure that current playing item is properly detected
  - deactivate item changes since it is wrongly implemented
    (i_id from input_item_t and playlist_item_t are compared,
     which is wrong)

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

 modules/gui/skins2/src/vlcproc.cpp |   40 ++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index 40a9bdf..1c501c8 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -268,12 +268,14 @@ int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
                            vlc_value_t oldval, vlc_value_t newval,
                            void *pParam )
 {
+    // TODO: FIXME
+    // Deactivated because it mixes up i_id from input_item_t
+    // and i_id from playlist_item_t
+#if 0
+
     VlcProc *pThis = (VlcProc*)pParam;
     input_item_t *p_item = static_cast<input_item_t*>(newval.p_address);
 
-    // Update the stream variable
-    pThis->updateStreamName();
-
     // Create a playtree notify command
     CmdPlaytreeUpdate *pCmdTree = new CmdPlaytreeUpdate( pThis->getIntf(),
                                                          p_item->i_id );
@@ -282,6 +284,8 @@ int VlcProc::onItemChange( vlc_object_t *pObj, const char *pVariable,
     AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
     pQueue->push( CmdGenericPtr( pCmdTree ), true );
 
+#endif
+
     return VLC_SUCCESS;
 }
 
@@ -445,24 +449,28 @@ int VlcProc::onGenericCallback( vlc_object_t *pObj, const char *pVariable,
     return VLC_SUCCESS;
 }
 
+#define SET_BOOL(m,v)         ((VarBoolImpl*)(m).get())->set(v)
+#define SET_STREAMTIME(m,v,b) ((StreamTime*)(m).get())->set(v,b)
+#define SET_TEXT(m,v)         ((VarText*)(m).get())->set(v)
+#define SET_VOLUME(m,v,b)     ((Volume*)(m).get())->set(v,b)
+
 void VlcProc::on_item_current_changed( vlc_object_t* p_obj, vlc_value_t newVal )
 {
     input_item_t *p_item = static_cast<input_item_t*>(newVal.p_address);
 
-    // Update the stream variable
-    updateStreamName();
+    // Update short name
+    char *psz_name = input_item_GetName( p_item );
+    SET_TEXT( m_cVarStreamName, UString( getIntf(), psz_name ) );
+    free( psz_name );
 
-    // Create a playtree notify command
-    AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
-    CmdPlaytreeUpdate *pCmdTree =
-            new CmdPlaytreeUpdate( getIntf(), p_item->i_id );
-    pQueue->push( CmdGenericPtr( pCmdTree ) , true );
-}
+    // Update full uri
+    char *psz_uri = input_item_GetURI( p_item );
+    SET_TEXT( m_cVarStreamURI, UString( getIntf(), psz_uri ) );
+    free( psz_uri );
 
-#define SET_BOOL(m,v)         ((VarBoolImpl*)(m).get())->set(v)
-#define SET_STREAMTIME(m,v,b) ((StreamTime*)(m).get())->set(v,b)
-#define SET_TEXT(m,v)         ((VarText*)(m).get())->set(v)
-#define SET_VOLUME(m,v,b)     ((Volume*)(m).get())->set(v,b)
+    // Update playtree
+    getPlaytreeVar().onUpdateCurrent();
+}
 
 void VlcProc::on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal )
 {
@@ -734,6 +742,8 @@ void VlcProc::reset_input()
     SET_BOOL( m_cVarPaused, false );
 
     SET_STREAMTIME( m_cVarTime, 0, false );
+    SET_TEXT( m_cVarStreamName, UString( getIntf(), "") );
+    SET_TEXT( m_cVarStreamURI, UString( getIntf(), "") );
     SET_TEXT( m_cVarStreamBitRate, UString( getIntf(), "") );
     SET_TEXT( m_cVarStreamSampleRate, UString( getIntf(), "") );
 }




More information about the vlc-devel mailing list