diff --git a/src/Widgets/Rundown/RundownTreeWidget.cpp b/src/Widgets/Rundown/RundownTreeWidget.cpp index e1ad0acb..6db33b03 100644 --- a/src/Widgets/Rundown/RundownTreeWidget.cpp +++ b/src/Widgets/Rundown/RundownTreeWidget.cpp @@ -65,7 +65,7 @@ RundownTreeWidget::RundownTreeWidget(QWidget* parent) clearDelayedCommandsOnAutoStep(false), activeRundown(Rundown::DEFAULT_NAME), currentAutoPlayWidget(NULL), copyItem(NULL), currentPlayingItem(NULL), currentPlayingAutoStepItem(NULL), upControlSubscription(NULL), downControlSubscription(NULL), playAndAutoStepControlSubscription(NULL), playNowAndAutoStepControlSubscription(NULL), playNowIfChannelControlSubscription(NULL), stopControlSubscription(NULL), playControlSubscription(NULL), playNowControlSubscription(NULL), - loadControlSubscription(NULL), pauseControlSubscription(NULL), nextControlSubscription(NULL), updateControlSubscription(NULL), invokeControlSubscription(NULL), + loadControlSubscription(NULL), pauseControlSubscription(NULL), nextControlSubscription(NULL), updateControlSubscription(NULL), invokeControlSubscription(NULL), previewControlSubscription(NULL), clearControlSubscription(NULL), clearVideolayerControlSubscription(NULL), clearChannelControlSubscription(NULL), repositoryDevice(NULL) { setupUi(this); @@ -1597,6 +1597,9 @@ void RundownTreeWidget::resetOscSubscriptions() if (this->updateControlSubscription != NULL) this->updateControlSubscription->disconnect(); // Disconnect all events. + if (this->previewControlSubscription != NULL) + this->previewControlSubscription->disconnect(); // Disconnect all events. + if (this->clearControlSubscription != NULL) this->clearControlSubscription->disconnect(); // Disconnect all events. @@ -1678,6 +1681,11 @@ void RundownTreeWidget::configureOscSubscriptions() QObject::connect(this->invokeControlSubscription, SIGNAL(subscriptionReceived(const QString&, const QList&)), this, SLOT(invokeControlSubscriptionReceived(const QString&, const QList&))); + QString previewControlFilter = Osc::DEFAULT_PREVIEW_RUNDOWN_CONTROL_FILTER; + this->previewControlSubscription = new OscSubscription(previewControlFilter, this); + QObject::connect(this->previewControlSubscription, SIGNAL(subscriptionReceived(const QString&, const QList&)), + this, SLOT(previewControlSubscriptionReceived(const QString&, const QList&))); + QString clearControlFilter = Osc::RUNDOWN_CONTROL_CLEAR_FILTER; this->clearControlSubscription = new OscSubscription(clearControlFilter, this); QObject::connect(this->clearControlSubscription, SIGNAL(subscriptionReceived(const QString&, const QList&)), @@ -1925,6 +1933,20 @@ void RundownTreeWidget::invokeControlSubscriptionReceived(const QString& predica EventManager::getInstance().fireExecuteRundownItemEvent(ExecuteRundownItemEvent(Playout::PlayoutType::Invoke, this->treeWidgetRundown->currentItem())); } +void RundownTreeWidget::previewControlSubscriptionReceived(const QString& predicate, const QList& arguments) +{ + Q_UNUSED(predicate); + + if (!this->active) + return; + + if (this->treeWidgetRundown->currentItem() == NULL) + return; + + if (this->allowRemoteRundownTriggering && arguments.count() > 0 && arguments[0].toInt() > 0 && !this->previewOnAutoStep) + EventManager::getInstance().fireExecuteRundownItemEvent(ExecuteRundownItemEvent(Playout::PlayoutType::Preview, this->treeWidgetRundown->currentItem())); +} + void RundownTreeWidget::clearControlSubscriptionReceived(const QString& predicate, const QList& arguments) { Q_UNUSED(predicate); diff --git a/src/Widgets/Rundown/RundownTreeWidget.h b/src/Widgets/Rundown/RundownTreeWidget.h index 3870678b..fa6548da 100644 --- a/src/Widgets/Rundown/RundownTreeWidget.h +++ b/src/Widgets/Rundown/RundownTreeWidget.h @@ -110,6 +110,7 @@ class WIDGETS_EXPORT RundownTreeWidget : public QWidget, Ui::RundownTreeWidget OscSubscription* nextControlSubscription; OscSubscription* updateControlSubscription; OscSubscription* invokeControlSubscription; + OscSubscription* previewControlSubscription; OscSubscription* clearControlSubscription; OscSubscription* clearVideolayerControlSubscription; OscSubscription* clearChannelControlSubscription; @@ -204,6 +205,7 @@ class WIDGETS_EXPORT RundownTreeWidget : public QWidget, Ui::RundownTreeWidget Q_SLOT void nextControlSubscriptionReceived(const QString&, const QList&); Q_SLOT void updateControlSubscriptionReceived(const QString&, const QList&); Q_SLOT void invokeControlSubscriptionReceived(const QString&, const QList&); + Q_SLOT void previewControlSubscriptionReceived(const QString&, const QList&) Q_SLOT void clearControlSubscriptionReceived(const QString&, const QList&); Q_SLOT void clearVideolayerControlSubscriptionReceived(const QString&, const QList&); Q_SLOT void clearChannelControlSubscriptionReceived(const QString&, const QList&);