本文整理汇总了C++中FixtureGroup::size方法的典型用法代码示例。如果您正苦于以下问题:C++ FixtureGroup::size方法的具体用法?C++ FixtureGroup::size怎么用?C++ FixtureGroup::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FixtureGroup
的用法示例。
在下文中一共展示了FixtureGroup::size方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: totalDuration
quint32 RGBMatrix::totalDuration()
{
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (m_algorithm == NULL)
return 0;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp == NULL)
return 0;
qDebug () << "Algorithm steps:" << m_algorithm->rgbMapStepCount(grp->size());
return m_algorithm->rgbMapStepCount(grp->size()) * duration();
}
示例2: totalDuration
quint32 RGBMatrix::totalDuration()
{
if (m_fixtureGroupID == FixtureGroup::invalidId() ||
m_algorithm == NULL)
return 0;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp != NULL)
{
qDebug () << "Algorithm steps:" << m_algorithm->rgbMapStepCount(grp->size());
return m_algorithm->rgbMapStepCount(grp->size()) * duration();
}
return 0;
}
示例3: calculateColorDelta
void RGBMatrix::calculateColorDelta()
{
m_crDelta = 0;
m_cgDelta = 0;
m_cbDelta = 0;
m_stepCount = 0;
if (m_endColor.isValid())
{
if (doc() == NULL)
return;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (grp != NULL && m_algorithm != NULL)
{
m_stepCount = m_algorithm->rgbMapStepCount(grp->size()) - 1;
if (m_stepCount > 0)
{
m_crDelta = m_endColor.red() - m_startColor.red();
m_cgDelta = m_endColor.green() - m_startColor.green();
m_cbDelta = m_endColor.blue() - m_startColor.blue();
}
}
}
}
示例4: doc
QList <RGBMap> RGBMatrix::previewMaps()
{
QList <RGBMap> steps;
if (m_algorithm == NULL)
return steps;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp != NULL)
{
int stepCount = m_algorithm->rgbMapStepCount(grp->size());
for (int i = 0; i < stepCount; i++)
steps << m_algorithm->rgbMap(grp->size(), m_stepColor.rgb(), i);
}
return steps;
}
示例5: tap
void RGBMatrix::tap()
{
if (stopped() == false)
{
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
// Filter out taps that are too close to each other
if (grp != NULL && uint(m_roundTime->elapsed()) >= (duration() / 4))
roundCheck(grp->size());
}
}
示例6: write
void RGBMatrix::write(MasterTimer* timer, QList<Universe *> universes)
{
Q_UNUSED(timer);
Q_UNUSED(universes);
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp == NULL)
{
// No fixture group to control
stop();
return;
}
// No time to do anything.
if (duration() == 0)
return;
// Invalid/nonexistent script
{
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (m_algorithm == NULL || m_algorithm->apiVersion() == 0)
return;
// Get new map every time when elapsed is reset to zero
if (elapsed() == 0)
{
qDebug() << "RGBMatrix stepColor:" << QString::number(m_stepColor.rgb(), 16);
RGBMap map = m_algorithm->rgbMap(grp->size(), m_stepColor.rgb(), m_step);
updateMapChannels(map, grp);
}
}
// Run the generic fader that takes care of fading in/out individual channels
m_fader->write(universes);
// Increment elapsed time
incrementElapsed();
// Check if we need to change direction, stop completely or go to next step
if (elapsed() >= duration())
roundCheck(grp->size());
}
示例7: previewMap
RGBMap RGBMatrix::previewMap(int step)
{
RGBMap map;
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (m_algorithm == NULL)
return map;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp != NULL)
{
map = m_algorithm->rgbMap(grp->size(), m_stepColor.rgb(), step);
}
return map;
}
示例8: stepsCount
int RGBMatrix::stepsCount()
{
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (m_algorithm == NULL)
return 0;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp != NULL)
return m_algorithm->rgbMapStepCount(grp->size());
return 0;
}
示例9: setTotalDuration
void RGBMatrix::setTotalDuration(quint32 msec)
{
if (m_fixtureGroupID == FixtureGroup::invalidId() ||
m_algorithm == NULL)
return;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp != NULL)
{
int steps = m_algorithm->rgbMapStepCount(grp->size());
setDuration(msec / steps);
}
}
示例10: preRun
void RGBMatrix::preRun(MasterTimer* timer)
{
Q_UNUSED(timer);
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
{
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (grp != NULL && m_algorithm != NULL)
{
Q_ASSERT(m_fader == NULL);
m_fader = new GenericFader(doc());
m_fader->adjustIntensity(getAttributeValue(Intensity));
// Copy direction from parent class direction
m_direction = direction();
if (m_direction == Forward)
{
m_step = 0;
m_stepColor = m_startColor.rgb();
}
else
{
m_step = m_algorithm->rgbMapStepCount(grp->size()) - 1;
if (m_endColor.isValid())
{
m_stepColor = m_endColor.rgb();
}
else
{
m_stepColor = m_startColor.rgb();
}
}
calculateColorDelta();
if (m_algorithm->type() == RGBAlgorithm::Script)
{
RGBScript *script = static_cast<RGBScript*> (m_algorithm);
QHashIterator<QString, QString> it(m_properties);
while(it.hasNext())
{
it.next();
script->setProperty(it.key(), it.value());
}
}
}
}
m_roundTime->start();
Function::preRun(timer);
}
示例11: setTotalDuration
void RGBMatrix::setTotalDuration(quint32 msec)
{
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (m_algorithm == NULL)
return;
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
if (grp == NULL)
return;
int steps = m_algorithm->rgbMapStepCount(grp->size());
setDuration(msec / steps);
}
示例12: preRun
void RGBMatrix::preRun(MasterTimer* timer)
{
Q_UNUSED(timer);
FixtureGroup* grp = doc()->fixtureGroup(fixtureGroup());
{
QMutexLocker algorithmLocker(&m_algorithmMutex);
if (grp != NULL && m_algorithm != NULL)
{
m_direction = direction();
Q_ASSERT(m_fader == NULL);
m_fader = new GenericFader(doc());
m_fader->adjustIntensity(getAttributeValue(Intensity));
if (m_direction == Forward)
{
m_step = 0;
m_stepColor = m_startColor.rgb();
}
else
{
m_step = m_algorithm->rgbMapStepCount(grp->size()) - 1;
if (m_endColor.isValid())
{
m_stepColor = m_endColor.rgb();
}
else
{
m_stepColor = m_startColor.rgb();
}
}
calculateColorDelta();
}
}
m_roundTime->start();
Function::preRun(timer);
}
示例13: createPreviewItems
bool RGBMatrixEditor::createPreviewItems()
{
m_previewHash.clear();
m_scene->clear();
FixtureGroup* grp = m_doc->fixtureGroup(m_matrix->fixtureGroup());
if (grp == NULL)
{
QGraphicsTextItem* text = new QGraphicsTextItem(tr("No fixture group to control"));
text->setDefaultTextColor(Qt::white);
m_scene->addItem(text);
return false;
}
m_previewDirection = m_matrix->direction();
if (m_previewDirection == Function::Forward)
{
m_matrix->setStepColor(m_matrix->startColor());
}
else
{
if (m_matrix->endColor().isValid())
m_matrix->setStepColor(m_matrix->endColor());
else
m_matrix->setStepColor(m_matrix->startColor());
}
m_matrix->calculateColorDelta();
m_previewMaps = m_matrix->previewMaps();
if ((m_previewDirection == Function::Forward) || m_previewMaps.isEmpty())
{
m_previewStep = 0;
}
else
{
m_previewStep = m_previewMaps.size() - 1;
}
RGBMap map;
if (m_previewStep < m_previewMaps.size())
map = m_previewMaps[m_previewStep];
if (map.isEmpty())
return false;
for (int x = 0; x < grp->size().width(); x++)
{
for (int y = 0; y < grp->size().height(); y++)
{
QLCPoint pt(x, y);
if (grp->headHash().contains(pt) == true)
{
RGBItem* item = new RGBItem;
item->setRect(x * RECT_SIZE + RECT_PADDING + ITEM_PADDING,
y * RECT_SIZE + RECT_PADDING + ITEM_PADDING,
ITEM_SIZE - (2 * ITEM_PADDING),
ITEM_SIZE - (2 * ITEM_PADDING));
item->setColor(map[y][x]);
item->draw(0);
m_scene->addItem(item);
m_previewHash[pt] = item;
}
}
}
return true;
}