ConsoleChannel* FixtureConsole::channel(quint32 ch) { QListIterator <QObject*> it(children()); while (it.hasNext() == true) { ConsoleChannel* cc; cc = qobject_cast<ConsoleChannel*> (it.next()); if (cc != NULL && cc->channel() == ch) return cc; } return NULL; }
void FixtureConsole::setSceneValue(const SceneValue& scv) { Q_ASSERT(scv.fxi == m_fixture); QListIterator <QObject*> it(children()); while (it.hasNext() == true) { ConsoleChannel* cc = qobject_cast<ConsoleChannel*> (it.next()); if (cc != NULL && cc->channel() == scv.channel) { cc->enable(true); cc->setValue(scv.value); } } }
QList <SceneValue> FixtureConsole::values() const { QList <SceneValue> list; QListIterator <QObject*> it(children()); while (it.hasNext() == true) { ConsoleChannel* cc; cc = qobject_cast<ConsoleChannel*> (it.next()); if (cc != NULL && cc->isEnabled() == true) { list.append(SceneValue(m_fixture, cc->channel(), cc->sliderValue())); } } return list; }