| 16 | #include <QtWidgets/QGraphicsOpacityEffect> |
| 17 | |
| 18 | RundownSolidColorWidget::RundownSolidColorWidget(const LibraryModel& model, QWidget* parent, const QString& color, bool active, |
| 19 | bool loaded, bool paused, bool playing, bool inGroup, bool compactView) |
| 20 | : QWidget(parent), |
| 21 | active(active), loaded(loaded), paused(paused), playing(playing), inGroup(inGroup), compactView(compactView), color(color), |
| 22 | model(model), stopControlSubscription(NULL), playControlSubscription(NULL), playNowControlSubscription(NULL), loadControlSubscription(NULL), |
| 23 | pauseControlSubscription(NULL), nextControlSubscription(NULL), clearControlSubscription(NULL), clearVideolayerControlSubscription(NULL), |
| 24 | clearChannelControlSubscription(NULL) |
| 25 | { |
| 26 | setupUi(this); |
| 27 | |
| 28 | this->animation = new ActiveAnimation(this->labelActiveColor); |
| 29 | |
| 30 | this->delayType = DatabaseManager::getInstance().getConfigurationByName("DelayType").getValue(); |
| 31 | this->markUsedItems = (DatabaseManager::getInstance().getConfigurationByName("MarkUsedItems").getValue() == "true") ? true : false; |
| 32 | |
| 33 | setColor(this->color); |
| 34 | setActive(this->active); |
| 35 | setCompactView(this->compactView); |
| 36 | |
| 37 | this->labelGroupColor->setVisible(inGroup); |
| 38 | this->labelGroupColor->setStyleSheet(QString("background-color: %1;").arg(Color::DEFAULT_GROUP_COLOR)); |
| 39 | this->labelColor->setStyleSheet(QString("background-color: %1;").arg(Color::DEFAULT_COLOR_PRODUCER_COLOR)); |
| 40 | |
| 41 | this->labelLabel->setText(this->model.getLabel()); |
| 42 | this->labelChannel->setText(QString("Channel: %1").arg(this->command.getChannel())); |
| 43 | this->labelVideolayer->setText(QString("Video layer: %1").arg(this->command.getVideolayer())); |
| 44 | this->labelDelay->setText(QString("Delay: %1").arg(this->command.getDelay())); |
| 45 | this->labelDevice->setText(QString("Server: %1").arg(this->model.getDeviceName())); |
| 46 | |
| 47 | QObject::connect(&this->itemScheduler, SIGNAL(executePlay()), this, SLOT(executePlay())); |
| 48 | QObject::connect(&this->itemScheduler, SIGNAL(executeStop()), this, SLOT(executeStop())); |
| 49 | |
| 50 | QObject::connect(&this->command, SIGNAL(channelChanged(int)), this, SLOT(channelChanged(int))); |
| 51 | QObject::connect(&this->command, SIGNAL(videolayerChanged(int)), this, SLOT(videolayerChanged(int))); |
| 52 | QObject::connect(&this->command, SIGNAL(delayChanged(int)), this, SLOT(delayChanged(int))); |
| 53 | QObject::connect(&this->command, SIGNAL(allowGpiChanged(bool)), this, SLOT(allowGpiChanged(bool))); |
| 54 | QObject::connect(&this->command, SIGNAL(remoteTriggerIdChanged(const QString&)), this, SLOT(remoteTriggerIdChanged(const QString&))); |
| 55 | QObject::connect(&EventManager::getInstance(), SIGNAL(deviceChanged(const DeviceChangedEvent&)), this, SLOT(deviceChanged(const DeviceChangedEvent&))); |
| 56 | QObject::connect(&EventManager::getInstance(), SIGNAL(labelChanged(const LabelChangedEvent&)), this, SLOT(labelChanged(const LabelChangedEvent&))); |
| 57 | |
| 58 | QObject::connect(&DeviceManager::getInstance(), SIGNAL(deviceAdded(CasparDevice&)), this, SLOT(deviceAdded(CasparDevice&))); |
| 59 | const QSharedPointer<CasparDevice> device = DeviceManager::getInstance().getDeviceByName(this->model.getDeviceName()); |
| 60 | if (device != NULL) |
| 61 | QObject::connect(device.data(), SIGNAL(connectionStateChanged(CasparDevice&)), this, SLOT(deviceConnectionStateChanged(CasparDevice&))); |
| 62 | |
| 63 | QObject::connect(GpiManager::getInstance().getGpiDevice().data(), SIGNAL(connectionStateChanged(bool, GpiDevice*)), this, SLOT(gpiConnectionStateChanged(bool, GpiDevice*))); |
| 64 | |
| 65 | checkEmptyDevice(); |
| 66 | checkGpiConnection(); |
| 67 | checkDeviceConnection(); |
| 68 | } |
| 69 | |
| 70 | void RundownSolidColorWidget::labelChanged(const LabelChangedEvent& event) |
| 71 | { |
nothing calls this directly
no test coverage detected