• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setDuration函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setDuration函数的典型用法代码示例。如果您正苦于以下问题:C++ setDuration函数的具体用法?C++ setDuration怎么用?C++ setDuration使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: Element

TabDurationSymbol::TabDurationSymbol(Score* s, StaffTypeTablature * tab, TDuration::DurationType type, int dots)
   : Element(s)
      {
      setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
      setGenerated(true);
      setDuration(type, dots, tab);
      }
开发者ID:alexkonradi,项目名称:MuseScore,代码行数:7,代码来源:stafftype.cpp


示例2: qDebug

void TrackInfoObject::parse() {
    // Log parsing of header information in developer mode. This is useful for
    // tracking down corrupt files.
    const QString& canonicalLocation = m_fileInfo.canonicalFilePath();
    if (CmdlineArgs::Instance().getDeveloper()) {
        qDebug() << "TrackInfoObject::parse()" << canonicalLocation;
    }

    // Parse the information stored in the sound file.
    SoundSourceProxy proxy(canonicalLocation, m_pSecurityToken);
    Mixxx::SoundSource* pProxiedSoundSource = proxy.getProxiedSoundSource();
    if (pProxiedSoundSource != NULL && proxy.parseHeader() == OK) {

        // Dump the metadata extracted from the file into the track.

        // TODO(XXX): This involves locking the mutex for every setXXX
        // method. We should figure out an optimization where there are private
        // setters that don't lock the mutex.

        // If Artist, Title and Type fields are not blank, modify them.
        // Otherwise, keep their current values.
        // TODO(rryan): Should we re-visit this decision?
        if (!(pProxiedSoundSource->getArtist().isEmpty())) {
            setArtist(pProxiedSoundSource->getArtist());
        }

        if (!(pProxiedSoundSource->getTitle().isEmpty())) {
            setTitle(pProxiedSoundSource->getTitle());
        }

        if (!(pProxiedSoundSource->getType().isEmpty())) {
            setType(pProxiedSoundSource->getType());
        }

        setAlbum(pProxiedSoundSource->getAlbum());
        setAlbumArtist(pProxiedSoundSource->getAlbumArtist());
        setYear(pProxiedSoundSource->getYear());
        setGenre(pProxiedSoundSource->getGenre());
        setComposer(pProxiedSoundSource->getComposer());
        setGrouping(pProxiedSoundSource->getGrouping());
        setComment(pProxiedSoundSource->getComment());
        setTrackNumber(pProxiedSoundSource->getTrackNumber());
        setReplayGain(pProxiedSoundSource->getReplayGain());
        setBpm(pProxiedSoundSource->getBPM());
        setDuration(pProxiedSoundSource->getDuration());
        setBitrate(pProxiedSoundSource->getBitrate());
        setSampleRate(pProxiedSoundSource->getSampleRate());
        setChannels(pProxiedSoundSource->getChannels());
        setKeyText(pProxiedSoundSource->getKey(),
                   mixxx::track::io::key::FILE_METADATA);
        setHeaderParsed(true);
    } else {
        qDebug() << "TrackInfoObject::parse() error at file"
                 << canonicalLocation;
        setHeaderParsed(false);

        // Add basic information derived from the filename:
        parseFilename();
    }
}
开发者ID:r1n3m,项目名称:mixxx,代码行数:60,代码来源:trackinfoobject.cpp


示例3: qfu

bool EPGItem::setData( vlc_epg_event_t *data )
{
    QDateTime newtime = QDateTime::fromTime_t( data->i_start );
    QString newname = qfu( data->psz_name );
    QString newdesc = qfu( data->psz_description );
    QString newshortdesc = qfu( data->psz_short_description );

    if ( m_start != newtime ||
         m_name != newname ||
         m_description != newdesc ||
         m_shortDescription != newshortdesc ||
         m_duration != data->i_duration )
    {
        m_start = newtime;
        m_name = newname;
        setToolTip( newname );
        m_description = newdesc;
        m_shortDescription = newshortdesc;
        setDuration( data->i_duration );
        setRating( data->i_rating );
        update();
        return true;
    }
    return false;
}
开发者ID:0xheart0,项目名称:vlc,代码行数:25,代码来源:EPGItem.cpp


示例4: switch

int QPauseAnimation::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QAbstractAnimation::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = duration(); break;
        }
        _id -= 1;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setDuration(*reinterpret_cast< int*>(_v)); break;
        }
        _id -= 1;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 1;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
