MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / Save

Method Save

src/Profiles.cpp:240–260  ·  view source on GitHub ↗

Save profile to file system

Source from the content-addressed store, hash-verified

238
239// Save profile to file system
240void Profile::Save(const std::string& file_path) const {
241 std::ofstream file(file_path);
242 if (!file.is_open()) {
243 throw std::ios_base::failure("Failed to save profile.");
244 }
245
246 file << "description=" << info.description << "\n";
247 file << "frame_rate_num=" << info.fps.num << "\n";
248 file << "frame_rate_den=" << info.fps.den << "\n";
249 file << "width=" << info.width << "\n";
250 file << "height=" << info.height << "\n";
251 file << "progressive=" << !info.interlaced_frame << "\n"; // Correct the boolean value for progressive/interlaced
252 file << "sample_aspect_num=" << info.pixel_ratio.num << "\n";
253 file << "sample_aspect_den=" << info.pixel_ratio.den << "\n";
254 file << "display_aspect_num=" << info.display_ratio.num << "\n";
255 file << "display_aspect_den=" << info.display_ratio.den << "\n";
256 file << "pixel_format=" << info.pixel_format << "\n";
257 file << "spherical=" << info.spherical;
258
259 file.close();
260}
261
262// Generate JSON string of this object
263std::string Profile::Json() const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected