本文整理汇总了C++中Meter::setMax方法的典型用法代码示例。如果您正苦于以下问题:C++ Meter::setMax方法的具体用法?C++ Meter::setMax怎么用?C++ Meter::setMax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Meter
的用法示例。
在下文中一共展示了Meter::setMax方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setMaxValue
void DiskSensor::setMaxValue( SensorParams *sp )
{
Meter *meter;
meter = sp->getMeter();
const TQString mntPt = sp->getParam( "MOUNTPOINT" );
TQString f;
f = sp->getParam("FORMAT");
if( f == "%fp" || f == "%up" )
meter->setMax( 100 );
else
meter->setMax( getTotalSpace( mntPt ) / 1024 );
}
示例2: setMaxValue
void XMMSSensor::setMaxValue( SensorParams *sp)
{
Meter *meter;
meter = sp->getMeter();
QString f;
f = sp->getParam("FORMAT");
if ( f == "%full" )
meter->setMax( 1 );
}
示例3: update
void NoatunSensor::update()
{
TQString format;
SensorParams *sp;
Meter *meter;
TQObjectListIt it( *objList );
TQString title;
int songLength = 0;
int currentTime = 0;
bool running = isRunning();
if( running )
{
title = getTitle();
if( title.isEmpty() )
title = "Noatun";
currentTime = getTime();
if( currentTime == -1 )
currentTime = 0;
songLength = getLength();
if( songLength == -1 )
songLength = 0;
}
while (it != 0)
{
sp = (SensorParams*)(*it);
meter = sp->getMeter();
if( running )
{
format = sp->getParam("FORMAT");
if (format.length() == 0 )
{
format = "%title %time / %length";
}
if( format.lower() == "%ms" )
{
meter->setMax( songLength );
meter->setValue( currentTime );
}
else
if ( format.lower() == "%full" )
{
meter->setValue( 1 );
}
else
{
format.replace( TQRegExp("%title", false), title );
format.replace( TQRegExp("%id", false), noatunID );
format.replace( TQRegExp("%length", false), TQTime( 0,0,0 ).
addMSecs( songLength )
.toString( "h:mm:ss" ) );
format.replace( TQRegExp("%time", false), TQTime( 0,0,0 ).
addMSecs( currentTime )
.toString( "h:mm:ss" ) );
format.replace( TQRegExp("%remain", false), TQTime( 0,0,0 ).
addMSecs( songLength )
.addMSecs(-currentTime )
.toString( "h:mm:ss" ) );
meter->setValue(format);
}
}
else
{
meter->setValue("");
}
++it;
}
}
示例4: update
void XMMSSensor::update()
{
QString format;
SensorParams *sp;
Meter *meter;
QObjectListIt it( *objList );
#ifdef HAVE_XMMS
int pos;
QString title;
int songLength = 0;
int currentTime = 0;
bool isPlaying = false;
bool isRunning = xmms_remote_is_running(0);
if( isRunning )
{
isPlaying = xmms_remote_is_playing(0);
pos = xmms_remote_get_playlist_pos(0);
qDebug("unicode start");
title = codec->toUnicode( QCString( xmms_remote_get_playlist_title( 0, pos ) ) );
qDebug("unicode end");
if( title.isEmpty() )
title = "XMMS";
qDebug("Title: %s", title.ascii());
songLength = xmms_remote_get_playlist_time( 0, pos );
currentTime = xmms_remote_get_output_time( 0 );
}
#endif // HAVE_XMMS
while (it != 0)
{
sp = (SensorParams*)(*it);
meter = sp->getMeter();
#ifdef HAVE_XMMS
if( isRunning )
{
format = sp->getParam("FORMAT");
if (format.length() == 0 )
{
format = "%title %time / %length";
}
if( format == "%ms" )
{
meter->setMax( songLength );
meter->setValue( currentTime );
}
else
if ( format == "%full" )
{
meter->setValue( 1 );
}
else
{
format.replace( QRegExp("%title", false), title );
format.replace( QRegExp("%length", false), QTime( 0,0,0 ).
addMSecs( songLength )
.toString( "h:mm:ss" ) );
format.replace( QRegExp("%time", false), QTime( 0,0,0 ).
addMSecs( currentTime )
.toString( "h:mm:ss" ) );
if( isPlaying )
{
format.replace( QRegExp("%remain", false), QTime( 0,0,0 ).
addMSecs( songLength )
.addMSecs(-currentTime )
.toString( "h:mm:ss" ) );
}
else
{
format.replace( QRegExp("%remain", false), QTime( 0,0,0 ).toString("h:mm:ss" ) );
}
meter->setValue(format);
}
}
else
#endif // HAVE_XMMS
{
meter->setValue("");
}
++it;
}
//.........这里部分代码省略.........