开发者ID:unni07,项目名称:RecommenderSystem,代码行数:35,代码来源:moc_qpauseanimation.cpp


示例5: setFrequency

void LogVariablesWidget::setLogVariableChecked( int pIndex, bool pChecked )
{
	mHeaderView->setChecked(pIndex, pChecked);	
	if ( pChecked )
	{
		Qt::ItemFlags flags = Qt::ItemIsEditable|Qt::ItemIsSelectable
			|Qt::ItemIsUserCheckable|Qt::ItemIsEnabled|Qt::ItemIsDragEnabled|Qt::ItemIsDropEnabled;

		ui->logVariableTable->item(pIndex, 0)->setFlags(Qt::ItemIsEnabled);
		ui->logVariableTable->item(pIndex, 1)->setFlags(flags);		
		ui->logVariableTable->item(pIndex, 2)->setFlags(flags);		
		ui->logVariableTable->item(pIndex, 3)->setFlags(flags);		
	}
	else
	{
		ui->logVariableTable->item(pIndex, 0)->setFlags(Qt::NoItemFlags);
		ui->logVariableTable->item(pIndex, 1)->setFlags(Qt::NoItemFlags);
		ui->logVariableTable->item(pIndex, 2)->setFlags(Qt::NoItemFlags);
		ui->logVariableTable->item(pIndex, 3)->setFlags(Qt::NoItemFlags);

		setFrequency(pIndex, DataRepository::instance()->frequency());
		setStartTime(pIndex, 0);
		setDuration(pIndex, DataRepository::instance()->duration());
	}

	QFont font = ui->logVariableTable->item(pIndex, 0)->font();
	font.setBold(pChecked);
	ui->logVariableTable->item(pIndex, 0)->setFont(font);
	ui->logVariableTable->item(pIndex, 1)->setFont(font);
	ui->logVariableTable->item(pIndex, 2)->setFont(font);
	ui->logVariableTable->item(pIndex, 3)->setFont(font);
}
开发者ID:emreaslan,项目名称:zenom,代码行数:32,代码来源:logvariableswidget.cpp


示例6: setDuration

void Chaser::setTotalDuration(quint32 msec)
{
    if (durationMode() == Chaser::Common)
    {
        int stepsCount = m_steps.count();
        if (stepsCount == 0)
            stepsCount = 1;
        setDuration(msec / stepsCount);
    }
    else
    {
        // scale all the Chaser steps to resize
        // to the desired duration
        double dtDuration = (double)totalDuration();
        for (int i = 0; i < m_steps.count(); i++)
        {
            uint origDuration = m_steps[i].duration;
            m_steps[i].duration = ((double)m_steps[i].duration * msec) / dtDuration;
            if(m_steps[i].hold)
                m_steps[i].hold = ((double)m_steps[i].hold * (double)m_steps[i].duration) / (double)origDuration;
            m_steps[i].fadeIn = m_steps[i].duration - m_steps[i].hold;
            if (m_steps[i].fadeOut)
                m_steps[i].fadeOut = ((double)m_steps[i].fadeOut * (double)m_steps[i].duration) / (double)origDuration;
        }
    }
    emit changed(this->id());
}
开发者ID:mcallegari,项目名称:qlcplus,代码行数:27,代码来源:chaser.cpp


示例7: ParticleSpiralSystem

		ParticleSpiralSystem() : wyQuadParticleSystem(500){
	        // duration
	        setDuration(PARTICLE_DURATION_INFINITY);

	        // angle
	        setDirectionAngleVariance(90, 0);

	        // speed of particles
	        setSpeedVariance(150, 0);

	        // radial
	        setRadialAccelerationVariance(-380, 0);

	        // tagential
	        setTangentialAccelerationVariance(45, 0);

	        // life of particles
	        setLifeVariance(12, 0);

	        // size, in pixels
	        setStartSizeVariance(20, 0);

	        // emits per second
	        setEmissionRate(getMaxParticles() / getLife());

	        // color of particles
	        setStartColorVariance(0.5f, 0.5f, 0.5f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f);
	        setEndColorVariance(0.5f, 0.5f, 0.5f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f);

	        //set texture
	        setTexture(wyTexture2D::makePNG(RES("R.drawable.fire")));

	    	// additive
	    	setBlendAdditive(false);
		}
