_gpu_binary_location = {};
_enable_gpu = false;
_selected_gpu = 0;
- _gpu_license_server = "";
+ _gpu_license_server = {};
_gpu_license_port = 5000;
- _gpu_license = "";
+ _gpu_license = {};
_main_divider_sash_position = {};
_main_content_divider_sash_position = {};
_enable_gpu = f.optional_bool_child("EnableGpu").get_value_or(false);
_gpu_binary_location = f.optional_string_child("GpuBinaryLocation");
- _selected_gpu = f.number_child<int>("SelectedGpu");
- _gpu_license_server = f.string_child("GpuLicenseServer");
- _gpu_license_port = f.number_child<int>("GpuLicensePort");
- _gpu_license = f.string_child("GpuLicense");
+ _selected_gpu = f.optional_number_child<int>("SelectedGpu").get_value_or(0);
+ _gpu_license_server = f.optional_string_child("GpuLicenseServer");
+ _gpu_license_port = f.optional_number_child<int>("GpuLicensePort").get_value_or(5000);
+ _gpu_license = f.optional_string_child("GpuLicense");
_export.read(f.optional_node_child("Export"));
}
}
root->add_child("EnableGpu")->add_child_text((_enable_gpu ? "1" : "0"));
root->add_child("SelectedGpu")->add_child_text(raw_convert<string>(_selected_gpu));
- root->add_child("GpuLicenseServer")->add_child_text(_gpu_license_server);
+ if (_gpu_license_server) {
+ root->add_child("GpuLicenseServer")->add_child_text(*_gpu_license_server);
+ }
root->add_child("GpuLicensePort")->add_child_text(raw_convert<string>(_gpu_license_port));
- root->add_child("GpuLicense")->add_child_text(_gpu_license);
+ if (_gpu_license) {
+ root->add_child("GpuLicense")->add_child_text(*_gpu_license);
+ }
_export.write(root->add_child("Export"));
return _selected_gpu;
}
- std::string gpu_license_server() const {
+ boost::optional<std::string> gpu_license_server() const {
return _gpu_license_server;
}
return _gpu_license_port;
}
- std::string gpu_license() const {
+ boost::optional<std::string> gpu_license() const {
return _gpu_license;
}
bool _enable_gpu;
boost::optional<boost::filesystem::path> _gpu_binary_location;
int _selected_gpu;
- std::string _gpu_license_server;
+ boost::optional<std::string> _gpu_license_server;
int _gpu_license_port;
- std::string _gpu_license;
+ boost::optional<std::string> _gpu_license;
ExportConfig _export;
_dcpomatic_context.set_dimensions(s.width, s.height);
auto config = Config::instance();
DCPOMATIC_ASSERT(_dcpomatic_context.location);
+ DCPOMATIC_ASSERT(config->gpu_license_server());
+ DCPOMATIC_ASSERT(config->gpu_license());
_messenger->launch_grok(*_dcpomatic_context.location,
_dcpomatic_context.width, _dcpomatic_context.width,
_dcpomatic_context.height,
_dcpomatic_context.film->resolution() == Resolution::FOUR_K,
_dcpomatic_context.film->video_frame_rate(),
_dcpomatic_context.film->j2k_bandwidth(),
- config->gpu_license_server(),
+ *config->gpu_license_server(),
config->gpu_license_port(),
- config->gpu_license());
+ *config->gpu_license());
}
_launched = _messenger->wait_for_client_init();
}
_gpu_list_control->update();
_gpu_list_control->set_selection(config->selected_gpu());
- checked_set(_server, config->gpu_license_server());
+ checked_set(_server, std_to_wx(config->gpu_license_server().get_value_or("")));
checked_set(_port, config->gpu_license_port());
- checked_set(_license, config->gpu_license());
+ checked_set(_license, config->gpu_license().get_value_or(""));
}