Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable OSC control of preview #310

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion src/Widgets/Rundown/RundownTreeWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -1678,6 +1681,11 @@ void RundownTreeWidget::configureOscSubscriptions()
QObject::connect(this->invokeControlSubscription, SIGNAL(subscriptionReceived(const QString&, const QList<QVariant>&)),
this, SLOT(invokeControlSubscriptionReceived(const QString&, const QList<QVariant>&)));

QString previewControlFilter = Osc::DEFAULT_PREVIEW_RUNDOWN_CONTROL_FILTER;
this->previewControlSubscription = new OscSubscription(previewControlFilter, this);
QObject::connect(this->previewControlSubscription, SIGNAL(subscriptionReceived(const QString&, const QList<QVariant>&)),
this, SLOT(previewControlSubscriptionReceived(const QString&, const QList<QVariant>&)));

QString clearControlFilter = Osc::RUNDOWN_CONTROL_CLEAR_FILTER;
this->clearControlSubscription = new OscSubscription(clearControlFilter, this);
QObject::connect(this->clearControlSubscription, SIGNAL(subscriptionReceived(const QString&, const QList<QVariant>&)),
Expand Down Expand Up @@ -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<QVariant>& 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<QVariant>& arguments)
{
Q_UNUSED(predicate);
Expand Down
2 changes: 2 additions & 0 deletions src/Widgets/Rundown/RundownTreeWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -204,6 +205,7 @@ class WIDGETS_EXPORT RundownTreeWidget : public QWidget, Ui::RundownTreeWidget
Q_SLOT void nextControlSubscriptionReceived(const QString&, const QList<QVariant>&);
Q_SLOT void updateControlSubscriptionReceived(const QString&, const QList<QVariant>&);
Q_SLOT void invokeControlSubscriptionReceived(const QString&, const QList<QVariant>&);
Q_SLOT void previewControlSubscriptionReceived(const QString&, const QList<QVariant>&)
Q_SLOT void clearControlSubscriptionReceived(const QString&, const QList<QVariant>&);
Q_SLOT void clearVideolayerControlSubscriptionReceived(const QString&, const QList<QVariant>&);
Q_SLOT void clearChannelControlSubscriptionReceived(const QString&, const QList<QVariant>&);
Expand Down
Loading