void InputManager::UpdateName() { /* Update text, name and nowplaying */ QString name; /* Try to get the nowplaying */ char *format = var_InheritString( p_intf, "input-title-format" ); char *formatted = NULL; if (format != NULL) { formatted = vlc_strfinput( p_input, format ); free( format ); if( formatted != NULL ) { name = qfu(formatted); free( formatted ); } } /* If we have Nothing */ if( name.simplified().isEmpty() ) { char *uri = input_item_GetURI( input_GetItem( p_input ) ); char *file = uri ? strrchr( uri, '/' ) : NULL; if( file != NULL ) { vlc_uri_decode( ++file ); name = qfu(file); } else name = qfu(uri); free( uri ); } name = name.trimmed(); if( oldName != name ) { emit nameChanged( name ); oldName = name; } }
void VlcProc::update_current_input() { input_thread_t* pInput = getIntf()->p_sys->p_input; if( !pInput ) return; input_item_t *pItem = input_GetItem( pInput ); if( pItem ) { // Update short name (as defined by --input-title-format) char *psz_fmt = var_InheritString( getIntf(), "input-title-format" ); char *psz_name = NULL; if( psz_fmt != NULL ) { psz_name = vlc_strfinput( pInput, psz_fmt ); free( psz_fmt ); } SET_TEXT( m_cVarStreamName, UString( getIntf(), psz_name ? psz_name : "" ) ); free( psz_name ); // Update local path (if possible) or full uri char *psz_uri = input_item_GetURI( pItem ); char *psz_path = vlc_uri2path( psz_uri ); char *psz_save = psz_path ? psz_path : psz_uri; SET_TEXT( m_cVarStreamURI, UString( getIntf(), psz_save ) ); free( psz_path ); free( psz_uri ); // Update art uri char *psz_art = input_item_GetArtURL( pItem ); SET_STRING( m_cVarStreamArt, std::string( psz_art ? psz_art : "" ) ); free( psz_art ); } }