当前位置: 首页>>代码示例>>C++>>正文


C++ VlcProc::getStreamNameVar方法代码示例

本文整理汇总了C++中VlcProc::getStreamNameVar方法的典型用法代码示例。如果您正苦于以下问题:C++ VlcProc::getStreamNameVar方法的具体用法?C++ VlcProc::getStreamNameVar怎么用?C++ VlcProc::getStreamNameVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VlcProc的用法示例。


在下文中一共展示了VlcProc::getStreamNameVar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: set

void VarText::set( const UString &rText )
{
    // Avoid an infinite loop
    if( rText == m_text )
    {
        return;
    }

    m_text = rText;

    if( m_substVars )
    {
        // Stop observing other variables
        delObservers();

        VlcProc *pVlcProc = VlcProc::instance( getIntf() );
        VarManager *pVarManager = VarManager::instance( getIntf() );

        // Observe needed variables
        if( m_text.find( "$H" ) != UString::npos )
        {
            pVarManager->getHelpText().addObserver( this );
        }
        if( m_text.find( "$T" ) != UString::npos ||
            m_text.find( "$t" ) != UString::npos ||
            m_text.find( "$L" ) != UString::npos ||
            m_text.find( "$l" ) != UString::npos ||
            m_text.find( "$D" ) != UString::npos ||
            m_text.find( "$d" ) != UString::npos )
        {
            pVlcProc->getTimeVar().addObserver( this );
        }
        if( m_text.find( "$V" ) != UString::npos )
        {
            pVlcProc->getVolumeVar().addObserver( this );
        }
        if( m_text.find( "$N" ) != UString::npos )
        {
            pVlcProc->getStreamNameVar().addObserver( this );
        }
        if( m_text.find( "$F" ) != UString::npos )
        {
            pVlcProc->getStreamURIVar().addObserver( this );
        }
        if( m_text.find( "$B" ) != UString::npos )
        {
            pVlcProc->getStreamBitRateVar().addObserver( this );
        }
        if( m_text.find( "$S" ) != UString::npos )
        {
            pVlcProc->getStreamSampleRateVar().addObserver( this );
        }
        if( m_text.find( "$R" ) != UString::npos )
        {
            pVlcProc->getSpeedVar().addObserver( this );
        }
    }

    notify();
}
开发者ID:0xheart0,项目名称:vlc,代码行数:60,代码来源:var_text.cpp

示例2: delObservers

void VarText::delObservers()
{
    // Stop observing other variables

    VlcProc *pVlcProc = getIntf()->p_sys->p_vlcProc;
    VarManager *pVarManager = getIntf()->p_sys->p_varManager;

    if( pVlcProc )
    {
        pVlcProc->getTimeVar().delObserver( this );
        pVlcProc->getVolumeVar().delObserver( this );
        pVlcProc->getSpeedVar().delObserver( this );
        pVlcProc->getStreamNameVar().delObserver( this );
        pVlcProc->getStreamURIVar().delObserver( this );
        pVlcProc->getStreamBitRateVar().delObserver( this );
        pVlcProc->getStreamSampleRateVar().delObserver( this );
    }

    if( pVarManager )
        pVarManager->getHelpText().delObserver( this );
}
开发者ID:0xheart0,项目名称:vlc,代码行数:21,代码来源:var_text.cpp

示例3: get

const UString VarText::get() const
{
    if( !m_substVars )
    {
        // Do not substitute "$X" variables
        return m_text;
    }

    uint32_t pos;
    VlcProc *pVlcProc = VlcProc::instance( getIntf() );

    // Fill a temporary UString object, and replace the escape characters
    // ($H for help, $T for current time, $L for time left, $D for duration,
    // $V for volume)
    UString temp( m_text );

    // $H is processed first, in case the help string contains other variables
    // to replace. And it is replaced only once, in case one of these other
    // variables is $H...
    if( (pos = temp.find( "$H" )) != UString::npos )
    {
        VarManager *pVarManager = VarManager::instance( getIntf() );
        temp.replace( pos, 2, pVarManager->getHelpText().get() );
    }
    while( (pos = temp.find( "$T" )) != UString::npos )
    {
        temp.replace( pos, 2,
                      pVlcProc->getTimeVar().getAsStringCurrTime().c_str() );
    }
    while( (pos = temp.find( "$t" )) != UString::npos )
    {
        temp.replace( pos, 2,
                      pVlcProc->getTimeVar().getAsStringCurrTime(true).c_str() );
    }
    while( (pos = temp.find( "$L" )) != UString::npos )
    {
        temp.replace( pos, 2,
                      pVlcProc->getTimeVar().getAsStringTimeLeft().c_str() );
    }
    while( (pos = temp.find( "$l" )) != UString::npos )
    {
        temp.replace( pos, 2,
                      pVlcProc->getTimeVar().getAsStringTimeLeft(true).c_str() );
    }
    while( (pos = temp.find( "$D" )) != UString::npos )
    {
        temp.replace( pos, 2,
                      pVlcProc->getTimeVar().getAsStringDuration().c_str() );
    }
    while( (pos = temp.find( "$d" )) != UString::npos )
    {
        temp.replace( pos, 2,
                      pVlcProc->getTimeVar().getAsStringDuration(true).c_str() );
    }
    while( (pos = temp.find( "$V" )) != UString::npos )
    {
        temp.replace( pos, 2,
                      pVlcProc->getVolumeVar().getAsStringPercent().c_str() );
    }
    while( (pos = temp.find( "$N" )) != UString::npos )
    {
        temp.replace( pos, 2, pVlcProc->getStreamNameVar().get() );
    }
    while( (pos = temp.find( "$F" )) != UString::npos )
    {
        temp.replace( pos, 2, pVlcProc->getStreamURIVar().get() );
    }
    while( (pos = temp.find( "$B" )) != UString::npos )
    {
        temp.replace( pos, 2, pVlcProc->getStreamBitRateVar().get() );
    }
    while( (pos = temp.find( "$S" )) != UString::npos )
    {
        temp.replace( pos, 2, pVlcProc->getStreamSampleRateVar().get() );
    }
    while( (pos = temp.find( "$R" )) != UString::npos )
    {
        temp.replace( pos, 2, pVlcProc->getSpeedVar().get() );
    }

    return temp;
}
开发者ID:0xheart0,项目名称:vlc,代码行数:82,代码来源:var_text.cpp


注:本文中的VlcProc::getStreamNameVar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。