Esempio n. 1
0
void OutputMap::saveDefaults()
{
    QSettings settings;
    QString key;
    QString str;

    for (quint32 i = 0; i < universes(); i++)
    {
        OutputPatch* outputPatch = patch(i);
        OutputPatch* fbPatch = feedbackPatch(i);
        Q_ASSERT(outputPatch != NULL);
        Q_ASSERT(fbPatch != 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()));

        /* Plugin name */
        key = QString("/outputmap/universe%2/feedbackplugin/").arg(i);
        settings.setValue(key, fbPatch->pluginName());

        /* Plugin output */
        key = QString("/outputmap/universe%2/feedback/").arg(i);
        settings.setValue(key, str.setNum(fbPatch->output()));
    }
}
Esempio n. 2
0
InputOutputPatchEditor::InputOutputPatchEditor(QWidget* parent, quint32 universe, InputMap* inputMap, OutputMap* outputMap)
    : QWidget(parent)
    , m_inputMap(inputMap)
    , m_outputMap(outputMap)
    , m_universe(universe)
{
    Q_ASSERT(universe < m_inputMap->universes());
    Q_ASSERT(inputMap != NULL);
    Q_ASSERT(outputMap != NULL);

    setupUi(this);

    m_infoBrowser->setOpenExternalLinks(true);
    m_infoBrowser->setFixedHeight(250);

    InputPatch* inputPatch = m_inputMap->patch(universe);
    OutputPatch* outputPatch = m_outputMap->patch(universe);
    OutputPatch* feedbackPatch = m_outputMap->feedbackPatch(universe);

    Q_ASSERT(inputPatch != NULL);
    Q_ASSERT(outputPatch != NULL);

    /* Copy these so they can be applied if the user cancels */
    m_currentInputPluginName = inputPatch->pluginName();
    m_currentInput = inputPatch->input();
    m_currentProfileName = inputPatch->profileName();
    //m_currentFeedbackEnabled = inputPatch->feedbackEnabled();

    m_currentOutputPluginName = outputPatch->pluginName();
    m_currentOutput = outputPatch->output();

    m_currentFeedbackPluginName = feedbackPatch->pluginName();
    m_currentFeedback = feedbackPatch->output();

    m_mapTree->header()->setResizeMode(QHeaderView::ResizeToContents);
    m_mapTree->setSortingEnabled(true);
    m_mapTree->sortByColumn(KMapColumnPluginName, Qt::AscendingOrder);

    /* Setup UI controls */
    setupMappingPage();
    setupProfilePage();

    /* Select the top-most "None" item */
    m_mapTree->setCurrentItem(m_mapTree->topLevelItem(0));

    /* Listen to plugin configuration changes */
    connect(m_inputMap, SIGNAL(pluginConfigurationChanged(const QString&)),
            this, SLOT(slotPluginConfigurationChanged(const QString&)));
    /* Listen to plugin configuration changes */
    connect(m_outputMap, SIGNAL(pluginConfigurationChanged(const QString&)),
            this, SLOT(slotPluginConfigurationChanged(const QString&)));
}
Esempio n. 3
0
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;
    }
}
Esempio n. 4
0
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()));
	}
}
Esempio n. 5
0
void InputOutputManager::updateItem(QTreeWidgetItem* item, quint32 universe)
{
    Q_ASSERT(item != NULL);

    InputPatch* ip = m_inputMap->patch(universe);
    OutputPatch* op = m_outputMap->patch(universe);
    OutputPatch* fp = m_outputMap->feedbackPatch(universe);
    Q_ASSERT(ip != NULL);

    item->setText(KColumnUniverse, QString::number(universe + 1));
    item->setText(KColumnInput, QString("[%1] %2").arg(ip->pluginName()).arg(ip->inputName()));
    item->setText(KColumnOutput, QString("[%1] %2").arg(op->pluginName()).arg(op->outputName()));
    item->setText(KColumnFeedback, QString("[%1] %2").arg(fp->pluginName()).arg(fp->outputName()));
    item->setText(KColumnProfile, ip->profileName());
    item->setText(KColumnInputNum, QString::number(ip->input() + 1));
    item->setText(KColumnOutputNum, QString::number(op->output() + 1));

    m_tree->resizeColumnToContents(KColumnUniverse);
    m_tree->resizeColumnToContents(KColumnInput);
    m_tree->resizeColumnToContents(KColumnOutput);
    m_tree->resizeColumnToContents(KColumnProfile);
}
Esempio n. 6
0
InputOutputPatchEditor::InputOutputPatchEditor(QWidget* parent, quint32 universe, InputOutputMap *ioMap, Doc *doc)
    : QWidget(parent)
    , m_ioMap(ioMap)
    , m_doc(doc)
    , m_universe(universe)
    , m_currentInputPluginName(KInputNone)
    , m_currentInput(QLCIOPlugin::invalidLine())
    , m_currentOutputPluginName(KOutputNone)
    , m_currentOutput(QLCIOPlugin::invalidLine())
    , m_currentProfileName(KInputNone)
    , m_currentFeedbackPluginName(KOutputNone)
    , m_currentFeedback(QLCIOPlugin::invalidLine())
{
    Q_ASSERT(universe < m_ioMap->universes());
    Q_ASSERT(ioMap != NULL);

    setupUi(this);

    m_infoBrowser->setOpenExternalLinks(true);
    m_infoBrowser->setFixedHeight(250);

    InputPatch* inputPatch = m_ioMap->inputPatch(universe);
    OutputPatch* outputPatch = m_ioMap->outputPatch(universe);
    OutputPatch* feedbackPatch = m_ioMap->feedbackPatch(universe);

    /* Copy these so they can be applied if the user cancels */
    if (inputPatch != NULL)
    {
        m_currentInputPluginName = inputPatch->pluginName();
        m_currentInput = inputPatch->input();
        m_currentProfileName = inputPatch->profileName();
    }

    if (outputPatch != NULL)
    {
        m_currentOutputPluginName = outputPatch->pluginName();
        m_currentOutput = outputPatch->output();
    }

    if (feedbackPatch != NULL)
    {
        m_currentFeedbackPluginName = feedbackPatch->pluginName();
        m_currentFeedback = feedbackPatch->output();
    }

    m_mapTree->setSortingEnabled(true);
    m_mapTree->sortByColumn(KMapColumnPluginName, Qt::AscendingOrder);

    /* Setup UI controls */
    setupMappingPage();
    setupProfilePage();

    fillAudioTree();

    /* Listen to itemChanged() signals to catch check state changes */
    connect(m_audioMapTree, SIGNAL(itemChanged(QTreeWidgetItem*, int)),
            this, SLOT(slotAudioDeviceItemChanged(QTreeWidgetItem*, int)));

    /* Select the top-most "None" item */
    m_mapTree->setCurrentItem(m_mapTree->topLevelItem(0));

    /* Listen to plugin configuration changes */
    connect(m_ioMap, SIGNAL(pluginConfigurationChanged(const QString&)),
            this, SLOT(slotPluginConfigurationChanged(const QString&)));
    /* Listen to plugin configuration changes */
    connect(m_ioMap, SIGNAL(pluginConfigurationChanged(const QString&)),
            this, SLOT(slotPluginConfigurationChanged(const QString&)));
}