void InspectorCustomCommandWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<CustomCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<CustomCommand*>(event.getCommand());

        this->lineEditStop->setText(this->command->getStopCommand());
        this->lineEditPlay->setText(this->command->getPlayCommand());
        this->lineEditLoad->setText(this->command->getLoadCommand());
        this->lineEditPause->setText(this->command->getPauseCommand());
        this->lineEditNext->setText(this->command->getNextCommand());
        this->lineEditUpdate->setText(this->command->getUpdateCommand());
        this->lineEditInvoke->setText(this->command->getInvokeCommand());
        this->lineEditPreview->setText(this->command->getPreviewCommand());
        this->lineEditClear->setText(this->command->getClearCommand());
        this->lineEditClearVideolayer->setText(this->command->getClearVideolayerCommand());
        this->lineEditClearChannel->setText(this->command->getClearChannelCommand());
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
    }

    blockAllSignals(false);
}
void InspectorFillWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<FillCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<FillCommand*>(event.getCommand());

        const DeviceModel model = DatabaseManager::getInstance().getDeviceByName(this->model->getDeviceName());
        if (!model.getName().isEmpty())
        {
            const QStringList& channelFormats = DatabaseManager::getInstance().getDeviceByName(model.getName()).getChannelFormats().split(",");
            const FormatModel& formatModel = DatabaseManager::getInstance().getFormat(channelFormats.at(this->command->getChannel() - 1));

            this->resolutionWidth = formatModel.getWidth();
            this->resolutionHeight = formatModel.getHeight();

            setScaleAndPositionValues();
        }

        this->spinBoxTransitionDuration->setValue(this->command->getTransitionDuration());
        this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
        this->checkBoxDefer->setChecked(this->command->getDefer());
        this->checkBoxUseMipmap->setChecked(this->command->getUseMipmap());
    }

    blockAllSignals(false);
}
Exemple #3
0
bool InspectorContrastWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Event::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        this->model = rundownItemSelectedEvent->getLibraryModel();

        blockAllSignals(true);

        if (dynamic_cast<ContrastCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->command = dynamic_cast<ContrastCommand*>(rundownItemSelectedEvent->getCommand());

            this->sliderContrast->setValue(QString("%1").arg(this->command->getContrast() * 100).toFloat());
            this->spinBoxContrast->setValue(QString("%1").arg(this->command->getContrast() * 100).toFloat());

            this->spinBoxDuration->setValue(this->command->getDuration());
            this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
            this->checkBoxDefer->setChecked(this->command->getDefer());
        }

        blockAllSignals(false);
    }

    return QObject::eventFilter(target, event);
}
bool InspectorVolumeWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        if (dynamic_cast<VolumeCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->preview = false;

            this->model = rundownItemSelectedEvent->getLibraryModel();
            this->command = dynamic_cast<VolumeCommand*>(rundownItemSelectedEvent->getCommand());

            // If getVolume() = 0.56999993 then
            // f1 = 56 and
            // i = 57.
            // Why???
            float f1 = this->command->getVolume() * 100;
            int i = f1;

            // This will also set the slider value.
            this->spinBoxVolume->setValue(QString("%1").arg(this->command->getVolume() * 100).toFloat());

            this->spinBoxDuration->setValue(this->command->getDuration());
            this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
            this->checkBoxDefer->setChecked(this->command->getDefer());

            this->preview = true;
        }
    }

    return QObject::eventFilter(target, event);
}
Exemple #5
0
bool PreviewWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Enum::EventType::LibraryItemSelected) ||
        event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected))
    {
        int thumbnailId = 0;
        if (dynamic_cast<LibraryItemSelectedEvent*>(event))
        {
            LibraryItemSelectedEvent* libraryItemSelectedEvent = dynamic_cast<LibraryItemSelectedEvent*>(event);
            thumbnailId = libraryItemSelectedEvent->getLibraryModel()->getThumbnailId();
        }
        else if (dynamic_cast<RundownItemSelectedEvent*>(event))
        {
            RundownItemSelectedEvent* rundownItemSelected = dynamic_cast<RundownItemSelectedEvent*>(event);
            thumbnailId = rundownItemSelected->getLibraryModel()->getThumbnailId();
        }

        if (thumbnailId > 0)
        {
            QString data = DatabaseManager::getInstance().getThumbnailById(thumbnailId).getData();
            this->image.loadFromData(QByteArray::fromBase64(data.toAscii()), "PNG");

            if (this->previewAlpha)
                this->labelPreview->setPixmap(QPixmap::fromImage(this->image.alphaChannel()));
            else
                this->labelPreview->setPixmap(QPixmap::fromImage(this->image));
        }
        else
        {
            this->labelPreview->setPixmap(NULL);
        }
    }

    return QObject::eventFilter(target, event);
}
bool InspectorSaturationWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        if (dynamic_cast<SaturationCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->preview = false;

            this->model = rundownItemSelectedEvent->getLibraryModel();
            this->command = dynamic_cast<SaturationCommand*>(rundownItemSelectedEvent->getCommand());

            // This will also set the slider value.
            // TODO: Why QString -> float, see InspectorVolumeWidget.cpp
            this->spinBoxSaturation->setValue(QString("%1").arg(this->command->getSaturation() * 100).toFloat());

            this->spinBoxDuration->setValue(this->command->getDuration());
            this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
            this->checkBoxDefer->setChecked(this->command->getDefer());

            this->preview = true;
        }
    }

    return QObject::eventFilter(target, event);
}
bool InspectorAudioWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        this->model = rundownItemSelectedEvent->getLibraryModel();

        blockAllSignals(true);

        if (dynamic_cast<AudioCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->command = dynamic_cast<AudioCommand*>(rundownItemSelectedEvent->getCommand());

            this->comboBoxTransition->setCurrentIndex(this->comboBoxTransition->findText(this->command->getTransition()));
            this->spinBoxDuration->setValue(this->command->getDuration());
            this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
            this->comboBoxDirection->setCurrentIndex(this->comboBoxDirection->findText(this->command->getDirection()));
            this->checkBoxLoop->setChecked(this->command->getLoop());
            this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
            this->checkBoxUseAuto->setChecked(this->command->getUseAuto());
        }

        blockAllSignals(false);
    }

    return QObject::eventFilter(target, event);
}
void InspectorClearOutputWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<ClearOutputCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<ClearOutputCommand*>(event.getCommand());

        this->checkBoxClearChannel->setChecked(this->command->getClearChannel());
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
    }

    blockAllSignals(false);
}
void InspectorPlayoutCommandWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<PlayoutCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<PlayoutCommand*>(event.getCommand());

        this->comboBoxPlayoutCommand->setCurrentIndex(this->comboBoxPlayoutCommand->findText(this->command->getPlayoutCommand()));
    }

    blockAllSignals(false);
}
void InspectorKeyerWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<KeyerCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<KeyerCommand*>(event.getCommand());

        this->checkBoxDefer->setChecked(this->command->getDefer());
    }

    blockAllSignals(false);
}
void InspectorAtemKeyerStateWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<AtemKeyerStateCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<AtemKeyerStateCommand*>(event.getCommand());

        this->comboBoxKeyer->setCurrentIndex(this->comboBoxKeyer->findData(this->command->getKeyer()));
        this->checkBoxState->setChecked(this->command->getState());
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
    }

    blockAllSignals(false);
}
bool InspectorMetadataWidget::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->lineEditLabel->setEnabled(false);

        this->lineEditType->setText(this->model->getType());
        this->lineEditLabel->clear();

        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->lineEditLabel->setEnabled(true);

        this->lineEditLabel->setReadOnly(false);

        this->lineEditType->setText(this->model->getType());
        this->lineEditLabel->setText(this->model->getLabel());

        blockAllSignals(false);
    }
    else if (event->type() == static_cast<QEvent::Type>(Event::EventType::EmptyRundown))
    {
        blockAllSignals(true);

        this->lineEditLabel->setEnabled(false);

        this->lineEditType->clear();
        this->lineEditLabel->clear();

        blockAllSignals(false);
    }

    return QObject::eventFilter(target, event);
}
void InspectorPresetWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<PresetCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<PresetCommand*>(event.getCommand());

        this->comboBoxSource->setCurrentIndex(this->comboBoxSource->findData(this->command->getSource()));
        this->comboBoxPreset->setCurrentIndex(this->comboBoxPreset->findData(this->command->getPreset()));
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
    }

    blockAllSignals(false);
}
void InspectorAtemAudioGainWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<AtemAudioGainCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<AtemAudioGainCommand*>(event.getCommand());

        this->comboBoxSource->setCurrentIndex(this->comboBoxSource->findData(this->command->getSource()));
        this->sliderGain->setValue(this->command->getGain() * 100);
        this->doubleSpinBoxGain->setValue(this->command->getGain());
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
    }

    blockAllSignals(false);
}
void InspectorPanasonicPresetWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;

    blockAllSignals(true);

    if (dynamic_cast<PanasonicPresetCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<PanasonicPresetCommand*>(event.getCommand());

        this->lineEditAddress->setText(this->command->getAddress());
        this->spinBoxPreset->setValue(this->command->getPreset());
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());
    }

    checkEmptyAddress();

    blockAllSignals(false);
}
void InspectorBrightnessWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<BrightnessCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<BrightnessCommand*>(event.getCommand());

        this->sliderBrightness->setValue(QString("%1").arg(this->command->getBrightness() * 100).toFloat());
        this->spinBoxBrightness->setValue(QString("%1").arg(this->command->getBrightness() * 100).toFloat());
        this->spinBoxTransitionDuration->setValue(this->command->getTransitionDuration());
        this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
        this->checkBoxDefer->setChecked(this->command->getDefer());
    }

    blockAllSignals(false);
}
void InspectorDeckLinkInputWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<DeckLinkInputCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<DeckLinkInputCommand*>(event.getCommand());

        this->spinBoxDevice->setValue(this->command->getDevice());
        this->comboBoxFormat->setCurrentIndex(this->comboBoxFormat->findText(this->command->getFormat()));
        this->comboBoxTransition->setCurrentIndex(this->comboBoxTransition->findText(this->command->getTransition()));
        this->spinBoxTransitionDuration->setValue(this->command->getTransitionDuration());
        this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
        this->comboBoxDirection->setCurrentIndex(this->comboBoxDirection->findText(this->command->getDirection()));
    }

    blockAllSignals(false);
}
bool InspectorClearOutputWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        if (dynamic_cast<ClearOutputCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->preview = false;

            this->model = rundownItemSelectedEvent->getLibraryModel();
            this->command = dynamic_cast<ClearOutputCommand*>(rundownItemSelectedEvent->getCommand());

            this->checkBoxClearChannel->setChecked(this->command->getClearChannel());

            this->preview = true;
        }
    }

    return QObject::eventFilter(target, event);
}
void InspectorMovieWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->command = nullptr;
    this->model = event.getLibraryModel();

    blockAllSignals(true);

    if (dynamic_cast<MovieCommand*>(event.getCommand()))
    {
        this->command = dynamic_cast<MovieCommand*>(event.getCommand());

        this->comboBoxTransition->setCurrentIndex(this->comboBoxTransition->findText(this->command->getTransition()));
        this->spinBoxTransitionDuration->setValue(this->command->getTransitionDuration());
        this->comboBoxTween->setCurrentIndex(this->comboBoxTween->findText(this->command->getTween()));
        this->comboBoxDirection->setCurrentIndex(this->comboBoxDirection->findText(this->command->getDirection()));
        this->spinBoxSeek->setValue(this->command->getSeek());
        this->spinBoxLength->setValue(this->command->getLength());
        this->checkBoxLoop->setChecked(this->command->getLoop());
        this->checkBoxFreezeOnLoad->setChecked(this->command->getFreezeOnLoad());
        this->checkBoxTriggerOnNext->setChecked(this->command->getTriggerOnNext());

        RundownGroupWidget* parent = dynamic_cast<RundownGroupWidget*>(event.getParent());
        AbstractRundownWidget* source = dynamic_cast<AbstractRundownWidget*>(event.getSource());

        // Only show auto play option if we are in a group. OSC needs to be enabled.
        if (this->enableOscInput && source != NULL && parent != NULL && source->isInGroup() && dynamic_cast<GroupCommand*>(parent->getCommand())->getAutoPlay())
        {
            this->labelAutoPlay->setEnabled(true);
            this->checkBoxAutoPlay->setEnabled(true);
            this->checkBoxAutoPlay->setChecked(this->command->getAutoPlay());
        }
        else
        {
            this->labelAutoPlay->setEnabled(false);
            this->checkBoxAutoPlay->setEnabled(false);
            this->checkBoxAutoPlay->setChecked(false);
        }
    }

    blockAllSignals(false);
}
bool InspectorBlendModeWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        this->model = rundownItemSelectedEvent->getLibraryModel();

        blockAllSignals(true);

        if (dynamic_cast<BlendModeCommand*>(rundownItemSelectedEvent->getCommand()))
        {  
            this->command = dynamic_cast<BlendModeCommand*>(rundownItemSelectedEvent->getCommand());

            this->comboBoxBlendMode->setCurrentIndex(this->comboBoxBlendMode->findText(this->command->getBlendMode()));
        }

        blockAllSignals(false);
    }

    return QObject::eventFilter(target, event);
}
Exemple #21
0
bool InspectorPrintWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Event::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        this->model = rundownItemSelectedEvent->getLibraryModel();

        blockAllSignals(true);

        if (dynamic_cast<PrintCommand*>(rundownItemSelectedEvent->getCommand()))
        {       
            this->command = dynamic_cast<PrintCommand*>(rundownItemSelectedEvent->getCommand());

            this->lineEditOutput->setText(this->command->getOutput());
        }

        blockAllSignals(false);
    }

    return QObject::eventFilter(target, event);
}
bool InspectorInputWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Event::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        this->model = rundownItemSelectedEvent->getLibraryModel();

        blockAllSignals(true);

        if (dynamic_cast<InputCommand*>(rundownItemSelectedEvent->getCommand()))
        {  
            this->command = dynamic_cast<InputCommand*>(rundownItemSelectedEvent->getCommand());

            this->comboBoxSwitcher->setCurrentIndex(this->comboBoxSwitcher->findData(this->command->getSwitcher()));
            this->comboBoxInput->setCurrentIndex(this->comboBoxInput->findData(this->command->getInput()));
        }

        blockAllSignals(false);
    }

    return QObject::eventFilter(target, event);
}
bool InspectorNetworkSourceWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Event::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        this->model = rundownItemSelectedEvent->getLibraryModel();

        blockAllSignals(true);

        if (dynamic_cast<NetworkSourceCommand*>(rundownItemSelectedEvent->getCommand()))
        {  
            this->command = dynamic_cast<NetworkSourceCommand*>(rundownItemSelectedEvent->getCommand());

            this->comboBoxTarget->setCurrentIndex(this->comboBoxTarget->findData(this->command->getTarget()));
            this->lineEditSource->setText(this->command->getSource());
        }

        blockAllSignals(false);
    }

    return QObject::eventFilter(target, event);
}
bool InspectorImageScrollerWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected))
    {
        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        if (dynamic_cast<ImageScrollerCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->preview = false;

            this->model = rundownItemSelectedEvent->getLibraryModel();
            this->command = dynamic_cast<ImageScrollerCommand*>(rundownItemSelectedEvent->getCommand());

            this->spinBoxBlur->setValue(this->command->getBlur());
            this->spinBoxSpeed->setValue(this->command->getSpeed());
            this->checkBoxPremultiply->setChecked(this->command->getPremultiply());
            this->checkBoxProgressive->setChecked(this->command->getProgressive());

            this->preview = true;
        }
    }

    return QObject::eventFilter(target, event);
}
Exemple #25
0
void PreviewWidget::rundownItemSelected(const RundownItemSelectedEvent& event)
{
    this->model = event.getLibraryModel();

    setThumbnail();
}
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);
}
Exemple #27
0
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);
}
bool InspectorOutputWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected))
    {
        this->spinBoxChannel->setEnabled(true);
        this->spinBoxVideolayer->setEnabled(true);
        this->spinBoxDelay->setEnabled(true);

        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        if (rundownItemSelectedEvent->getCommand() != NULL && rundownItemSelectedEvent->getLibraryModel() != NULL)
        {
            this->preview = false;

            this->command = rundownItemSelectedEvent->getCommand();
            this->model = rundownItemSelectedEvent->getLibraryModel();

            this->spinBoxChannel->setEnabled(true);
            this->spinBoxVideolayer->setEnabled(true);

            this->spinBoxChannel->setValue(this->command->getChannel());
            this->spinBoxVideolayer->setValue(this->command->getVideolayer());
            this->spinBoxDelay->setValue(this->command->getDelay());
            this->checkBoxAllowGpi->setChecked(this->command->getAllowGpi());

            if (dynamic_cast<GpiOutputCommand*>(rundownItemSelectedEvent->getCommand()))
            {
                this->spinBoxChannel->setEnabled(false);
                this->spinBoxVideolayer->setEnabled(false);

                // We do not have a command object, block the signals.
                // Events will not be triggered while we update the values.
                this->spinBoxChannel->setEnabled(false);
                this->spinBoxVideolayer->setEnabled(false);

                this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL);
                this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER);

                this->spinBoxChannel->blockSignals(false);
                this->spinBoxVideolayer->blockSignals(false);
            }
            else if (dynamic_cast<CommitCommand*>(rundownItemSelectedEvent->getCommand()) ||
                     dynamic_cast<PrintCommand*>(rundownItemSelectedEvent->getCommand()) ||
                     dynamic_cast<FileRecorderCommand*>(rundownItemSelectedEvent->getCommand()) ||
                     dynamic_cast<GridCommand*>(rundownItemSelectedEvent->getCommand()))
            {
                this->spinBoxVideolayer->setEnabled(false);

                // We do not have a command object, block the signals.
                // Events will not be triggered while we update the values.
                this->spinBoxVideolayer->setEnabled(false);

                this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER);

                this->spinBoxVideolayer->blockSignals(false);
            }
            else if (dynamic_cast<GroupCommand*>(rundownItemSelectedEvent->getCommand()))
            {
                this->spinBoxChannel->setEnabled(false);
                this->spinBoxVideolayer->setEnabled(false);
                this->spinBoxDelay->setEnabled(false);

                // We do not have a command object, block the signals.
                // Events will not be triggered while we update the values.
                this->spinBoxChannel->blockSignals(true);
                this->spinBoxVideolayer->blockSignals(true);
                this->spinBoxDelay->blockSignals(true);

                this->spinBoxChannel->setValue(Output::DEFAULT_CHANNEL);
                this->spinBoxVideolayer->setValue(Output::DEFAULT_VIDEOLAYER);
                this->spinBoxDelay->setValue(Output::DEFAULT_DELAY);

                this->spinBoxChannel->blockSignals(false);
                this->spinBoxVideolayer->blockSignals(false);
                this->spinBoxDelay->blockSignals(false);
            }
            else if (dynamic_cast<SeparatorCommand*>(rundownItemSelectedEvent->getCommand()))
            {
                this->spinBoxChannel->setEnabled(false);
                this->spinBoxVideolayer->setEnabled(false);
                this->spinBoxDelay->setEnabled(false);

                // We do not have a command object, block the signals.
                // Events will not be triggered while we update the values.
                this->spinBoxChannel->blockSignals(true);
                this->spinBoxVideolayer->blockSignals(true);
                this->spinBoxDelay->blockSignals(true);
                this->checkBoxAllowGpi->blockSignals(true);

                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->spinBoxChannel->blockSignals(false);
                this->spinBoxVideolayer->blockSignals(false);
                this->spinBoxDelay->blockSignals(false);
                this->checkBoxAllowGpi->blockSignals(false);
            } 

            this->preview = true;
        }
    }

    return QObject::eventFilter(target, event);
}
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 InspectorWidget::eventFilter(QObject* target, QEvent* event)
{
    if (event->type() == static_cast<QEvent::Type>(Enum::EventType::LibraryItemSelected) ||
        event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownIsEmpty))
    {
        this->treeWidgetInspector->topLevelItem(1)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(2)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(3)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(4)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(5)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(6)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(7)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(8)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(9)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(10)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(11)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(12)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(13)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(14)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(15)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(16)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(17)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(18)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(19)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(20)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(21)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(22)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(23)->setHidden(true);
    }
    else if (event->type() == static_cast<QEvent::Type>(Enum::EventType::RundownItemSelected))
    {
        this->treeWidgetInspector->topLevelItem(1)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(2)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(3)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(4)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(5)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(6)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(7)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(8)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(9)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(10)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(11)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(12)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(13)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(14)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(15)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(16)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(17)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(18)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(19)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(20)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(21)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(22)->setHidden(true);
        this->treeWidgetInspector->topLevelItem(23)->setHidden(true);

        RundownItemSelectedEvent* rundownItemSelectedEvent = dynamic_cast<RundownItemSelectedEvent*>(event);
        if (dynamic_cast<TemplateCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(2)->setHidden(false);
        }
        else if (dynamic_cast<MediaCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(3)->setHidden(false);
        }
        else if (dynamic_cast<ChromaCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(4)->setHidden(false);
        }
        else if (dynamic_cast<BlendModeCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(5)->setHidden(false);
        }
        else if (dynamic_cast<BrightnessCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);   
            this->treeWidgetInspector->topLevelItem(6)->setHidden(false);
        }
        else if (dynamic_cast<ContrastCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(7)->setHidden(false);
        }
        else if (dynamic_cast<CropCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(8)->setHidden(false);
        }
        else if (dynamic_cast<GeometryCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(9)->setHidden(false);
        }
        else if (dynamic_cast<GridCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(10)->setHidden(false);
        }
        else if (dynamic_cast<KeyerCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(19)->setHidden(false);
        }
        else if (dynamic_cast<CommitCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
        }
        else if (dynamic_cast<LevelsCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(11)->setHidden(false);
        }
        else if (dynamic_cast<OpacityCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(12)->setHidden(false);
        }
        else if (dynamic_cast<SaturationCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(13)->setHidden(false);
        }
        else if (dynamic_cast<VolumeCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(14)->setHidden(false);
        }
        else if (dynamic_cast<GpiOutputCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(16)->setHidden(false);
        }
        else if (dynamic_cast<DeckLinkInputCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(15)->setHidden(false);
        }
        else if (dynamic_cast<ImageScrollerCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(17)->setHidden(false);
        }
        else if (dynamic_cast<FileRecorderCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(18)->setHidden(false);
        }
        else if (dynamic_cast<PrintCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(20)->setHidden(false);
        }
        else if (dynamic_cast<ClearOutputCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(21)->setHidden(false);
        }
        else if (dynamic_cast<ColorProducerCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(23)->setHidden(false);
        }
        else if (dynamic_cast<GroupCommand*>(rundownItemSelectedEvent->getCommand()))
        {
            this->treeWidgetInspector->topLevelItem(1)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(2)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(3)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(4)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(5)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(6)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(7)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(8)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(9)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(10)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(11)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(12)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(13)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(14)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(15)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(16)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(17)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(18)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(19)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(20)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(21)->setHidden(true);
            this->treeWidgetInspector->topLevelItem(22)->setHidden(false);
            this->treeWidgetInspector->topLevelItem(23)->setHidden(true);
            this->treeWidgetInspector->expandAll();
        }

        this->treeWidgetInspector->expandAll();
    }

    return QObject::eventFilter(target, event);
}