开发者ID:widerules,项目名称:droidloft,代码行数:35,代码来源:ParticleDemos.cpp


示例8: ParticleFireSystem

		ParticleFireSystem() : wyQuadParticleSystem(250){
	        // duration
	        setDuration(PARTICLE_DURATION_INFINITY);

	        // angle
	        setDirectionAngleVariance(90, 10);

	        // life of particles
	        setLifeVariance(3.0f, 0.25f);

	        // speed of particles
	        setSpeedVariance(60, 20);

	        // size, in pixels
	        setStartSizeVariance(100.0f, 10.0f);

	        // emits per frame
	        setEmissionRate(getMaxParticles() / getLife());

	        // color of particles
	        setStartColorVariance(0.76f, 0.25f, 0.12f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f);
	        setEndColorVariance(0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f);

	        //set texture
	        setTexture(wyTexture2D::makePNG(RES("R.drawable.fire")));

	    	// additive
	    	setBlendAdditive(true);
		}
开发者ID:widerules,项目名称:droidloft,代码行数:29,代码来源:ParticleDemos.cpp


示例9: ParticleSmokeSystem

		ParticleSmokeSystem() : wyQuadParticleSystem(200){
	        // duration
	        setDuration(PARTICLE_DURATION_INFINITY);

	        // angle
	        setDirectionAngleVariance(90, 5);

	        // position var
	        setParticlePositionVariance(0, 0, 20, 0);

	        // life of particles
	        setLifeVariance(4, 1);

	        // speed of particles
	        setSpeedVariance(25, 10);

	        // size, in pixels
	        setStartSizeVariance(60, 10);

	        // emits per frame
	        setEmissionRate(getMaxParticles() / getLife());

	        // color of particles
	        setStartColorVariance(0.8f, 0.8f, 0.8f, 1.0f, 0.02f, 0.02f, 0.02f, 0.0f);
	        setEndColorVariance(0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f);

	        //set texture
	        setTexture(wyTexture2D::makePNG(RES("R.drawable.fire")));

	    	// additive
	    	setBlendAdditive(false);
		}
开发者ID:widerules,项目名称:droidloft,代码行数:32,代码来源:ParticleDemos.cpp


示例10: ParticleExplosionSystem

		ParticleExplosionSystem() : wyQuadParticleSystem(700){
	        // duration
	        setDuration(0.1f);

	        // gravity
	        setParticleGravity(0, -100);

	        // angle
	        setDirectionAngleVariance(90, 360);

	        // speed of particles
	        setSpeedVariance(70, 40);

	        // life of particles
	        setLifeVariance(5.0f, 2.0f);

	        // size, in pixels
	        setStartSizeVariance(15.0f, 10.0f);

	        // emits per second
	        setEmissionRate(getMaxParticles() / getDuration());

	        // color of particles
	        setStartColorVariance(0.7f, 0.1f, 0.2f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f);
	        setEndColorVariance(0.5f, 0.5f, 0.5f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f);

	        //set texture
	        setTexture(wyTexture2D::makePNG(RES("R.drawable.stars")));
		}
开发者ID:widerules,项目名称:droidloft,代码行数:29,代码来源:ParticleDemos.cpp


示例11: ParticleRingSystem

		ParticleRingSystem() : wyQuadParticleSystem(250){
	        // duration
	        setDuration(PARTICLE_DURATION_INFINITY);

	        // angle
	        setDirectionAngleVariance(90, 360);

	        // speed of particles
	        setSpeedVariance(100, 0);

	        // radial
	        setRadialAccelerationVariance(-60, 0);

	        // tagential
	        setTangentialAccelerationVariance(15, 0);

	        // life of particles
	        setLifeVariance(10, 0);

	        // size, in pixels
	        setStartSizeVariance(30.0f, 10.0f);

	        // emits per second
	        setEmissionRate(10000);

	        // color of particles
	        setStartColorVariance(0.5f, 0.5f, 0.5f, 1.0f, 0.5f, 0.5f, 0.5f, 0.5f);
	        setEndColorVariance(0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f);

	        //set texture
	        setTexture(wyTexture2D::makePNG(RES("R.drawable.stars")));

	    	// additive
	    	setBlendAdditive(true);
		}
开发者ID:widerules,项目名称:droidloft,代码行数:35,代码来源:ParticleDemos.cpp


