InputSelectionWidget::InputSelectionWidget(Doc *doc, QWidget *parent)
    : QWidget(parent)
    , m_doc(doc)
    , m_widgetPage(0)
    , m_emitOdd(false)
    , m_signalsReceived(0)
{
    Q_ASSERT(doc != NULL);

    setupUi(this);

    m_customFbButton->setVisible(false);
    m_feedbackGroup->setVisible(false);
    m_lowerSpin->setEnabled(false);
    m_upperSpin->setEnabled(false);

    connect(m_attachKey, SIGNAL(clicked()), this, SLOT(slotAttachKey()));
    connect(m_detachKey, SIGNAL(clicked()), this, SLOT(slotDetachKey()));

      m_autoDetectInputButton->setShortcut(Qt::Key_S);
      m_chooseInputButton->setShortcut(Qt::Key_C);
    connect(m_autoDetectInputButton, SIGNAL(toggled(bool)),
            this, SLOT(slotAutoDetectInputToggled(bool)));
    connect(m_chooseInputButton, SIGNAL(clicked()),
            this, SLOT(slotChooseInputClicked()));

    connect(m_customFbButton, SIGNAL(toggled(bool)),
            this, SLOT(slotCustomFeedbackToggled(bool)));
    connect(m_lowerSpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotLowerSpinValueChanged(int)));
    connect(m_upperSpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotUpperSpinValueChanged(int)));
}
AudioTriggersConfiguration::AudioTriggersConfiguration(VCAudioTriggers *triggers, Doc *doc, AudioCapture *capture)
    : QDialog(triggers)
    , m_doc(doc)
    , m_capture(capture)
{
    setupUi(this);

    Q_ASSERT(capture != NULL);

    m_triggers = triggers;

    m_nameEdit->setText(m_triggers->caption());

    m_barsNumSpin->setFixedWidth(70);
    m_barsNumSpin->setFixedHeight(30);
    m_barsNumSpin->setValue(m_capture->bandsNumber());

    connect(m_barsNumSpin, SIGNAL(valueChanged(int)),
            this, SLOT(updateTree()));

    /* Key sequence */
    m_keySequence = QKeySequence(triggers->keySequence());
    m_keyEdit->setText(m_keySequence.toString(QKeySequence::NativeText));

    /* External input */
    m_inputSource = triggers->inputSource();
    updateInputSource();

    connect(m_attachKey, SIGNAL(clicked()), this, SLOT(slotAttachKey()));
    connect(m_detachKey, SIGNAL(clicked()), this, SLOT(slotDetachKey()));

    connect(m_autoDetectInputButton, SIGNAL(toggled(bool)),
            this, SLOT(slotAutoDetectInputToggled(bool)));
    connect(m_chooseInputButton, SIGNAL(clicked()),
            this, SLOT(slotChooseInputClicked()));

    m_tree->setAlternatingRowColors(true);
    m_tree->setRootIsDecorated(false);
    m_tree->setSelectionMode(QAbstractItemView::NoSelection);
    m_tree->setAllColumnsShowFocus(true);

    updateTree();
}
VCButtonProperties::VCButtonProperties(VCButton* button, QWidget* parent)
        : QDialog(parent)
{
    Q_ASSERT(button != NULL);

    setupUi(this);

    /* Button text and function */
    m_button = button;
    m_nameEdit->setText(m_button->caption());
    slotSetFunction(button->function());

    /* Key sequence */
    m_keySequence = QKeySequence(button->keySequence());
    m_keyEdit->setText(m_keySequence.toString());

    /* External input */
    m_inputUniverse = m_button->inputUniverse();
    m_inputChannel = m_button->inputChannel();
    updateInputSource();

    connect(m_autoDetectInputButton, SIGNAL(toggled(bool)),
            this, SLOT(slotAutoDetectInputToggled(bool)));
    connect(m_chooseInputButton, SIGNAL(clicked()),
            this, SLOT(slotChooseInputClicked()));

    /* Press action */
    if (button->action() == VCButton::Toggle)
        m_toggle->setChecked(true);
    else
        m_flash->setChecked(true);

    /* Button connections */
    connect(m_attachFunction, SIGNAL(clicked()),
            this, SLOT(slotAttachFunction()));
    connect(m_detachFunction, SIGNAL(clicked()),
            this, SLOT(slotSetFunction()));
    connect(m_attachKey, SIGNAL(clicked()), this, SLOT(slotAttachKey()));
    connect(m_detachKey, SIGNAL(clicked()), this, SLOT(slotDetachKey()));
}
Beispiel #4
0
VCSliderProperties::VCSliderProperties(VCSlider* slider, Doc* doc, OutputMap* outputMap,
                                       InputMap* inputMap, MasterTimer* masterTimer)
    : QDialog(slider)
    , m_doc(doc)
    , m_outputMap(outputMap)
    , m_inputMap(inputMap)
    , m_masterTimer(masterTimer)
{
    Q_ASSERT(doc != NULL);
    Q_ASSERT(outputMap != NULL);
    Q_ASSERT(inputMap != NULL);
    Q_ASSERT(masterTimer != NULL);
    Q_ASSERT(slider != NULL);
    m_slider = slider;

    setupUi(this);

    QAction* action = new QAction(this);
    action->setShortcut(QKeySequence(QKeySequence::Close));
    connect(action, SIGNAL(triggered(bool)), this, SLOT(reject()));
    addAction(action);

    /* Bus page connections */
    connect(m_switchToBusModeButton, SIGNAL(clicked()),
            this, SLOT(slotModeBusClicked()));

    /* Level page connections */
    connect(m_levelLowLimitSpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotLevelLowSpinChanged(int)));
    connect(m_levelHighLimitSpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotLevelHighSpinChanged(int)));
    connect(m_levelCapabilityButton, SIGNAL(clicked()),
            this, SLOT(slotLevelCapabilityClicked()));
    connect(m_levelList, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotLevelListClicked(QTreeWidgetItem*)));
    connect(m_levelAllButton, SIGNAL(clicked()),
            this, SLOT(slotLevelAllClicked()));
    connect(m_levelNoneButton, SIGNAL(clicked()),
            this, SLOT(slotLevelNoneClicked()));
    connect(m_levelInvertButton, SIGNAL(clicked()),
            this, SLOT(slotLevelInvertClicked()));
    connect(m_levelByGroupButton, SIGNAL(clicked()),
            this, SLOT(slotLevelByGroupClicked()));
    connect(m_switchToLevelModeButton, SIGNAL(clicked()),
            this, SLOT(slotModeLevelClicked()));

    /* Playback page connections */
    connect(m_switchToPlaybackModeButton, SIGNAL(clicked()),
            this, SLOT(slotModePlaybackClicked()));
    connect(m_attachPlaybackFunctionButton, SIGNAL(clicked()),
            this, SLOT(slotAttachPlaybackFunctionClicked()));
    connect(m_detachPlaybackFunctionButton, SIGNAL(clicked()),
            this, SLOT(slotDetachPlaybackFunctionClicked()));

    /*********************************************************************
     * General page
     *********************************************************************/

    /* Name */
    m_nameEdit->setText(m_slider->caption());

    /* Slider mode */
    m_sliderMode = m_slider->sliderMode();
    switch (m_sliderMode)
    {
    default:
    case VCSlider::Bus:
        slotModeBusClicked();
        break;
    case VCSlider::Level:
        slotModeLevelClicked();
        break;
    case VCSlider::Playback:
        slotModePlaybackClicked();
        break;
    }

    /* Slider movement (Qt understands inverted appearance vice versa) */
    if (m_slider->invertedAppearance() == true)
        m_sliderMovementInvertedRadio->setChecked(true);
    else
        m_sliderMovementNormalRadio->setChecked(true);

    /* Value display style */
    switch (m_slider->valueDisplayStyle())
    {
    default:
    case VCSlider::ExactValue:
        m_valueExactRadio->setChecked(true);
        break;
    case VCSlider::PercentageValue:
        m_valuePercentageRadio->setChecked(true);
        break;
    }

    /********************************************************************
     * External input
     ********************************************************************/
    m_inputUniverse = m_slider->inputUniverse();
    m_inputChannel = m_slider->inputChannel();
    updateInputSource();

    connect(m_autoDetectInputButton, SIGNAL(toggled(bool)),
            this, SLOT(slotAutoDetectInputToggled(bool)));
    connect(m_chooseInputButton, SIGNAL(clicked()),
            this, SLOT(slotChooseInputClicked()));

    /*********************************************************************
     * Bus page
     *********************************************************************/

    /* Bus combo contents */
    fillBusCombo();

    /* Bus value limit spins */
    m_busLowLimitSpin->setValue(m_slider->busLowLimit());
    m_busHighLimitSpin->setValue(m_slider->busHighLimit());

    /*********************************************************************
     * Level page
     *********************************************************************/

    /* Level limit spins */
    m_levelLowLimitSpin->setValue(m_slider->levelLowLimit());
    m_levelHighLimitSpin->setValue(m_slider->levelHighLimit());

    /* Tree widget columns */
    m_levelList->header()->setResizeMode(QHeaderView::ResizeToContents);

    /* Tree widget contents */
    levelUpdateFixtures();
    levelUpdateChannelSelections();

    /*********************************************************************
     * Playback page
     *********************************************************************/

    /* Function */
    m_playbackFunctionId = m_slider->playbackFunction();
    updatePlaybackFunctionName();
}
VCSliderProperties::VCSliderProperties(VCSlider* slider, Doc* doc)
    : QDialog(slider)
    , m_doc(doc)
{
    Q_ASSERT(doc != NULL);
    Q_ASSERT(slider != NULL);
    m_slider = slider;

    setupUi(this);

    QAction* action = new QAction(this);
    action->setShortcut(QKeySequence(QKeySequence::Close));
    connect(action, SIGNAL(triggered(bool)), this, SLOT(reject()));
    addAction(action);

    /* Level page connections */
    connect(m_levelLowLimitSpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotLevelLowSpinChanged(int)));
    connect(m_levelHighLimitSpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotLevelHighSpinChanged(int)));
    connect(m_levelCapabilityButton, SIGNAL(clicked()),
            this, SLOT(slotLevelCapabilityClicked()));
    connect(m_levelList, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotLevelListClicked(QTreeWidgetItem*)));
    connect(m_levelAllButton, SIGNAL(clicked()),
            this, SLOT(slotLevelAllClicked()));
    connect(m_levelNoneButton, SIGNAL(clicked()),
            this, SLOT(slotLevelNoneClicked()));
    connect(m_levelInvertButton, SIGNAL(clicked()),
            this, SLOT(slotLevelInvertClicked()));
    connect(m_levelByGroupButton, SIGNAL(clicked()),
            this, SLOT(slotLevelByGroupClicked()));
    connect(m_switchToLevelModeButton, SIGNAL(clicked()),
            this, SLOT(slotModeLevelClicked()));

    /* Playback page connections */
    connect(m_switchToPlaybackModeButton, SIGNAL(clicked()),
            this, SLOT(slotModePlaybackClicked()));
    connect(m_attachPlaybackFunctionButton, SIGNAL(clicked()),
            this, SLOT(slotAttachPlaybackFunctionClicked()));
    connect(m_detachPlaybackFunctionButton, SIGNAL(clicked()),
            this, SLOT(slotDetachPlaybackFunctionClicked()));

    /* Submaster page connections */
    connect(m_switchToSubmasterModeButton, SIGNAL(clicked()),
            this, SLOT(slotModeSubmasterClicked()));

    /*********************************************************************
     * General page
     *********************************************************************/

    /* Name */
    m_nameEdit->setText(m_slider->caption());

    /* Widget appearance */
    if (m_slider->widgetStyle() == VCSlider::WKnob)
        m_widgetKnobRadio->setChecked(true);
    else
        m_widgetSliderRadio->setChecked(true);

    /* Slider mode */
    m_sliderMode = m_slider->sliderMode();
    switch (m_sliderMode)
    {
    default:
    case VCSlider::Level:
        slotModeLevelClicked();
        break;
    case VCSlider::Playback:
        slotModePlaybackClicked();
        break;
    case VCSlider::Submaster:
        slotModeSubmasterClicked();
        break;
    }

    /* Slider movement (Qt understands inverted appearance vice versa) */
    if (m_slider->invertedAppearance() == true)
        m_sliderMovementInvertedRadio->setChecked(true);
    else
        m_sliderMovementNormalRadio->setChecked(true);

    /* Value display style */
    switch (m_slider->valueDisplayStyle())
    {
    default:
    case VCSlider::ExactValue:
        m_valueExactRadio->setChecked(true);
        break;
    case VCSlider::PercentageValue:
        m_valuePercentageRadio->setChecked(true);
        break;
    }

    /********************************************************************
     * External input
     ********************************************************************/
    m_inputSource = m_slider->inputSource();
    updateInputSource();

    connect(m_autoDetectInputButton, SIGNAL(toggled(bool)),
            this, SLOT(slotAutoDetectInputToggled(bool)));
    connect(m_chooseInputButton, SIGNAL(clicked()),
            this, SLOT(slotChooseInputClicked()));

    /*********************************************************************
     * Level page
     *********************************************************************/

    /* Level limit spins */
    m_levelLowLimitSpin->setValue(m_slider->levelLowLimit());
    m_levelHighLimitSpin->setValue(m_slider->levelHighLimit());

    /* Tree widget contents */
    levelUpdateFixtures();
    levelUpdateChannelSelections();

    connect(m_levelList, SIGNAL(expanded(QModelIndex)),
            this, SLOT(slotItemExpanded()));
    connect(m_levelList, SIGNAL(collapsed(QModelIndex)),
            this, SLOT(slotItemExpanded()));

    m_monitorValuesCheck->setChecked(m_slider->channelsMonitorEnabled());

    /*********************************************************************
     * Playback page
     *********************************************************************/

    /* Function */
    m_playbackFunctionId = m_slider->playbackFunction();
    updatePlaybackFunctionName();


}
Beispiel #6
0
VCSliderProperties::VCSliderProperties(QWidget* parent, VCSlider* slider)
	: QDialog(parent)
{
	Q_ASSERT(slider != NULL);
	m_slider = slider;

	setupUi(this);

	/* General page connections */
	connect(m_modeBusRadio, SIGNAL(clicked()),
		this, SLOT(slotModeBusClicked()));
	connect(m_modeLevelRadio, SIGNAL(clicked()),
		this, SLOT(slotModeLevelClicked()));
	connect(m_modeSubmasterRadio, SIGNAL(clicked()),
		this, SLOT(slotModeSubmasterClicked()));

	/* Level page connections */
	connect(m_levelLowLimitSpin, SIGNAL(valueChanged(int)),
		this, SLOT(slotLevelLowSpinChanged(int)));
	connect(m_levelHighLimitSpin, SIGNAL(valueChanged(int)),
		this, SLOT(slotLevelHighSpinChanged(int)));
	connect(m_levelCapabilityButton, SIGNAL(clicked()),
		this, SLOT(slotLevelCapabilityButtonClicked()));
	connect(m_levelList, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
		this, SLOT(slotLevelListClicked(QTreeWidgetItem*)));
	connect(m_levelAllButton, SIGNAL(clicked()),
		this, SLOT(slotLevelAllClicked()));
	connect(m_levelNoneButton, SIGNAL(clicked()),
		this, SLOT(slotLevelNoneClicked()));
	connect(m_levelInvertButton, SIGNAL(clicked()),
		this, SLOT(slotLevelInvertClicked()));
	connect(m_levelByGroupButton, SIGNAL(clicked()),
		this, SLOT(slotLevelByGroupClicked()));

	/*********************************************************************
	 * General page
	 *********************************************************************/

	/* Name */
	m_nameEdit->setText(m_slider->caption());

	/* Slider mode */
	switch (m_slider->sliderMode())
	{
	default:
	case VCSlider::Bus:
		m_modeBusRadio->setChecked(true);
		slotModeBusClicked();
		break;
	case VCSlider::Level:
		m_modeLevelRadio->setChecked(true);
		slotModeLevelClicked();
		break;
	case VCSlider::Submaster:
		m_modeSubmasterRadio->setChecked(true);
		slotModeLevelClicked();
		break;
	}

	/* Slider movement (Qt understands inverted appearance vice versa) */
	if (m_slider->invertedAppearance() == true)
		m_sliderMovementInvertedRadio->setChecked(true);
	else
		m_sliderMovementNormalRadio->setChecked(true);

	/* Value display style */
	switch (m_slider->valueDisplayStyle())
	{
	default:
	case VCSlider::ExactValue:
		m_valueExactRadio->setChecked(true);
		break;
	case VCSlider::PercentageValue:
		m_valuePercentageRadio->setChecked(true);
		break;
	}

	/********************************************************************
	 * External input
	 ********************************************************************/
	m_inputUniverse = m_slider->inputUniverse();
	m_inputChannel = m_slider->inputChannel();
	updateInputUniverseChannel();

	connect(m_chooseInputButton, SIGNAL(clicked()),
		this, SLOT(slotChooseInputClicked()));

	/*********************************************************************
	 * Bus page
	 *********************************************************************/

	/* Bus combo contents */
	fillBusCombo();

	/* Bus value limit spins */
	m_busLowLimitSpin->setValue(m_slider->busLowLimit());
	m_busHighLimitSpin->setValue(m_slider->busHighLimit());

	/*********************************************************************
	 * Level page
	 *********************************************************************/

	/* Level limit spins */
	m_levelLowLimitSpin->setValue(m_slider->levelLowLimit());
	m_levelHighLimitSpin->setValue(m_slider->levelHighLimit());

	/* Tree widget columns */
	QStringList labels;
	labels << "Name" << "Type" << "Range";
	m_levelList->setHeaderLabels(labels);
	m_levelList->header()->setResizeMode(QHeaderView::ResizeToContents);

	/* Tree widget contents */
	levelUpdateFixtures();
	levelUpdateChannelSelections();
}
Beispiel #7
0
VCButtonProperties::VCButtonProperties(VCButton* button, Doc* doc, OutputMap* outputMap,
                                       InputMap* inputMap, MasterTimer* masterTimer)
    : QDialog(button)
    , m_doc(doc)
    , m_outputMap(outputMap)
    , m_inputMap(inputMap)
    , m_masterTimer(masterTimer)
{
    Q_ASSERT(button != NULL);
    Q_ASSERT(doc != NULL);
    Q_ASSERT(outputMap != NULL);
    Q_ASSERT(inputMap != NULL);
    Q_ASSERT(masterTimer != NULL);

    setupUi(this);

    QAction* action = new QAction(this);
    action->setShortcut(QKeySequence(QKeySequence::Close));
    connect(action, SIGNAL(triggered(bool)), this, SLOT(reject()));
    addAction(action);

    /* Button text and function */
    m_button = button;
    m_nameEdit->setText(m_button->caption());
    slotSetFunction(button->function());

    /* Key sequence */
    m_keySequence = QKeySequence(button->keySequence());
    m_keyEdit->setText(m_keySequence.toString(QKeySequence::NativeText));

    /* External input */
    m_inputUniverse = m_button->inputUniverse();
    m_inputChannel = m_button->inputChannel();
    updateInputSource();

    /* Press action */
    if (button->action() == VCButton::Toggle)
        m_toggle->setChecked(true);
    else
        m_flash->setChecked(true);

    /* Intensity adjustment */
    m_intensityEdit->setValidator(new QIntValidator(0, 100, this));
    m_intensityGroup->setChecked(m_button->adjustIntensity());
    int intensity = int(floor(m_button->intensityAdjustment() * double(100)));
    m_intensityEdit->setText(QString::number(intensity));
    m_intensitySlider->setValue(intensity);

    /* Button connections */
    connect(m_attachFunction, SIGNAL(clicked()),
            this, SLOT(slotAttachFunction()));
    connect(m_detachFunction, SIGNAL(clicked()),
            this, SLOT(slotSetFunction()));
    connect(m_attachKey, SIGNAL(clicked()), this, SLOT(slotAttachKey()));
    connect(m_detachKey, SIGNAL(clicked()), this, SLOT(slotDetachKey()));
    connect(m_autoDetectInputButton, SIGNAL(toggled(bool)),
            this, SLOT(slotAutoDetectInputToggled(bool)));
    connect(m_chooseInputButton, SIGNAL(clicked()),
            this, SLOT(slotChooseInputClicked()));
    connect(m_intensitySlider, SIGNAL(valueChanged(int)),
            this, SLOT(slotIntensitySliderMoved(int)));
    connect(m_intensityEdit, SIGNAL(textEdited(QString)),
            this, SLOT(slotIntensityEdited(QString)));
}