]> git.sesse.net Git - kdenlive/blobdiff - src/profilesdialog.h
Integrate with the required MLT hooks for getting Movit to work.
[kdenlive] / src / profilesdialog.h
index a9927babaa901bfda785a0054e3cc248a7cc3885..11760eeab5e65d367fab218d7752b4d07c5002bc 100644 (file)
@@ -31,15 +31,17 @@ class ProfilesDialog : public QDialog
 
 public:
     ProfilesDialog(QWidget * parent = 0);
-
-    void fillList(const QString selectedProfile = QString());
-    static QMap< QString, QString > getSettingsForProfile(const QString profileName);
-    static QMap< QString, QString > getSettingsFromFile(const QString path);
-    static QString getPathFromDescription(const QString profileDesc);
-    static MltVideoProfile getVideoProfile(QString name);
+    /** @brief Using this constructor, the dialog only allows editing one profile. */
+    explicit ProfilesDialog(QString profilePath, QWidget * parent = 0);
+
+    void fillList(const QString &selectedProfile = QString());
+    static QMap< QString, QString > getSettingsForProfile(const QString &profileName);
+    static QMap< QString, QString > getSettingsFromFile(const QString& path);
+    static QString getPathFromDescription(const QString& profileDesc);
+    static MltVideoProfile getVideoProfile(const QString &name);
     static QMap <QString, QString> getProfilesInfo();
-    static void saveProfile(MltVideoProfile &profile);
-    static QString existingProfile(MltVideoProfile profile);
+    static void saveProfile(MltVideoProfile &profile, QString profilePath = QString());
+    static QString existingProfile(const MltVideoProfile &profile);
     static bool existingProfileDescription(const QString &desc);
 
     /** @brief Check if a given profile matches passed properties:
@@ -50,7 +52,7 @@ public:
      *  @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);
+    static bool matchProfile(int width, int height, double fps, double par, bool isImage, const MltVideoProfile &profile);
 
     /** @brief Find profiles that match parameter properties:
      *  @param width The profile frame width
@@ -65,18 +67,23 @@ public:
      *  @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);
+    static double getStringEval(const MltVideoProfile &profile, QString eval, const QPoint &frameSize = QPoint());
 
     /** @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);
 
 private slots:
-    void slotUpdateDisplay();
+    void slotUpdateDisplay(QString currentProfile = QString());
     void slotCreateProfile();
     bool slotSaveProfile();
     void slotDeleteProfile();
@@ -89,7 +96,9 @@ private:
     int m_selectedProfileIndex;
     bool m_profileIsModified;
     bool m_isCustomProfile;
-    void saveProfile(const QString path);
+    /** @brief If we are in single profile editing, should contain the path for this profile. */
+    QString m_customProfilePath;
+    void saveProfile(QString path);
     bool askForSave();
 };