本文整理汇总了C++中VlcProc::getStreamURIVar方法的典型用法代码示例。如果您正苦于以下问题:C++ VlcProc::getStreamURIVar方法的具体用法?C++ VlcProc::getStreamURIVar怎么用?C++ VlcProc::getStreamURIVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VlcProc
的用法示例。
在下文中一共展示了VlcProc::getStreamURIVar方法的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();
}
示例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 );
}
示例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;
}