+int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable,
+ vlc_value_t oldVal, vlc_value_t newVal,
+ void *pParam )
+{
+ VlcProc *pThis = (VlcProc*)pParam;
+ interaction_dialog_t *p_dialog = (interaction_dialog_t *)(newVal.p_address);
+
+ CmdInteraction *pCmd = new CmdInteraction( pThis->getIntf(), p_dialog );
+ AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
+ pQueue->push( CmdGenericPtr( pCmd ) );
+ return VLC_SUCCESS;
+}
+
+
+void VlcProc::updateStreamName( playlist_t *p_playlist )
+{
+ if( p_playlist->p_input )
+ {
+ VarText &rStreamName = getStreamNameVar();
+ VarText &rStreamURI = getStreamURIVar();
+ // XXX: we should not need to access p_input->psz_source directly, a
+ // getter should be provided by VLC core
+ string name = p_playlist->p_input->input.p_item->psz_name;
+ // XXX: This should be done in VLC core, not here...
+ // Remove path information if any
+ OSFactory *pFactory = OSFactory::instance( getIntf() );
+ string::size_type pos = name.rfind( pFactory->getDirSeparator() );
+ if( pos != string::npos )
+ {
+ name = name.substr( pos + 1, name.size() - pos + 1 );
+ }
+ UString srcName( getIntf(), name.c_str() );
+ UString srcURI( getIntf(),
+ p_playlist->p_input->input.p_item->psz_uri );
+
+ // Create commands to update the stream variables
+ CmdSetText *pCmd1 = new CmdSetText( getIntf(), rStreamName, srcName );
+ CmdSetText *pCmd2 = new CmdSetText( getIntf(), rStreamURI, srcURI );
+ // Push the commands in the asynchronous command queue
+ AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
+ pQueue->push( CmdGenericPtr( pCmd1 ), false );
+ pQueue->push( CmdGenericPtr( pCmd2 ), false );
+ }
+}
+