bool RundownSonyPresetWidget::executeCommand(Playout::PlayoutType type) { if (type == Playout::PlayoutType::Stop) executeStop(); else if ((type == Playout::PlayoutType::Play && !this->command.getTriggerOnNext()) || type == Playout::PlayoutType::Update) { if (this->command.getDelay() < 0) return true; if (!this->command.getAddress().isEmpty()) { this->executeTimer.setInterval(this->command.getDelay()); this->executeTimer.start(); } } else if (type == Playout::PlayoutType::PlayNow) executePlay(); else if (type == Playout::PlayoutType::Next && this->command.getTriggerOnNext()) executePlay(); else if (type == Playout::PlayoutType::Clear) executeStop(); else if (type == Playout::PlayoutType::ClearVideoLayer) executeStop(); else if (type == Playout::PlayoutType::ClearChannel) executeStop(); if (this->active) this->animation->start(1); return true; }
bool RundownBlendWidget::executeCommand(enum Playout::PlayoutType::Type type) { if (type == Playout::PlayoutType::Stop) QTimer::singleShot(0, this, SLOT(executeStop())); else if (type == Playout::PlayoutType::Play) QTimer::singleShot(this->command.getDelay(), this, SLOT(executePlay())); else if (type == Playout::PlayoutType::Clear) QTimer::singleShot(0, this, SLOT(executeClear())); else if (type == Playout::PlayoutType::ClearVideolayer) QTimer::singleShot(0, this, SLOT(executeClearVideolayer())); else if (type == Playout::PlayoutType::ClearChannel) QTimer::singleShot(0, this, SLOT(executeClearChannel())); return true; }
bool RundownPlayoutCommandWidget::executeCommand(Playout::PlayoutType::Type type) { if (type == Playout::PlayoutType::Play) { if (this->command.getDelay() < 0) return true; this->executeTimer.setInterval(this->command.getDelay()); this->executeTimer.start(); } else if (type == Playout::PlayoutType::PlayNow) executePlay(); if (this->active) this->animation->start(1); return true; }
bool RundownDeckLinkInputWidget::eventFilter(QObject* target, QEvent* event) { 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->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())); checkEmptyDevice(); } else if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemPreview)) { // This event is not for us. if (!this->active) return false; executePlay(); } else 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); } } return QObject::eventFilter(target, event); }
RundownSonyPresetWidget::RundownSonyPresetWidget(const LibraryModel& model, QWidget* parent, const QString& color, bool active, bool inGroup, bool compactView) : QWidget(parent), active(active), inGroup(inGroup), compactView(compactView), color(color), model(model), stopControlSubscription(NULL), playControlSubscription(NULL), playNowControlSubscription(NULL), updateControlSubscription(NULL), clearControlSubscription(NULL), clearVideolayerControlSubscription(NULL), clearChannelControlSubscription(NULL) { setupUi(this); this->device = new ViscaDevice(this); this->animation = new ActiveAnimation(this->labelActiveColor); this->markUsedItems = (DatabaseManager::getInstance().getConfigurationByName("MarkUsedItems").getValue() == "true") ? true : false; setColor(color); setActive(active); setCompactView(compactView); this->labelDisconnected->setVisible(false); 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::DEFAULT_PANASONIC_COLOR)); this->labelLabel->setText(this->model.getLabel()); this->labelDelay->setText(QString("Delay: %1").arg(this->command.getDelay())); this->executeTimer.setSingleShot(true); QObject::connect(&this->executeTimer, SIGNAL(timeout()), SLOT(executePlay())); QObject::connect(&this->command, SIGNAL(delayChanged(int)), this, SLOT(delayChanged(int))); QObject::connect(&this->command, SIGNAL(allowGpiChanged(bool)), this, SLOT(allowGpiChanged(bool))); QObject::connect(&this->command, SIGNAL(remoteTriggerIdChanged(const QString&)), this, SLOT(remoteTriggerIdChanged(const QString&))); QObject::connect(&EventManager::getInstance(), SIGNAL(labelChanged(const LabelChangedEvent&)), this, SLOT(labelChanged(const LabelChangedEvent&))); QObject::connect(GpiManager::getInstance().getGpiDevice().data(), SIGNAL(connectionStateChanged(bool, GpiDevice*)), this, SLOT(gpiConnectionStateChanged(bool, GpiDevice*))); checkGpiConnection(); }
RundownSaturationWidget::RundownSaturationWidget(const LibraryModel& model, QWidget* parent, const QString& color, bool active, bool inGroup, bool disconnected, bool compactview) : QWidget(parent), active(active), inGroup(inGroup), disconnected(disconnected), compactView(compactView), color(color), model(model) { setupUi(this); this->animation = new ActiveAnimation(this->labelActiveColor); setColor(color); setActive(active); setCompactView(compactView); 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::DEFAULT_MIXER_COLOR)); this->labelLabel->setText(this->model.getLabel()); this->labelChannel->setText(QString("Channel: %1").arg(this->command.getChannel())); this->labelVideolayer->setText(QString("Video layer: %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())); this->executeTimer.setSingleShot(true); QObject::connect(&this->executeTimer, SIGNAL(timeout()), SLOT(executePlay())); 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); }
RundownGpiOutputWidget::RundownGpiOutputWidget(const LibraryModel& model, QWidget* parent, const QString& color, bool active, bool inGroup, bool compactView) : QWidget(parent), active(active), inGroup(inGroup), compactView(compactView), color(color), model(model), stopControlSubscription(NULL), playControlSubscription(NULL), updateControlSubscription(NULL), clearControlSubscription(NULL), clearVideolayerControlSubscription(NULL), clearChannelControlSubscription(NULL) { setupUi(this); this->animation = new ActiveAnimation(this->labelActiveColor); setColor(this->color); setActive(this->active); setCompactView(this->compactView); this->labelDisconnected->setVisible(!GpiManager::getInstance().getGpiDevice()->isConnected()); 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::DEFAULT_GPI_COLOR)); this->labelLabel->setText(this->model.getLabel()); this->labelDelay->setText(QString("Delay: %1").arg(this->command.getDelay())); this->executeTimer.setSingleShot(true); QObject::connect(&this->executeTimer, SIGNAL(timeout()), SLOT(executePlay())); QObject::connect(&this->command, SIGNAL(delayChanged(int)), this, SLOT(delayChanged(int))); QObject::connect(&this->command, SIGNAL(gpoPortChanged(int)), this, SLOT(gpiOutputPortChanged(int))); QObject::connect(&this->command, SIGNAL(allowGpiChanged(bool)), this, SLOT(allowGpiChanged(bool))); QObject::connect(&this->command, SIGNAL(remoteTriggerIdChanged(const QString&)), this, SLOT(remoteTriggerIdChanged(const QString&))); QObject::connect(&EventManager::getInstance(), SIGNAL(labelChanged(const LabelChangedEvent&)), this, SLOT(labelChanged(const LabelChangedEvent&))); gpiOutputPortChanged(this->command.getGpoPort()); QObject::connect(GpiManager::getInstance().getGpiDevice().data(), SIGNAL(connectionStateChanged(bool, GpiDevice*)), this, SLOT(gpiConnectionStateChanged(bool, GpiDevice*))); checkGpiConnection(); configureOscSubscriptions(); }
bool RundownGpiOutputWidget::executeCommand(Playout::PlayoutType::Type type) { if (type == Playout::PlayoutType::Stop) executeStop(); else if ((type == Playout::PlayoutType::Play && !this->command.getTriggerOnNext()) || type == Playout::PlayoutType::Update) { this->executeTimer.setInterval(this->command.getDelay()); this->executeTimer.start(); } else if (type == Playout::PlayoutType::Next && this->command.getTriggerOnNext()) executePlay(); else if (type == Playout::PlayoutType::Clear) executeStop(); else if (type == Playout::PlayoutType::ClearVideolayer) executeStop(); else if (type == Playout::PlayoutType::ClearChannel) executeStop(); if (this->active) this->animation->start(1); return true; }