void PageOutput::LoadProfileSettings(QSettings* settings) { // choose default container and codecs enum_container default_container = (enum_container) 0; for(unsigned int i = 0; i < VIDEO_CODEC_COUNT; ++i) { if(AVFormatIsInstalled(m_containers[i].avname)) { default_container = (enum_container) i; break; } } enum_video_codec default_video_codec = (enum_video_codec) 0; for(unsigned int i = 0; i < VIDEO_CODEC_COUNT; ++i) { if(AVCodecIsInstalled(m_video_codecs[i].avname) && m_containers[default_container].supported_video_codecs.count((enum_video_codec) i)) { default_video_codec = (enum_video_codec) i; break; } } enum_audio_codec default_audio_codec = (enum_audio_codec) 0; for(unsigned int i = 0; i < AUDIO_CODEC_COUNT; ++i) { if(AVCodecIsInstalled(m_audio_codecs[i].avname) && m_containers[default_container].supported_audio_codecs.count((enum_audio_codec) i)) { default_audio_codec = (enum_audio_codec) i; break; } } // load settings SetFile(settings->value("output/file", "").toString()); SetSeparateFiles(settings->value("output/separate_files", false).toBool()); SetContainer(StringToEnum(settings->value("output/container", QString()).toString(), default_container)); SetContainerAV(FindContainerAV(settings->value("output/container_av", QString()).toString())); SetVideoCodec(StringToEnum(settings->value("output/video_codec", QString()).toString(), default_video_codec)); SetVideoCodecAV(FindVideoCodecAV(settings->value("output/video_codec_av", QString()).toString())); SetVideoKBitRate(settings->value("output/video_kbit_rate", 5000).toUInt()); SetH264CRF(settings->value("output/video_h264_crf", 23).toUInt()); SetH264Preset((enum_h264_preset) settings->value("output/video_h264_preset", H264_PRESET_SUPERFAST).toUInt()); SetVP8CPUUsed(settings->value("output/video_vp8_cpu_used", 5).toUInt()); SetVideoOptions(settings->value("output/video_options", "").toString()); SetVideoAllowFrameSkipping(settings->value("output/video_allow_frame_skipping", true).toBool()); SetAudioCodec(StringToEnum(settings->value("output/audio_codec", QString()).toString(), default_audio_codec)); SetAudioCodecAV(FindAudioCodecAV(settings->value("output/audio_codec_av", QString()).toString())); SetAudioKBitRate(settings->value("output/audio_kbit_rate", 128).toUInt()); SetAudioOptions(settings->value("output/audio_options", "").toString()); // update things OnUpdateContainerFields(); OnUpdateVideoCodecFields(); OnUpdateAudioCodecFields(); }
void OpenSMOKE_ICEM::DefineFromFile(const std::string inputFile) { double double_value; std::string string_value; int int_value; vector<string> string_vector; OpenSMOKE_Dictionary_ICEM dictionary; dictionary.ParseFile(inputFile); // COMPULSORY: Rotation Rate if (dictionary.Return("#RotationRate", double_value, string_value)) AssignRotationRate(string_value, double_value); // COMPULSORY: Compression Ratio if (dictionary.Return("#CompressionRatio", double_value)) AssignCompressionRatio(double_value); // COMPULSORY: Reactor Clearance Volume if (dictionary.Return("#ClearanceVolume", double_value, string_value)) AssignClearanceVolume(string_value, double_value); // COMPULSORY: Arm Ratio if (dictionary.Return("#ArmRatio", double_value)) AssignArmRatio(double_value); // COMPULSORY: Start angle if (dictionary.Return("#StartAngle", double_value, string_value)) AssignStartAngle(string_value, double_value); // COMPULSORY: Start angle if (dictionary.Return("#Diameter", double_value, string_value)) AssignDiameter(string_value, double_value); // OPTIONAL: Number of cycles if (dictionary.Return("#NumberOfCycles", double_value)) SetNumberOfCycles(double_value); // OPTIONAL: KeySpecies if (dictionary.Return("#Key", string_vector)) SetKeySpecies(string_vector); // OPTIONAL: Output folder if (dictionary.Return("#Output", string_value)) SetOutputFolder(string_value); // OPTIONAL: Print Options if (dictionary.Return("#Nvideo", int_value)) SetVideoOptions(int_value); // OPTIONAL: Print Options if (dictionary.Return("#Nfile", int_value)) SetFileOptions(int_value); // OPTIONAL: Print Options if (dictionary.Return("#NoVerbose")) UnsetVerbose(); // OPTIONAL: Verbose Energy if (dictionary.Return("#VerboseEnergy")) SetVerboseEnergy(); // OPTIONAL: Global kinetics if (dictionary.Return("#GlobalKinetics")) SetGlobalKinetics(); // OPTIONAL: Relative tolerance if (dictionary.Return("#RelTol", double_value)) SetRelativeTolerance(double_value); // OPTIONAL: Absolute tolerance if (dictionary.Return("#AbsTol", double_value)) SetAbsoluteTolerance(double_value); // OPTIONAL: Adiabatic if (dictionary.Return("#Adiabatic")) SetAdiabatic(); // OPTIONAL: Heat flux if (dictionary.Return("#Qe", double_value, string_value)) SetConstantHeatFlux(double_value, string_value); // OPTIONAL: Exchange area if (dictionary.Return("#A", double_value, string_value)) SetConstantExchangeArea(double_value, string_value); // OPTIONAL: Exchange coefficient if (dictionary.Return("#U", double_value, string_value)) SetConstantHeatExchangeCoefficient(double_value, string_value); // OPTIONAL: Ambient temperature if (dictionary.Return("#Twall", double_value, string_value)) SetConstantAmbientTemperature(double_value, string_value); // OPTIONAL: UserDefined_Qe if (dictionary.Return("#UserDefined_Qe", string_value)) SetUserDefinedHeatFlux(string_value); // OPTIONAL: UserDefined_Ae if (dictionary.Return("#UserDefined_A", string_value)) SetUserDefinedExchangeArea(string_value); // OPTIONAL: UserDefined_U if (dictionary.Return("#UserDefined_U", string_value)) SetUserDefinedHeatExchangeCoefficient(string_value); // OPTIONAL: UserDefined_Twall if (dictionary.Return("#UserDefined_Twall", string_value)) SetUserDefinedAmbientTemperature(string_value); // OPTIONAL: TwoEquationModel if (dictionary.Return("#2E_Model")) SetTwoEquationModel(); // OPTIONAL: Reaction Rates if (dictionary.Return("#ReactionRates", string_vector)) SetReactionRatesOnFile(string_vector); // OPTIONAL: Formation Rates if (dictionary.Return("#FormationRates", string_vector)) SetFormationRatesOnFile(string_vector); // OPTIONAL: Rate of Production Analysis if (dictionary.Return("#ROPA")) SetROPAOnFile(); // OPTIONAL: Sensitivity Analysis if (dictionary.Return("#Sensitivity", string_vector)) SetSensitivityOnFile(string_vector); Lock(); }