Esempio n. 1
0
void QSchedulerConfig::setSamplingRate(const unsigned int sampling_rate) {
    sampling_rate_ = sampling_rate;

    emit samplingRateChanged();
}
Esempio n. 2
0
ConfigWindow::ConfigWindow(Config& cfg, MessageServer * msgServer, 
    ControlWindow * ctrlWindow)
{
    QString datetime = getcurrentTime();
    m_msgServer = msgServer;
    m_ctrlWindow = ctrlWindow;
    
    m_demo = cfg.demo;
    m_videoFile = cfg.videoFile;
    m_soundFile = cfg.soundFile;
    m_speechSelected = cfg.speechSelected;

    m_logo = new QLabel(tr(""));
    m_logo->setPixmap(QPixmap(":images/hdr_ti_logo.png"));

    QFont serifFont("Times", 22, QFont::Bold);
    m_bannerLabel = new QLabel(m_demo + tr(" Demo"));
    m_bannerLabel->setFont(serifFont);

    createVideoGroupBox(cfg);
    createSoundGroupBox(cfg);
    createOtherGroupBox();

    QGridLayout *buttonsLayout = new QGridLayout;
    m_startButton = createButton(tr("Start demo"), SLOT(startDemo()));
    m_exitButton = createButton(tr("Exit"), SLOT(exit()));
    buttonsLayout->setRowMinimumHeight(2, 60);
    buttonsLayout->addWidget(m_logo, 1, 0, 1, 1);
    buttonsLayout->addWidget(m_startButton, 1, 2, 1, 1);
    buttonsLayout->addWidget(m_exitButton, 1, 3, 1, 1);
    buttonsLayout->setColumnStretch(0, 10);
    buttonsLayout->setColumnStretch(1, 10);

    QVBoxLayout *mainLayout = new QVBoxLayout;

    mainLayout->addWidget(m_bannerLabel);
    mainLayout->addWidget(m_videoGroupBox);
    mainLayout->addWidget(m_soundGroupBox);
    mainLayout->addWidget(m_otherGroupBox);
    mainLayout->addLayout(buttonsLayout);

    mainLayout->setStretchFactor(m_bannerLabel, 1);
    mainLayout->setStretchFactor(m_videoGroupBox, 5);
    mainLayout->setStretchFactor(m_soundGroupBox, 5);
    mainLayout->setStretchFactor(m_otherGroupBox, 2);

    /* To prevent rows from overlapping one another */
    mainLayout->setSpacing(0);
    
    mainLayout->setContentsMargins(0,0,0,0);
    #if defined(Platform_dm365)
    mainLayout->setContentsMargins(50,39,50,39);
    #endif
  
    setLayout(mainLayout);

    disableUnusedWidgets(cfg);

    if (!m_videoBitRateComboBox->isHidden()) {
        videoBitRateChanged();
    }
    if (!m_videoCodecComboBox->isHidden()) {
        videoCodecChanged();
    }
    if (!m_videoStdComboBox->isHidden()) {
        if (cfg.videoStd == "3") {
            m_videoStdComboBox->setCurrentIndex(0);   //720P
        }
        else {
            m_videoStdComboBox->setCurrentIndex(1);   //1080I
        }
        videoStdChanged();
    }
    if (!m_soundCodecComboBox->isHidden()) {
        soundCodecChanged();
    }
    if (!m_soundBitRateComboBox->isHidden()) {
        soundBitRateChanged();
    }
    if (!m_samplingRateComboBox->isHidden()) {
        samplingRateChanged();
    }
    if (!m_loopingCheckBox->isHidden()) {
        m_loopingCheckBox->setChecked(cfg.looping);
    }
    if (!m_disablePreviewCheckBox->isHidden()) {
        m_disablePreviewCheckBox->setChecked(cfg.disablePreview);
    }
    if (!m_disableFileWriteCheckBox->isHidden()) {
        m_disableFileWriteCheckBox->setChecked(cfg.disableFileWrite);
    }
    if (!m_passthroughCheckBox->isHidden()) {
        m_passthroughCheckBox->setChecked(cfg.passthrough);
    }
    if (!m_encodeVideoCheckBox->isHidden()) {
        m_encodeVideoCheckBox->setChecked(false);
    }
    if (!m_encodeSoundCheckBox->isHidden()) {
        m_encodeSoundCheckBox->setChecked(true); // Sound is disabled by default
    }

    /* 
     * For encode demo, set default filenames given we do not officially
     * support keyboard input.
     */
    if (cfg.demo == "Encode") { 
        if (cfg.videoFile.isEmpty()) {   
            m_videoFile = DEFAULT_VIDEO_FILE + datetime + getVideoExtension();
            m_videoFileLineEdit->setText(m_videoFile);
        }
        if (cfg.soundFile.isEmpty()) {
            m_soundFile = DEFAULT_SOUND_FILE + datetime + getSoundExtension();
            m_soundFileLineEdit->setText(m_soundFile);
        }
    }

    setWindowTitle(tr("Demo configuration"));
}