| 4125 | } |
| 4126 | |
| 4127 | hb_value_t * hb_presets_update_version(hb_value_t *presets) |
| 4128 | { |
| 4129 | if (hb_value_type(presets) == HB_VALUE_TYPE_DICT) |
| 4130 | { |
| 4131 | // Is this a single preset or a packaged collection of presets? |
| 4132 | hb_value_t *val = hb_dict_get(presets, "PresetName"); |
| 4133 | if (val == NULL) |
| 4134 | { |
| 4135 | val = hb_dict_get(presets, "VersionMajor"); |
| 4136 | if (val != NULL) |
| 4137 | { |
| 4138 | hb_dict_set(presets, "VersionMajor", |
| 4139 | hb_value_int(hb_preset_version_major)); |
| 4140 | hb_dict_set(presets, "VersionMinor", |
| 4141 | hb_value_int(hb_preset_version_minor)); |
| 4142 | hb_dict_set(presets, "VersionMicro", |
| 4143 | hb_value_int(hb_preset_version_micro)); |
| 4144 | hb_value_incref(presets); |
| 4145 | return presets; |
| 4146 | } |
| 4147 | // Unrecognizable preset file format |
| 4148 | return NULL; |
| 4149 | } |
| 4150 | } |
| 4151 | return presets_package(presets); |
| 4152 | } |
| 4153 | |
| 4154 | int hb_presets_import(const hb_value_t *in, hb_value_t **out) |
| 4155 | { |
no test coverage detected