40     bool read_file = 
false;
 
   58         QFile inputFile(
path.c_str());
 
   59         if (inputFile.open(QIODevice::ReadOnly))
 
   61             QTextStream in(&inputFile);
 
   64                 QString line = in.readLine();
 
   66                 if (line.length() <= 0)
 
   70                 QStringList parts = line.split( 
"=" );
 
   71                 std::string setting = parts[0].toStdString();
 
   72                 std::string value = parts[1].toStdString();
 
   76                 if (setting == 
"description") {
 
   79                 else if (setting == 
"frame_rate_num") {
 
   80                     value_int = std::stoi(value);
 
   83                 else if (setting == 
"frame_rate_den") {
 
   84                     value_int = std::stoi(value);
 
   87                 else if (setting == 
"width") {
 
   88                     value_int = std::stoi(value);
 
   91                 else if (setting == 
"height") {
 
   92                     value_int = std::stoi(value);
 
   95                 else if (setting == 
"progressive") {
 
   96                     value_int = std::stoi(value);
 
   99                 else if (setting == 
"sample_aspect_num") {
 
  100                     value_int = std::stoi(value);
 
  103                 else if (setting == 
"sample_aspect_den") {
 
  104                     value_int = std::stoi(value);
 
  107                 else if (setting == 
"display_aspect_num") {
 
  108                     value_int = std::stoi(value);
 
  111                 else if (setting == 
"display_aspect_den") {
 
  112                     value_int = std::stoi(value);
 
  115                 else if (setting == 
"colorspace") {
 
  116                     value_int = std::stoi(value);
 
  119                 else if (setting == 
"spherical") {
 
  120                     value_int = std::stoi(value);
 
  129     catch (
const std::exception& e)
 
  132         throw InvalidFile(
"Profile could not be found or loaded (or is invalid).", 
path);
 
  138         throw InvalidFile(
"Profile could not be found or loaded (or is invalid).", 
path);
 
  142 std::string Profile::formattedFPS(
bool include_decimal) {
 
  144     if (!include_decimal) {
 
  156         std::snprintf(buffer, 
sizeof(buffer), 
"%04d", fps_code);
 
  157         return std::string(buffer);
 
  163     if (std::fabs(fps - std::round(fps)) < 0.01) {
 
  164         return std::to_string(
static_cast<int>(std::round(fps)));
 
  168     std::snprintf(buffer, 
sizeof(buffer), 
"%.2f", fps);
 
  169     return std::string(buffer);
 
  174     std::string raw_fps = formattedFPS(
false);
 
  177     std::string fps_padded = std::string(4 - raw_fps.length(), 
'0') + raw_fps;
 
  180     std::snprintf(buffer, 
sizeof(buffer), 
"%05dx%04d%s%s_%02d-%02d",
 
  189     std::string result(buffer);
 
  198     std::string fps_string = formattedFPS(
true);
 
  199     std::string result = std::to_string(
info.
width) + 
"x" + std::to_string(
info.
height) + progressive_str + fps_string;
 
  209     std::string fps_string = formattedFPS(
true);
 
  211         progressive_str + 
" @ " + fps_string +
 
  223     std::string fps_string = formattedFPS(
true);
 
  226         progressive_str + 
" @ " + fps_string +
 
  241     std::ofstream file(file_path);
 
  242     if (!file.is_open()) {
 
  243         throw std::ios_base::failure(
"Failed to save profile.");
 
  247     file << 
"frame_rate_num=" << 
info.
fps.
num << 
"\n";
 
  248     file << 
"frame_rate_den=" << 
info.
fps.
den << 
"\n";
 
  278     root[
"fps"] = Json::Value(Json::objectValue);
 
  281     root[
"pixel_ratio"] = Json::Value(Json::objectValue);
 
  284     root[
"display_ratio"] = Json::Value(Json::objectValue);
 
  304     catch (
const std::exception& e)
 
  307         throw InvalidJSON(
"JSON is invalid (missing keys or invalid data types)");
 
  314     if (!root[
"description"].isNull())
 
  316     if (!root[
"height"].isNull())
 
  318     if (!root[
"width"].isNull())
 
  320     if (!root[
"pixel_format"].isNull())
 
  322     if (!root[
"fps"].isNull()) {
 
  326     if (!root[
"pixel_ratio"].isNull()) {
 
  331     if (!root[
"display_ratio"].isNull()) {
 
  336     if (!root[
"progressive"].isNull())
 
  338     if (!root[
"spherical"].isNull())