OpenShot Library | libopenshot 0.5.0
Loading...
Searching...
No Matches
openshot::Profile Class Reference

This class loads a special text-based file called a Profile. More...

#include <Profiles.h>

Public Member Functions

std::string Json () const
 Generate JSON string of this object.
Json::Value JsonValue () const
 Generate Json::Value for this object.
std::string Key ()
 Return a unique key of this profile with padding (01920x1080i2997_16:09).
std::string LongName ()
 Return a longer format name (1920x1080p @ 29.97 fps (16:9)).
std::string LongNameWithDesc ()
 Return a longer format name with description (1920x1080p @ 29.97 fps (16:9) HD 1080i 29.97 fps).
 Profile ()
 Default Constructor for Profile.
 Profile (std::string path)
 Constructor for Profile.
void Save (const std::string &file_path) const
 Save profile to a text file (label=value, one per line format).
void SetJson (const std::string value)
 Load JSON string into this object.
void SetJsonValue (const Json::Value root)
 Load Json::Value into this object.
std::string ShortName ()
 Return the name of this profile (1920x1080p29.97).

Public Attributes

ProfileInfo info
 Profile data stored here.

Friends

bool operator< (const Profile &l, const Profile &r)
bool operator== (const Profile &l, const Profile &r)
 Equality operator (compare profile objects).
bool operator> (const Profile &l, const Profile &r)

Detailed Description

This class loads a special text-based file called a Profile.

Profile data contains common video settings, such as framerate, height, width, aspect ratio, etc... All derived classes from openshot::WriterBase can load profile data using this class.

// This example demonstrates how to load a profile with this class.
Profile p("/home/jonathan/dv_ntsc_wide"); // Load the DV NTSC Widt profile data.
Profile()
Default Constructor for Profile.
Definition Profiles.cpp:20

Definition at line 64 of file Profiles.h.

Constructor & Destructor Documentation

◆ Profile() [1/2]

Profile::Profile ( )

Default Constructor for Profile.

Definition at line 20 of file Profiles.cpp.

Referenced by operator<, operator==, and operator>.

◆ Profile() [2/2]

Profile::Profile ( std::string path)

Constructor for Profile.

Parameters
pathThe file path / location of a profile file

Definition at line 38 of file Profiles.cpp.

Member Function Documentation

◆ Json()

std::string Profile::Json ( ) const

Generate JSON string of this object.

Definition at line 263 of file Profiles.cpp.

◆ JsonValue()

Json::Value Profile::JsonValue ( ) const

Generate Json::Value for this object.

Definition at line 270 of file Profiles.cpp.

Referenced by Json().

◆ Key()

std::string Profile::Key ( )

Return a unique key of this profile with padding (01920x1080i2997_16:09).

Definition at line 173 of file Profiles.cpp.

◆ LongName()

std::string Profile::LongName ( )

Return a longer format name (1920x1080p @ 29.97 fps (16:9)).

Definition at line 207 of file Profiles.cpp.

◆ LongNameWithDesc()

std::string Profile::LongNameWithDesc ( )

Return a longer format name with description (1920x1080p @ 29.97 fps (16:9) HD 1080i 29.97 fps).

Definition at line 221 of file Profiles.cpp.

◆ Save()

void Profile::Save ( const std::string & file_path) const

Save profile to a text file (label=value, one per line format).

Parameters
file_pathThe file path / location of a profile file

Definition at line 240 of file Profiles.cpp.

◆ SetJson()

void Profile::SetJson ( const std::string value)

Load JSON string into this object.

Definition at line 295 of file Profiles.cpp.

◆ SetJsonValue()

void Profile::SetJsonValue ( const Json::Value root)

Load Json::Value into this object.

Definition at line 312 of file Profiles.cpp.

Referenced by SetJson().

◆ ShortName()

std::string Profile::ShortName ( )

Return the name of this profile (1920x1080p29.97).

Definition at line 196 of file Profiles.cpp.

◆ operator<

bool operator< ( const Profile & l,
const Profile & r )
friend

Less than operator (compare profile objects) Compare # of pixels, then FPS, then DAR

Definition at line 71 of file Profiles.h.

◆ operator==

bool operator== ( const Profile & l,
const Profile & r )
friend

Equality operator (compare profile objects).

Definition at line 128 of file Profiles.h.

◆ operator>

bool operator> ( const Profile & l,
const Profile & r )
friend

Greater than operator (compare profile objects) Compare # of pixels, then FPS, then DAR

Definition at line 100 of file Profiles.h.

Member Data Documentation

◆ info

ProfileInfo openshot::Profile::info

The documentation for this class was generated from the following files: