bool OutputMap::feedBack(quint32 universe, quint32 channel, uchar value, const QString& key) { if (universe >= quint32(m_fb_patch.size())) return false; OutputPatch* patch = m_fb_patch[universe]; Q_ASSERT(patch != NULL); if (patch->plugin() != NULL && patch->output() != QLCIOPlugin::invalidLine()) { patch->plugin()->sendFeedBack(patch->output(), channel, value, key); return true; } else { return false; } }
void OutputMap::slotPluginConfigurationChanged(QLCIOPlugin* plugin) { for (quint32 i = 0; i < universes(); i++) { OutputPatch* op = patch(i); Q_ASSERT(op != NULL); if (op->plugin() == plugin) { m_universeMutex.lock(); op->reconnect(); m_universeMutex.unlock(); } } emit pluginConfigurationChanged(plugin->name()); }
void OutputMap::slotConfigurationChanged() { QLCOutPlugin* plugin = qobject_cast<QLCOutPlugin*> (QObject::sender()); if (plugin == NULL) // The signal comes from a plugin that isn't guaranteed to behave return; for (quint32 i = 0; i < universes(); i++) { OutputPatch* op = patch(i); Q_ASSERT(op != NULL); if (op->plugin() == plugin) { m_universeMutex.lock(); op->reconnect(); m_universeMutex.unlock(); } } emit pluginConfigurationChanged(plugin->name()); }
void OutputMap::saveDefaults() { QSettings settings; QString key; QString str; for (int i = 0; i < KUniverseCount; i++) { OutputPatch* outputPatch = patch(i); Q_ASSERT(outputPatch != NULL); Q_ASSERT(outputPatch->plugin() != NULL); /* Plugin name */ key = QString("/outputmap/universe%2/plugin/").arg(i); settings.setValue(key, outputPatch->pluginName()); /* Plugin output */ key = QString("/outputmap/universe%2/output/").arg(i); settings.setValue(key, str.setNum(outputPatch->output())); } }