示例12: ParticleMeteorSystem

		ParticleMeteorSystem() : wyQuadParticleSystem(150) {
	        // duration
	        setDuration(PARTICLE_DURATION_INFINITY);

	        // gravity
	        setParticleGravity(DP(-133.33f), DP(133.33f));

	        // angle
	        setDirectionAngleVariance(90, 360);

	        // speed of particles
	        setSpeedVariance(DP(10), DP(3.33f));

	        // life of particles
	        setLifeVariance(2, 1);

	        // size, in pixels
	        setStartSizeVariance(DP(40.0f), DP(6.6f));

	        // emits per second
	        setEmissionRate(getMaxParticles() / getLife());

	        // color of particles
	        setStartColorVariance(0.2f, 0.4f, 0.7f, 1.0f, 0.0f, 0.0f, 0.2f, 0.1f);
	        setEndColorVariance(0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f);

	        //set texture
	        setTexture(wyTexture2D::makePNG(RES("R.drawable.fire")));

	    	// additive
	    	setBlendAdditive(true);
		}
开发者ID:widerules,项目名称:droidloft,代码行数:32,代码来源:ParticleDemos.cpp


示例13: QPropertyAnimation

void ViewportView::zoomTo(Node* n)
{
    // Find all ControlInstances that are declared by this node
    QList<ControlInstance*> instances;
    for (auto i : items())
    {
        if (auto c = dynamic_cast<ControlInstance*>(i))
        {
            if (c->getNode() == n)
            {
                instances.push_back(c);
            }
        }
    }

    // Find a weighted sum of central points
    QVector3D pos;
    float area_sum = 0;
    for (auto i : instances)
    {
        const float area = i->boundingRect().width() *
                           i->boundingRect().height();
        pos += i->getControl()->pos() * area;
        area_sum += area;
    }
    pos /= area_sum;

    auto a = new QPropertyAnimation(this, "_center");
    a->setDuration(100);
    a->setStartValue(center);
    a->setEndValue(pos);

    a->start(QPropertyAnimation::DeleteWhenStopped);
}
开发者ID:pfelecan,项目名称:antimony-debian-packaging,代码行数:34,代码来源:view.cpp


示例14: Function

EFX::EFX(Doc* doc) : Function(doc, Function::EFXType)
{
    m_isRelative = false;

    updateRotationCache();

    m_xFrequency = 2;
    m_yFrequency = 3;
    m_xPhase = M_PI / 2.0;
    m_yPhase = 0;

    m_propagationMode = Parallel;

    m_algorithm = EFX::Circle;

    setName(tr("New EFX"));

    m_fader = NULL;

    setDuration(20000); // 20s

    m_legacyHoldBus = Bus::invalid();
    m_legacyFadeBus = Bus::invalid();

    registerAttribute(tr("Width"), Function::LastWins, 0.0, 127.0, 127.0);
    registerAttribute(tr("Height"), Function::LastWins, 0.0, 127.0, 127.0);
    registerAttribute(tr("Rotation"), Function::LastWins, 0.0, 359.0, 0.0);
    registerAttribute(tr("X Offset"), Function::LastWins, 0.0, 255.0, 127.0);
    registerAttribute(tr("Y Offset"), Function::LastWins, 0.0, 255.0, 127.0);
    registerAttribute(tr("Start Offset"), Function::LastWins, 0.0, 359.0, 0.0);
}
开发者ID:janosvitok,项目名称:qlcplus,代码行数:31,代码来源:efx.cpp


示例15: while

  void MuTimer::update() {
    TimeEvent::Time now = std::chrono::system_clock::now();

    auto &timerQueue = usingQueueA ? timerQueueA : timerQueueB;
    auto &timerQueue2 = usingQueueA ? timerQueueB : timerQueueA;

    usingQueueA = !usingQueueA;

    while (!timerQueue.empty() && (timerQueue.top()->when < now)) {
      auto t = timerQueue.top();
      timerQueue.pop();

      if (!t->finished) {
        t->callback();

        if (t->loop) {
          t->setDuration(t->duration);
          timerQueue2.push(t);
          continue;
        }
      }

      removeTimer(t->id);
    }
  }
开发者ID:eriser,项目名称:mural,代码行数:25,代码来源:MuTimer.cpp


示例16: switch

