]> git.sesse.net Git - kdenlive/blobdiff - src/profilesdialog.h
Complete rewrite of the video4linux capture to use MLT, in progress.
[kdenlive] / src / profilesdialog.h
index 9f5e78f673bc124b34faf33850da9b79dfb9d877..ada0736a6fc0642d92ca16085f7b91a1b961bae1 100644 (file)
@@ -38,10 +38,45 @@ public:
     static QString getPathFromDescription(const QString profileDesc);
     static MltVideoProfile getVideoProfile(QString name);
     static QMap <QString, QString> getProfilesInfo();
-    static void saveProfile(MltVideoProfile &profile);
+    static void saveProfile(MltVideoProfile &profile, QString profilePath = QString());
     static QString existingProfile(MltVideoProfile profile);
     static bool existingProfileDescription(const QString &desc);
 
+    /** @brief Check if a given profile matches passed properties:
+     *  @param width The profile frame width
+     *  @param height The profile frame height
+     *  @param fps The profile fps
+     *  @param par The sample aspect ratio
+     *  @param isImage If true, compare width with profile's display width ( = dar * height)
+     *  @param profile The profile to match
+     *  @return true if properties match profile */
+    static bool matchProfile(int width, int height, double fps, double par, bool isImage, MltVideoProfile profile);
+
+    /** @brief Find profiles that match parameter properties:
+     *  @param width The profile frame width
+     *  @param height The profile frame height
+     *  @param fps The profile fps
+     *  @param par The sample aspect ratio
+     *  @param useDisplayWidth If true, compare width with profile's display width ( = dar * height)
+     *  @return A string list of the matching profiles description */
+    static QMap <QString, QString> getProfilesFromProperties(int width, int height, double fps, double par, bool useDisplayWidth = false);
+
+    /** @brief Returns an value from a string by replacing "%width" and "%height" with given profile values:
+     *  @param profile The profile that gives width & height
+     *  @param eval The string to be evaluated, for example: "%width / 2"
+     *  @return the evaluated value */
+    static double getStringEval(const MltVideoProfile &profile, QString eval);
+
+    /** @brief Get the descriptive text for given colorspace code (defined by MLT)
+     *  @param colorspace An int as defined in mlt_profile.h
+     *  @return The string description */
+    static QString getColorspaceDescription(int colorspace);
+
+    /** @brief Get the colorspace code (defined by MLT) from a descriptive text
+     *  @param desctiption A string description as defined in getColorspaceDescription(int colorspace)
+     *  @return The int code */
+    static int getColorspaceFromDescription(const QString &description);
+
 protected:
     virtual void closeEvent(QCloseEvent *event);