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 OutputPatch_Test::patch() { OutputMap om(m_doc, 4); OutputPluginStub* stub = static_cast<OutputPluginStub*> (m_doc->ioPluginCache()->plugins().at(0)); QVERIFY(stub != NULL); OutputPatch* op = new OutputPatch(this); op->set(stub, 0); QVERIFY(op->m_plugin == stub); QVERIFY(op->m_output == 0); QVERIFY(op->pluginName() == stub->name()); QVERIFY(op->outputName() == stub->outputs()[0]); QVERIFY(stub->m_openOutputs.size() == 1); QVERIFY(stub->m_openOutputs.at(0) == 0); op->set(stub, 3); QVERIFY(op->m_plugin == stub); QVERIFY(op->m_output == 3); QVERIFY(op->pluginName() == stub->name()); QVERIFY(op->outputName() == stub->outputs()[3]); QVERIFY(stub->m_openOutputs.size() == 1); QVERIFY(stub->m_openOutputs.at(0) == 3); op->reconnect(); QVERIFY(op->m_plugin == stub); QVERIFY(op->m_output == 3); QVERIFY(op->pluginName() == stub->name()); QVERIFY(op->outputName() == stub->outputs()[3]); QVERIFY(stub->m_openOutputs.size() == 1); QVERIFY(stub->m_openOutputs.at(0) == 3); delete op; QVERIFY(stub->m_openOutputs.size() == 0); }