bool Media::setValueForRole(int role, const QVariant& value)
{
    switch (role) {
        case MediaCenter::MediaTypeRole:
            return setType(value.toString());
        case Qt::DisplayRole:
            return setTitle(value.toString());
        case MediaCenter::MediaUrlRole:
            if (d->url != value.toString()) {
                qDebug() << d->url << value.toString();
                qFatal("Media URLs CANNOT be changed");
            }
            return false;
        case Qt::DecorationRole:
            return thumbnail().isEmpty() ? setThumbnail(value.toString()) : false;
        case MediaCenter::CreatedAtRole:
            return setCreatedAt(value.toDateTime());
        case MediaCenter::GenreRole:
            return setGenre(value.toString());
        case MediaCenter::DurationRole :
            return setDuration(value.toInt());
        case MediaCenter::RatingRole :
            return setRating(value.toInt());
        default:
            //qWarning() << "Unknown role " << role << " for value " << value;
            return false;
    }
}
开发者ID:KDE,项目名称:plasma-mediacenter,代码行数:28,代码来源:media.cpp


示例17: setSpellId

void SpellItem::update(uint16_t spellId, const Spell* spell, int duration,
		       uint16_t casterId, const QString& casterName,
		       uint16_t targetId, const QString& targetName)
{
     setSpellId(spellId);

     setDuration(duration);

     if (spell)
     {
       setSpellName(spell->name());

       if (spell->targetType() != 0x06)
	 setTargetId(targetId);
     }
     else
     {
       setSpellName(spell_name(spellId));
       setTargetId(targetId);
     }

     setCasterId(casterId);

     if (!casterName.isEmpty())
       setCasterName(casterName);
     else
       setCasterName(QString("N/A"));

     if (!targetName.isEmpty())
       setTargetName(targetName);
     else
       setTargetName(QString("N/A"));

     updateCastTime();
}
开发者ID:carriercomm,项目名称:showeq,代码行数:35,代码来源:spellshell.cpp


示例18: QNumberStyleAnimation

QScrollbarStyleAnimation::QScrollbarStyleAnimation(Mode mode, QObject *target) : QNumberStyleAnimation(target), _mode(mode), _active(false)
{
    switch (mode) {
    case Activating:
        setDuration(ScrollBarFadeOutDuration);
        setStartValue(0.0);
        setEndValue(1.0);
        break;
    case Deactivating:
        setDuration(ScrollBarFadeOutDelay + ScrollBarFadeOutDuration);
        setDelay(ScrollBarFadeOutDelay);
        setStartValue(1.0);
        setEndValue(0.0);
        break;
    }
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:16,代码来源:qstyleanimation.cpp


示例19: QLabel

DBreathingLabel::DBreathingLabel(QWidget *parent,Qt::WindowFlags f)
    : QLabel(parent, f), alpha_(255)
{
    m_showAnimation = new QPropertyAnimation(this, "alpha");
    m_hideAnimation = new QPropertyAnimation(this, "alpha");
    setDuration(400);
}
开发者ID:oberon2007,项目名称:deepin-session-ui-manjaro,代码行数:7,代码来源:dbreathinglabel.cpp


示例20: qWarning

bool ShowFunction::loadXML(QXmlStreamReader &root)
{
    if (root.name() != KXMLShowFunction)
    {
        qWarning() << Q_FUNC_INFO << "ShowFunction node not found";
        return false;
    }

    QXmlStreamAttributes attrs = root.attributes();

    if (attrs.hasAttribute(KXMLShowFunctionID))
        setFunctionID(attrs.value(KXMLShowFunctionID).toString().toUInt());
    if (attrs.hasAttribute(KXMLShowFunctionStartTime))
        setStartTime(attrs.value(KXMLShowFunctionStartTime).toString().toUInt());
    if (attrs.hasAttribute(KXMLShowFunctionDuration))
        setDuration(attrs.value(KXMLShowFunctionDuration).toString().toUInt());
    if (attrs.hasAttribute(KXMLShowFunctionColor))
        setColor(QColor(attrs.value(KXMLShowFunctionColor).toString()));
    if (attrs.hasAttribute(KXMLShowFunctionLocked))
        setLocked(true);

    root.skipCurrentElement();

    return true;
}
开发者ID:janosvitok,项目名称:qlcplus,代码行数:25,代码来源:showfunction.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setDynamic函数代码示例发布时间:2022-05-30
下一篇:
C++ setDragEnabled函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap