本文整理汇总了C++中Cue::setValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Cue::setValue方法的具体用法?C++ Cue::setValue怎么用?C++ Cue::setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cue
的用法示例。
在下文中一共展示了Cue::setValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: flash
void CueStack_Test::flash()
{
CueStack cs(m_doc);
QCOMPARE(cs.isFlashing(), false);
QCOMPARE(m_doc->masterTimer()->m_dmxSourceList.size(), 0);
// Disable flashing when it's already disabled -> fail
cs.setFlashing(false);
QCOMPARE(m_doc->masterTimer()->m_dmxSourceList.size(), 0);
QCOMPARE(cs.isFlashing(), false);
cs.setFlashing(false);
QCOMPARE(m_doc->masterTimer()->m_dmxSourceList.size(), 0);
QCOMPARE(cs.isFlashing(), false);
// Enable flashing without cues -> fail
cs.setFlashing(true);
QCOMPARE(m_doc->masterTimer()->m_dmxSourceList.size(), 0);
QCOMPARE(cs.isFlashing(), false);
Cue cue;
cue.setValue(0, 255);
cue.setValue(128, 42);
cs.appendCue(cue);
QList<Universe*> ua;
ua.append(new Universe(0, new GrandMaster()));
ua.at(0)->setChannelCapability(0, QLCChannel::Intensity);
ua.at(0)->setChannelCapability(128, QLCChannel::Intensity);
cs.setFlashing(true);
QCOMPARE(m_doc->masterTimer()->m_dmxSourceList.size(), 1);
QCOMPARE(cs.isFlashing(), true);
cs.writeDMX(m_doc->masterTimer(), ua);
QCOMPARE(ua[0]->preGMValues()[0], (char) 255);
QCOMPARE(ua[0]->preGMValues()[128], (char) 42);
ua[0]->zeroIntensityChannels();
cs.setFlashing(true);
QCOMPARE(m_doc->masterTimer()->m_dmxSourceList.size(), 1);
cs.writeDMX(m_doc->masterTimer(), ua);
QCOMPARE(ua[0]->preGMValues()[0], (char) 255);
QCOMPARE(ua[0]->preGMValues()[128], (char) 42);
ua[0]->zeroIntensityChannels();
cs.setFlashing(false);
QCOMPARE(cs.isFlashing(), false);
QCOMPARE(m_doc->masterTimer()->m_dmxSourceList.size(), 0);
cs.writeDMX(m_doc->masterTimer(), ua);
QCOMPARE(ua[0]->preGMValues()[0], (char) 0);
QCOMPARE(ua[0]->preGMValues()[128], (char) 0);
ua[0]->zeroIntensityChannels();
}
示例2: postRun
void CueStack_Test::postRun()
{
QLCFixtureDef* def = m_doc->fixtureDefCache()->fixtureDef("Futurelight", "DJScan250");
QVERIFY(def != NULL);
QLCFixtureMode* mode = def->modes().first();
QVERIFY(mode != NULL);
Fixture* fxi = new Fixture(m_doc);
fxi->setFixtureDefinition(def, mode);
fxi->setName("Test Scanner");
fxi->setAddress(10);
fxi->setUniverse(0);
m_doc->addFixture(fxi);
MasterTimer mt(m_doc);
QList<Universe*> ua;
ua.append(new Universe(0, new GrandMaster()));
CueStack cs(m_doc);
cs.setFadeInSpeed(100);
cs.setFadeOutSpeed(200);
cs.setDuration(300);
Cue cue;
cue.setName("One");
cue.setValue(0, 255);
cue.setValue(1, 255);
cue.setValue(500, 255);
cue.setValue(10, 255); // LTP
cue.setValue(11, 255); // LTP
cs.appendCue(cue);
cue = Cue();
cue.setName("Two");
cue.setValue(500, 255);
cue.setValue(3, 255);
cue.setValue(4, 255);
cue.setValue(11, 255); // LTP
cs.appendCue(cue);
cs.preRun();
// Switch to cue one
cs.switchCue(-1, 0, ua);
QCOMPARE(cs.m_fader->channels().size(), 5);
QSignalSpy cueSpy(&cs, SIGNAL(currentCueChanged(int)));
QSignalSpy stopSpy(&cs, SIGNAL(stopped()));
cs.postRun(&mt);
QCOMPARE(cs.m_fader, (GenericFader*) NULL);
QCOMPARE(cs.m_currentIndex, -1);
QCOMPARE(cueSpy.size(), 1);
QCOMPARE(cueSpy.at(0).size(), 1);
QCOMPARE(cueSpy.at(0).at(0).toInt(), -1);
QCOMPARE(stopSpy.size(), 1);
// Only HTP channels go to MasterTimer's GenericFader
QCOMPARE(mt.m_fader->channels().size(), 3);
FadeChannel fc;
fc.setChannel(0);
QCOMPARE(mt.m_fader->channels().contains(fc), true);
fc.setChannel(1);
QCOMPARE(mt.m_fader->channels().contains(fc), true);
fc.setChannel(500);
QCOMPARE(mt.m_fader->channels().contains(fc), true);
}
示例3: switchCue
void CueStack_Test::switchCue()
{
QLCFixtureDef* def = m_doc->fixtureDefCache()->fixtureDef("Futurelight", "DJScan250");
QVERIFY(def != NULL);
QLCFixtureMode* mode = def->modes().first();
QVERIFY(mode != NULL);
Fixture* fxi = new Fixture(m_doc);
fxi->setFixtureDefinition(def, mode);
fxi->setName("Test Scanner");
fxi->setAddress(10);
fxi->setUniverse(0);
m_doc->addFixture(fxi);
QList<Universe*> ua;
ua.append(new Universe(0, new GrandMaster()));
CueStack cs(m_doc);
cs.setFadeInSpeed(100);
cs.setFadeOutSpeed(200);
cs.setDuration(300);
Cue cue;
cue.setName("One");
cue.setValue(0, 255);
cue.setValue(1, 255);
cue.setValue(500, 255);
cue.setValue(10, 255); // LTP
cue.setValue(11, 255); // LTP
cue.setFadeInSpeed(20);
cue.setFadeOutSpeed(40);
cs.appendCue(cue);
cue = Cue();
cue.setName("Two");
cue.setValue(500, 255);
cue.setValue(3, 255);
cue.setValue(4, 255);
cue.setValue(11, 255); // LTP
cue.setFadeInSpeed(60);
cue.setFadeOutSpeed(80);
cs.appendCue(cue);
cs.preRun();
// Do nothing with invalid cue indices
cs.switchCue(-1, -1, ua);
QCOMPARE(cs.m_fader->channels().size(), 0);
cs.switchCue(-1, 3, ua);
QCOMPARE(cs.m_fader->channels().size(), 0);
// Switch to cue one
cs.switchCue(3, 0, ua);
QCOMPARE(cs.m_fader->channels().size(), 5);
FadeChannel fc;
fc.setChannel(0);
QCOMPARE(cs.m_fader->channels()[fc].start(), uchar(0));
QCOMPARE(cs.m_fader->channels()[fc].current(), uchar(0));
QCOMPARE(cs.m_fader->channels()[fc].target(), uchar(255));
QCOMPARE(cs.m_fader->channels()[fc].channel(), uint(0));
QCOMPARE(cs.m_fader->channels()[fc].fadeTime(), uint(20));
fc.setChannel(1);
QCOMPARE(cs.m_fader->channels()[fc].start(), uchar(0));
QCOMPARE(cs.m_fader->channels()[fc].current(), uchar(0));
QCOMPARE(cs.m_fader->channels()[fc].target(), uchar(255));
QCOMPARE(cs.m_fader->channels()[fc].channel(), uint(1));
QCOMPARE(cs.m_fader->channels()[fc].fadeTime(), uint(20));
fc.setChannel(10);
QCOMPARE(cs.m_fader->channels()[fc].start(), uchar(0));
QCOMPARE(cs.m_fader->channels()[fc].current(), uchar(0));
QCOMPARE(cs.m_fader->channels()[fc].target(), uchar(255));
QCOMPARE(cs.m_fader->channels()[fc].channel(), uint(10));
QCOMPARE(cs.m_fader->channels()[fc].fadeTime(), uint(20));
fc.setChannel(11);
QCOMPARE(cs.m_fader->channels()[fc].start(), uchar(0));
QCOMPARE(cs.m_fader->channels()[fc].current(), uchar(0));
QCOMPARE(cs.m_fader->channels()[fc].target(), uchar(255));
QCOMPARE(cs.m_fader->channels()[fc].channel(), uint(11));
QCOMPARE(cs.m_fader->channels()[fc].fadeTime(), uint(20));
fc.setChannel(500);
QCOMPARE(cs.m_fader->channels()[fc].start(), uchar(0));
QCOMPARE(cs.m_fader->channels()[fc].current(), uchar(0));
QCOMPARE(cs.m_fader->channels()[fc].target(), uchar(255));
QCOMPARE(cs.m_fader->channels()[fc].channel(), uint(500));
QCOMPARE(cs.m_fader->channels()[fc].fadeTime(), uint(20));
fc.setChannel(3);
QCOMPARE(cs.m_fader->channels()[fc].channel(), QLCChannel::invalid());
fc.setChannel(4);
QCOMPARE(cs.m_fader->channels()[fc].channel(), QLCChannel::invalid());
fc.setChannel(0);
cs.m_fader->m_channels[fc].setCurrent(127);
fc.setChannel(1);
//.........这里部分代码省略.........