RundownBlendWidget::RundownBlendWidget(const LibraryModel& model, QWidget* parent, const QString& color, bool active, bool inGroup, bool disconnected) : QWidget(parent), active(active), inGroup(inGroup), disconnected(disconnected), color(color), model(model) { setupUi(this); setActive(active); this->labelDisconnected->setVisible(this->disconnected); this->labelGroupColor->setVisible(this->inGroup); this->labelGroupColor->setStyleSheet(QString("background-color: %1;").arg(Color::DEFAULT_GROUP_COLOR)); this->labelColor->setStyleSheet(QString("background-color: %1;").arg(color)); this->labelName->setText(this->model.getName()); this->labelChannel->setText(QString("Channel: %1").arg(this->command.getChannel())); this->labelVideolayer->setText(QString("Videolayer: %1").arg(this->command.getVideolayer())); this->labelDelay->setText(QString("Delay: %1").arg(this->command.getDelay())); this->labelDevice->setText(QString("Device: %1").arg(this->model.getDeviceName())); QObject::connect(&this->command, SIGNAL(channelChanged(int)), this, SLOT(channelChanged(int))); QObject::connect(&this->command, SIGNAL(videolayerChanged(int)), this, SLOT(videolayerChanged(int))); QObject::connect(&this->command, SIGNAL(delayChanged(int)), this, SLOT(delayChanged(int))); QObject::connect(&this->command, SIGNAL(allowGpiChanged(bool)), this, SLOT(allowGpiChanged(bool))); QObject::connect(GpiManager::getInstance().getGpiDevice().data(), SIGNAL(connectionStateChanged(bool, GpiDevice*)), this, SLOT(gpiDeviceConnected(bool, GpiDevice*))); checkEmptyDevice(); checkGpiTriggerable(); qApp->installEventFilter(this); }
bool RundownMediaWidget::eventFilter(QObject* target, QEvent* event) { if (event->type() == static_cast<QEvent::Type>(Enum::EventType::ConnectionStateChanged)) { ConnectionStateChangedEvent* connectionStateChangedEvent = dynamic_cast<ConnectionStateChangedEvent*>(event); if (connectionStateChangedEvent->getDeviceName() == this->model.getDeviceName()) { this->disconnected = !connectionStateChangedEvent->getConnected(); if (connectionStateChangedEvent->getConnected()) this->labelDisconnected->setVisible(false); else this->labelDisconnected->setVisible(true); } } else if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemChanged)) { // This event is not for us. if (!this->active) return false; RundownItemChangedEvent* rundownItemChangedEvent = dynamic_cast<RundownItemChangedEvent*>(event); this->model.setName(rundownItemChangedEvent->getName()); this->model.setDeviceName(rundownItemChangedEvent->getDeviceName()); this->command.setMediaName(rundownItemChangedEvent->getName()); this->labelName->setText(this->model.getName()); this->labelDevice->setText(QString("Device: %1").arg(this->model.getDeviceName())); checkEmptyDevice(); } return QObject::eventFilter(target, event); }
void InspectorMetadataWidget::deviceNameChanged(QString deviceName) { if (this->comboBoxDevice->isEnabled()) checkEmptyDevice(); if (this->comboBoxDevice->isEnabled()) qApp->postEvent(qApp, new RundownItemChangedEvent(this->lineEditLabel->text(), this->lineEditName->text(), this->comboBoxDevice->currentText())); }
void InspectorOutputWidget::tricasterDeviceNameChanged(QString deviceName) { checkEmptyDevice(); checkEmptyTriCasterDevice(); checkEmptyTarget(); EventManager::getInstance().fireDeviceChangedEvent(this->comboBoxTriCasterDevice->currentText()); }
void InspectorOutputWidget::deviceNameChanged(QString deviceName) { const QStringList& channelFormats = DatabaseManager::getInstance().getDeviceByName(deviceName).getChannelFormats().split(","); this->spinBoxChannel->setMaximum(channelFormats.count()); checkEmptyDevice(); checkEmptyTarget(); EventManager::getInstance().fireDeviceChangedEvent(this->comboBoxDevice->currentText()); }
RundownMediaWidget::RundownMediaWidget(const LibraryModel& model, QWidget* parent, const QString& color, bool active, bool loaded, bool paused, bool playing, bool inGroup, bool disconnected) : QWidget(parent), active(active), loaded(loaded), paused(paused), playing(playing), inGroup(inGroup), disconnected(disconnected), color(color), model(model) { setupUi(this); setActive(active); this->command.setMediaName(this->model.getName()); this->labelDisconnected->setVisible(this->disconnected); this->labelGroupColor->setVisible(inGroup); this->labelGroupColor->setStyleSheet(QString("background-color: %1;").arg(Color::DEFAULT_GROUP_COLOR)); this->labelColor->setStyleSheet(QString("background-color: %1;").arg(color)); this->labelName->setText(this->model.getName()); this->labelChannel->setText(QString("Channel: %1").arg(this->command.getChannel())); this->labelVideolayer->setText(QString("Videolayer: %1").arg(this->command.getVideolayer())); this->labelDelay->setText(QString("Delay: %1").arg(this->command.getDelay())); this->labelDevice->setText(QString("Device: %1").arg(this->model.getDeviceName())); if (this->model.getType() == "AUDIO") this->labelThumbnail->setPixmap(QPixmap(":/Graphics/Images/Audio.png")); else if (this->model.getType() == "STILL") this->labelThumbnail->setPixmap(QPixmap(":/Graphics/Images/Still.png")); else if (this->model.getType() == "MOVIE") this->labelThumbnail->setPixmap(QPixmap(":/Graphics/Images/Movie.png")); QObject::connect(&this->command, SIGNAL(channelChanged(int)), this, SLOT(channelChanged(int))); QObject::connect(&this->command, SIGNAL(videolayerChanged(int)), this, SLOT(videolayerChanged(int))); QObject::connect(&this->command, SIGNAL(delayChanged(int)), this, SLOT(delayChanged(int))); QObject::connect(&this->command, SIGNAL(allowGpiChanged(bool)), this, SLOT(allowGpiChanged(bool))); QObject::connect(GpiManager::getInstance().getGpiDevice().data(), SIGNAL(connectionStateChanged(bool, GpiDevice*)), this, SLOT(gpiDeviceConnected(bool, GpiDevice*))); checkEmptyDevice(); checkGpiTriggerable(); qApp->installEventFilter(this); }
void InspectorOutputWidget::deviceChanged(const DeviceChangedEvent& event) { if (this->model == NULL) return; blockAllSignals(true); if (!event.getDeviceName().isEmpty()) { this->model->setDeviceName(event.getDeviceName()); fillTargetCombo(this->model->getType()); } checkEmptyDevice(); checkEmptyAtemDevice(); checkEmptyTriCasterDevice(); checkEmptyTarget(); blockAllSignals(false); }
void InspectorOutputWidget::emptyRundown(const EmptyRundownEvent& event) { blockAllSignals(true); this->comboBoxDevice->setVisible(true); this->comboBoxAtemDevice->setVisible(false); this->comboBoxTriCasterDevice->setVisible(false); this->comboBoxDevice->setEnabled(false); this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->spinBoxDelay->setEnabled(false); this->checkBoxAllowGpi->setEnabled(false); this->checkBoxAllowRemoteTriggering->setEnabled(false); this->labelRemoteTriggerId->setEnabled(false); this->lineEditRemoteTriggerId->setEnabled(false); this->labelMillisecond->setText(""); this->labelMillisecond->setVisible(false); this->comboBoxDevice->setCurrentIndex(-1); this->comboBoxAtemDevice->setCurrentIndex(-1); this->comboBoxTriCasterDevice->setCurrentIndex(-1); this->comboBoxTarget->clear(); this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); this->spinBoxDelay->setValue(Output::DEFAULT_DELAY); this->checkBoxAllowGpi->setChecked(Output::DEFAULT_ALLOW_GPI); this->checkBoxAllowRemoteTriggering->setChecked(Output::DEFAULT_ALLOW_REMOTE_TRIGGERING); this->lineEditRemoteTriggerId->setText(Output::DEFAULT_REMOTE_TRIGGER_ID); checkEmptyDevice(); checkEmptyAtemDevice(); checkEmptyTriCasterDevice(); checkEmptyTarget(); blockAllSignals(false); }
void InspectorOutputWidget::libraryItemSelected(const LibraryItemSelectedEvent& event) { this->model = event.getLibraryModel(); blockAllSignals(true); this->comboBoxDevice->setVisible(true); this->comboBoxAtemDevice->setVisible(false); this->comboBoxTriCasterDevice->setVisible(false); this->comboBoxDevice->setEnabled(false); this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->spinBoxDelay->setEnabled(false); this->checkBoxAllowGpi->setEnabled(false); this->checkBoxAllowRemoteTriggering->setEnabled(false); this->labelRemoteTriggerId->setEnabled(false); this->lineEditRemoteTriggerId->setEnabled(false); this->labelMillisecond->setText(""); this->labelMillisecond->setVisible(false); this->comboBoxDevice->setCurrentIndex(this->comboBoxDevice->findText(this->model->getDeviceName())); this->comboBoxAtemDevice->setCurrentIndex(this->comboBoxAtemDevice->findText(this->model->getDeviceName())); this->comboBoxTriCasterDevice->setCurrentIndex(this->comboBoxTriCasterDevice->findText(this->model->getDeviceName())); this->checkBoxAllowGpi->setChecked(Output::DEFAULT_ALLOW_GPI); this->checkBoxAllowRemoteTriggering->setChecked(Output::DEFAULT_ALLOW_REMOTE_TRIGGERING); this->lineEditRemoteTriggerId->setText(Output::DEFAULT_REMOTE_TRIGGER_ID); fillTargetCombo(this->model->getType()); checkEmptyDevice(); checkEmptyAtemDevice(); checkEmptyTriCasterDevice(); checkEmptyTarget(); blockAllSignals(false); }
void InspectorOutputWidget::rundownItemSelected(const RundownItemSelectedEvent& event) { this->model = event.getLibraryModel(); blockAllSignals(true); this->comboBoxDevice->setVisible(true); this->comboBoxAtemDevice->setVisible(false); this->comboBoxTriCasterDevice->setVisible(false); this->comboBoxDevice->setEnabled(true); this->comboBoxTarget->setEnabled(true); this->spinBoxChannel->setEnabled(true); this->spinBoxVideolayer->setEnabled(true); this->spinBoxDelay->setEnabled(true); this->checkBoxAllowGpi->setEnabled(true); this->checkBoxAllowRemoteTriggering->setEnabled(true); this->labelRemoteTriggerId->setEnabled(true); this->lineEditRemoteTriggerId->setEnabled(true); this->labelMillisecond->setVisible(true); if (this->delayType == Output::DEFAULT_DELAY_IN_FRAMES) this->labelMillisecond->setText("frm"); else if (this->delayType == Output::DEFAULT_DELAY_IN_MILLISECONDS) this->labelMillisecond->setText("ms"); if (event.getCommand() != NULL && event.getLibraryModel() != NULL) { this->command = event.getCommand(); int index = this->comboBoxDevice->findText(this->model->getDeviceName()); if (index == -1) this->spinBoxChannel->setMaximum(1); else { const QStringList& channelFormats = DatabaseManager::getInstance().getDeviceByName(this->model->getDeviceName()).getChannelFormats().split(","); this->spinBoxChannel->setMaximum(channelFormats.count()); } this->comboBoxDevice->setCurrentIndex(index); this->comboBoxAtemDevice->setCurrentIndex(this->comboBoxAtemDevice->findText(this->model->getDeviceName())); this->comboBoxTriCasterDevice->setCurrentIndex(this->comboBoxTriCasterDevice->findText(this->model->getDeviceName())); this->spinBoxChannel->setValue(this->command->getChannel()); this->spinBoxVideolayer->setValue(this->command->getVideolayer()); this->spinBoxDelay->setValue(this->command->getDelay()); this->checkBoxAllowGpi->setChecked(this->command->getAllowGpi()); this->checkBoxAllowRemoteTriggering->setChecked(this->command->getAllowRemoteTriggering()); this->lineEditRemoteTriggerId->setText(this->command->getRemoteTriggerId()); if (!this->checkBoxAllowRemoteTriggering->isChecked()) { this->labelRemoteTriggerId->setEnabled(false); this->lineEditRemoteTriggerId->setEnabled(false); } fillTargetCombo(this->model->getType()); if (dynamic_cast<CommitCommand*>(event.getCommand()) || dynamic_cast<PrintCommand*>(event.getCommand()) || dynamic_cast<FileRecorderCommand*>(event.getCommand()) || dynamic_cast<GridCommand*>(event.getCommand())) { this->comboBoxTarget->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); } else if (dynamic_cast<GroupCommand*>(event.getCommand())) { this->comboBoxDevice->setEnabled(false); this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->spinBoxDelay->setEnabled(false); this->labelMillisecond->setText("ms"); this->comboBoxDevice->setCurrentIndex(-1); this->comboBoxTarget->setCurrentIndex(-1); this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); this->spinBoxDelay->setValue(Output::DEFAULT_DELAY); } else if (dynamic_cast<GpiOutputCommand*>(event.getCommand()) || dynamic_cast<OscOutputCommand*>(event.getCommand())) { this->comboBoxDevice->setEnabled(false); this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->labelMillisecond->setText("ms"); this->comboBoxDevice->setCurrentIndex(-1); this->comboBoxTarget->setCurrentIndex(-1); this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); } else if (dynamic_cast<SeparatorCommand*>(event.getCommand())) { this->comboBoxDevice->setEnabled(false); this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->spinBoxDelay->setEnabled(false); this->checkBoxAllowGpi->setEnabled(false); this->checkBoxAllowRemoteTriggering->setEnabled(false); this->labelRemoteTriggerId->setEnabled(false); this->lineEditRemoteTriggerId->setEnabled(false); this->comboBoxDevice->setCurrentIndex(-1); this->comboBoxTarget->setCurrentIndex(-1); this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); this->spinBoxDelay->setValue(Output::DEFAULT_DELAY); this->checkBoxAllowGpi->setChecked(Output::DEFAULT_ALLOW_GPI); this->checkBoxAllowRemoteTriggering->setChecked(Output::DEFAULT_ALLOW_REMOTE_TRIGGERING); this->lineEditRemoteTriggerId->setText(Output::DEFAULT_REMOTE_TRIGGER_ID); } else if (dynamic_cast<CustomCommand*>(event.getCommand())) { this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->comboBoxTarget->clear(); this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); } else if (dynamic_cast<DeckLinkInputCommand*>(event.getCommand()) || dynamic_cast<BlendModeCommand*>(event.getCommand()) || dynamic_cast<BrightnessCommand*>(event.getCommand()) || dynamic_cast<ContrastCommand*>(event.getCommand()) || dynamic_cast<CropCommand*>(event.getCommand()) || dynamic_cast<GeometryCommand*>(event.getCommand()) || dynamic_cast<KeyerCommand*>(event.getCommand()) || dynamic_cast<LevelsCommand*>(event.getCommand()) || dynamic_cast<OpacityCommand*>(event.getCommand()) || dynamic_cast<SaturationCommand*>(event.getCommand()) || dynamic_cast<VolumeCommand*>(event.getCommand()) || dynamic_cast<SolidColorCommand*>(event.getCommand()) || dynamic_cast<ClearOutputCommand*>(event.getCommand()) || dynamic_cast<ChromaCommand*>(event.getCommand())) { this->comboBoxTarget->setEnabled(false); } else if (dynamic_cast<InputCommand*>(event.getCommand()) || dynamic_cast<PresetCommand*>(event.getCommand()) || dynamic_cast<AutoCommand*>(event.getCommand()) || dynamic_cast<TakeCommand*>(event.getCommand()) || dynamic_cast<NetworkSourceCommand*>(event.getCommand()) || dynamic_cast<MacroCommand*>(event.getCommand())) { this->comboBoxDevice->setVisible(false); this->comboBoxAtemDevice->setVisible(false); this->comboBoxTriCasterDevice->setVisible(true); this->comboBoxDevice->setCurrentIndex(-1); this->comboBoxAtemDevice->setCurrentIndex(-1); this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->labelMillisecond->setText("ms"); this->comboBoxTarget->clear(); this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); } else if (dynamic_cast<AtemInputCommand*>(event.getCommand()) || dynamic_cast<AtemCutCommand*>(event.getCommand()) || dynamic_cast<AtemAutoCommand*>(event.getCommand()) || dynamic_cast<AtemKeyerStateCommand*>(event.getCommand()) || dynamic_cast<AtemVideoFormatCommand*>(event.getCommand()) || dynamic_cast<AtemAudioInputStateCommand*>(event.getCommand()) || dynamic_cast<AtemAudioGainCommand*>(event.getCommand()) || dynamic_cast<AtemAudioInputBalanceCommand*>(event.getCommand())) { this->comboBoxDevice->setVisible(false); this->comboBoxAtemDevice->setVisible(true); this->comboBoxTriCasterDevice->setVisible(false); this->comboBoxDevice->setCurrentIndex(-1); this->comboBoxTriCasterDevice->setCurrentIndex(-1); this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->labelMillisecond->setText("ms"); this->comboBoxTarget->clear(); this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); } } checkEmptyDevice(); checkEmptyAtemDevice(); checkEmptyTriCasterDevice(); checkEmptyTarget(); blockAllSignals(false); }
bool InspectorMetadataWidget::eventFilter(QObject* target, QEvent* event) { if (event->type() == static_cast<QEvent::Type>(Enum::EventType::LibraryItemSelected)) { this->preview = false; this->lineEditLabel->setReadOnly(true); this->comboBoxDevice->setEnabled(false); this->lineEditName->setReadOnly(true); LibraryItemSelectedEvent* libraryItemSelectedEvent = dynamic_cast<LibraryItemSelectedEvent*>(event); this->model = libraryItemSelectedEvent->getLibraryModel(); this->lineEditLabel->clear(); this->lineEditType->setText(this->model->getType()); this->comboBoxDevice->setCurrentIndex(this->comboBoxDevice->findText(this->model->getDeviceName())); this->lineEditName->setText(this->model->getName()); checkEmptyDevice(); this->preview = true; } else if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected)) { this->preview = false; RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event); this->model = rundownItemSelectedEvent->getLibraryModel(); this->lineEditLabel->setReadOnly(false); this->comboBoxDevice->setEnabled(true); this->lineEditName->setReadOnly(false); this->lineEditName->setEnabled(true); this->lineEditType->setText(this->model->getType()); this->lineEditLabel->setText(this->model->getLabel()); this->comboBoxDevice->setCurrentIndex(this->comboBoxDevice->findText(this->model->getDeviceName())); this->lineEditName->setText(this->model->getName()); if (dynamic_cast<GpiOutputCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<GroupCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<SeparatorCommand*>(rundownItemSelectedEvent->getCommand())) { this->comboBoxDevice->setEnabled(false); this->lineEditName->setEnabled(false); } else if (dynamic_cast<PrintCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<FileRecorderCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<DeckLinkInputCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<BlendModeCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<ChromaCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<BrightnessCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<CommitCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<ContrastCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<CropCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<GeometryCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<GridCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<KeyerCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<LevelsCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<OpacityCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<SaturationCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<VolumeCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<ColorProducerCommand*>(rundownItemSelectedEvent->getCommand())) { this->lineEditName->setEnabled(false); } checkEmptyDevice(); this->preview = true; } else if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownIsEmpty)) { this->preview = false; this->lineEditLabel->setReadOnly(true); this->comboBoxDevice->setEnabled(false); this->lineEditName->setReadOnly(true); this->lineEditType->clear(); this->lineEditLabel->clear(); this->comboBoxDevice->setCurrentIndex(-1); this->lineEditName->clear(); checkEmptyDevice(); this->preview = true; } return QObject::eventFilter(target, event); }
bool InspectorOutputWidget::eventFilter(QObject* target, QEvent* event) { if (event->type() == static_cast<QEvent::Type>(Event::EventType::LibraryItemSelected)) { LibraryItemSelectedEvent* libraryItemSelectedEvent = dynamic_cast<LibraryItemSelectedEvent*>(event); this->model = libraryItemSelectedEvent->getLibraryModel(); blockAllSignals(true); this->comboBoxDevice->setEnabled(false); this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->spinBoxDelay->setEnabled(false); this->comboBoxDevice->setCurrentIndex(this->comboBoxDevice->findText(this->model->getDeviceName())); fillTargetCombo(this->model->getType()); checkEmptyDevice(); checkEmptyTarget(); blockAllSignals(false); } else if (event->type() == static_cast<QEvent::Type>(Event::EventType::EmptyRundown)) { blockAllSignals(true); this->comboBoxDevice->setEnabled(false); this->comboBoxDevice->setCurrentIndex(-1); this->comboBoxTarget->setEnabled(false); this->comboBoxTarget->clear(); checkEmptyDevice(); checkEmptyTarget(); blockAllSignals(false); } else if (event->type() == static_cast<QEvent::Type>(Event::EventType::RundownItemSelected)) { RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event); this->model = rundownItemSelectedEvent->getLibraryModel(); blockAllSignals(true); this->comboBoxDevice->setEnabled(true); this->comboBoxTarget->setEnabled(true); this->spinBoxChannel->setEnabled(true); this->spinBoxVideolayer->setEnabled(true); this->spinBoxDelay->setEnabled(true); if (rundownItemSelectedEvent->getCommand() != NULL && rundownItemSelectedEvent->getLibraryModel() != NULL) { this->command = rundownItemSelectedEvent->getCommand(); this->comboBoxDevice->setEnabled(true); this->comboBoxTarget->setEnabled(true); this->spinBoxChannel->setEnabled(true); this->spinBoxVideolayer->setEnabled(true); int index = this->comboBoxDevice->findText(this->model->getDeviceName()); if (index == -1) this->spinBoxChannel->setMaximum(1); else { const QStringList& channelFormats = DatabaseManager::getInstance().getDeviceByName(this->model->getDeviceName()).getChannelFormats().split(","); this->spinBoxChannel->setMaximum(channelFormats.count()); } this->comboBoxDevice->setCurrentIndex(index); this->spinBoxChannel->setValue(this->command->getChannel()); this->spinBoxVideolayer->setValue(this->command->getVideolayer()); this->spinBoxDelay->setValue(this->command->getDelay()); this->checkBoxAllowGpi->setChecked(this->command->getAllowGpi()); fillTargetCombo(this->model->getType()); if (dynamic_cast<CommitCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<PrintCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<FileRecorderCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<GridCommand*>(rundownItemSelectedEvent->getCommand())) { this->comboBoxTarget->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); } else if (dynamic_cast<GroupCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<SeparatorCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<GpiOutputCommand*>(rundownItemSelectedEvent->getCommand())) { this->comboBoxDevice->setEnabled(false); this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->spinBoxDelay->setEnabled(false); this->comboBoxDevice->setCurrentIndex(-1); this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); this->spinBoxDelay->setValue(Output::DEFAULT_DELAY); this->checkBoxAllowGpi->setChecked(Output::DEFAULT_ALLOW_GPI); } else if (dynamic_cast<CustomCommand*>(rundownItemSelectedEvent->getCommand())) { this->comboBoxTarget->setEnabled(false); this->spinBoxChannel->setEnabled(false); this->spinBoxVideolayer->setEnabled(false); this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL); this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER); } else if (dynamic_cast<DeckLinkInputCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<BlendModeCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<BrightnessCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<ContrastCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<CropCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<GeometryCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<KeyerCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<LevelsCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<OpacityCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<SaturationCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<VolumeCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<SolidColorCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<ClearOutputCommand*>(rundownItemSelectedEvent->getCommand()) || dynamic_cast<ChromaCommand*>(rundownItemSelectedEvent->getCommand())) { this->comboBoxTarget->setEnabled(false); } } checkEmptyDevice(); checkEmptyTarget(); blockAllSignals(false); } else if (event->type() == static_cast<QEvent::Type>(Event::EventType::DeviceChanged)) { if (this->model == NULL) return false; blockAllSignals(true); DeviceChangedEvent* deviceChangedEvent = dynamic_cast<DeviceChangedEvent*>(event); if (!deviceChangedEvent->getDeviceName().isEmpty()) { this->model->setDeviceName(deviceChangedEvent->getDeviceName()); fillTargetCombo(this->model->getType()); } checkEmptyDevice(); checkEmptyTarget(); blockAllSignals(false); } else if (event->type() == static_cast<QEvent::Type>(Event::EventType::MediaChanged) || event->type() == static_cast<QEvent::Type>(Event::EventType::TemplateChanged)) { if (this->model == NULL) return false; blockAllSignals(true); fillTargetCombo(this->model->getType()); blockAllSignals(false); } return QObject::eventFilter(target, event); }