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())); }
VCMatrixProperties::VCMatrixProperties(VCMatrix* matrix, Doc* doc) : QDialog(matrix) , m_doc(doc) { Q_ASSERT(matrix != NULL); Q_ASSERT(doc != NULL); setupUi(this); m_lastAssignedID = 0; /* Matrix text and function */ m_matrix = matrix; m_nameEdit->setText(m_matrix->caption()); slotSetFunction(m_matrix->function()); if (m_matrix->instantChanges()) m_instantCheck->setChecked(true); /* Matrix connections */ connect(m_attachFunction, SIGNAL(clicked()), this, SLOT(slotAttachFunction())); connect(m_detachFunction, SIGNAL(clicked()), this, SLOT(slotSetFunction())); /* Slider external input */ m_sliderInputSource = m_matrix->inputSource(); updateSliderInputSource(); connect(m_autoDetectInputButton, SIGNAL(toggled(bool)), this, SLOT(slotAutoDetectSliderInputToggled(bool))); connect(m_chooseInputButton, SIGNAL(clicked()), this, SLOT(slotChooseSliderInputClicked())); /* Custom controls */ foreach(const VCMatrixControl *control, m_matrix->customControls()) { m_controls.append(new VCMatrixControl(*control)); if (control->m_id > m_lastAssignedID) m_lastAssignedID = control->m_id; } m_controlsTree->setSelectionMode(QAbstractItemView::SingleSelection); updateTree(); connect(m_controlsTree, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(slotTreeSelectionChanged())); connect(m_addStartColorButton, SIGNAL(clicked()), this, SLOT(slotAddStartColorClicked())); connect(m_addStartColorKnobsButton, SIGNAL(clicked()), this, SLOT(slotAddStartColorKnobsClicked())); connect(m_addEndColorButton, SIGNAL(clicked()), this, SLOT(slotAddEndColorClicked())); connect(m_addEndColorKnobsButton, SIGNAL(clicked()), this, SLOT(slotAddEndColorKnobsClicked())); connect(m_addEndColorResetButton, SIGNAL(clicked()), this, SLOT(slotAddEndColorResetClicked())); connect(m_addPresetButton, SIGNAL(clicked()), this, SLOT(slotAddAnimationClicked())); connect(m_addTextButton, SIGNAL(clicked()), this, SLOT(slotAddTextClicked())); connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveClicked())); connect(m_adControlInputButton, SIGNAL(toggled(bool)), this, SLOT(slotAutoDetectControlInputToggled(bool))); connect(m_chooseControlInputButton, SIGNAL(clicked()), this, SLOT(slotChooseControlInputClicked())); connect(m_attachKey, SIGNAL(clicked()), this, SLOT(slotAttachKey())); connect(m_detachKey, SIGNAL(clicked()), this, SLOT(slotDetachKey())); quint32 visibilityMask = m_matrix->visibilityMask(); if (visibilityMask & VCMatrix::ShowSlider) m_sliderCheck->setChecked(true); if (visibilityMask & VCMatrix::ShowLabel) m_labelCheck->setChecked(true); if (visibilityMask & VCMatrix::ShowStartColorButton) m_startColorButtonCheck->setChecked(true); if (visibilityMask & VCMatrix::ShowEndColorButton) m_endColorButtonCheck->setChecked(true); if (visibilityMask & VCMatrix::ShowPresetCombo) m_presetComboCheck->setChecked(true); }
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))); }