Esempio n. 1
0
void GameUIConfig::reloadVideosValues(void)
{
    // one pass with default values
    Form->ui.pageOptions->setDefaultOptions();

    // then load user configuration
    Form->ui.pageOptions->framerateBox->setCurrentIndex(
            Form->ui.pageOptions->framerateBox->findData(
                        value("videorec/framerate", rec_Framerate()).toString() + " fps",
                    Qt::MatchExactly) );
    Form->ui.pageOptions->bitrateBox->setValue(value("videorec/bitrate", rec_Bitrate()).toUInt());
    bool useGameRes = value("videorec/usegameres",Form->ui.pageOptions->checkUseGameRes->isChecked()).toBool();
    if (useGameRes)
    {
        QRect res = vid_Resolution();
        Form->ui.pageOptions->widthEdit->setText(QString::number(res.width()));
        Form->ui.pageOptions->heightEdit->setText(QString::number(res.height()));
    }
    else
    {
        Form->ui.pageOptions->widthEdit->setText(value("videorec/width","800").toString());
        Form->ui.pageOptions->heightEdit->setText(value("videorec/height","600").toString());
    }
    Form->ui.pageOptions->checkUseGameRes->setChecked(useGameRes);
    Form->ui.pageOptions->checkRecordAudio->setChecked(
            value("videorec/audio",Form->ui.pageOptions->checkRecordAudio->isChecked()).toBool() );
    if (!Form->ui.pageOptions->tryCodecs(value("videorec/format","no").toString(),
                                        value("videorec/videocodec","no").toString(),
                                        value("videorec/audiocodec","no").toString()))
        Form->ui.pageOptions->setDefaultCodecs();
}
Esempio n. 2
0
void GameUIConfig::SaveVideosOptions()
{
    QRect res = rec_Resolution();
    setValue("videorec/format", AVFormat());
    setValue("videorec/videocodec", videoCodec());
    setValue("videorec/audiocodec", audioCodec());
    setValue("videorec/framerate", rec_Framerate());
    setValue("videorec/bitrate", rec_Bitrate());
    setValue("videorec/width", res.width());
    setValue("videorec/height", res.height());
    setValue("videorec/usegameres", Form->ui.pageOptions->checkUseGameRes->isChecked());
    setValue("videorec/audio", recordAudio());

    sync();
}