本文整理汇总了C++中setDuration函数的典型用法代码示例。如果您正苦于以下问题:C++ setDuration函数的具体用法?C++ setDuration怎么用?C++ setDuration使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setDuration函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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();
}
}
示例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;
}
示例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;
}
示例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);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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")));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}