diff --git a/src/mmg-qt/main_window.h b/src/mmg-qt/main_window.h index 5d3b29354..2d222da06 100644 --- a/src/mmg-qt/main_window.h +++ b/src/mmg-qt/main_window.h @@ -3,6 +3,8 @@ #include "common/common_pch.h" +#include "mmg-qt/mux_config.h" + #include #include @@ -13,6 +15,9 @@ class MainWindow; class MainWindow : public QMainWindow { Q_OBJECT; +protected: + MuxConfig m_config; + public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); diff --git a/src/mmg-qt/mux_config.cpp b/src/mmg-qt/mux_config.cpp new file mode 100644 index 000000000..308cac2d4 --- /dev/null +++ b/src/mmg-qt/mux_config.cpp @@ -0,0 +1,46 @@ +#include "common/common_pch.h" + +#include "mmg-qt/mux_config.h" + +MuxConfig::MuxConfig() + : m_splitMode{DoNotSplit} + , m_splitMaxFiles{0} + , m_linkFiles{false} + , m_webmMode{false} +{ +} + +MuxConfig::~MuxConfig() +{ +} + +void +MuxConfig::load(QSettings const &settings) { + // TODO +} + +void +MuxConfig::save(QSettings &settings) + const { + // TODO +} + +void +MuxConfig::save(QString const &fileName) + const { + // TODO +} + +void +MuxConfig::reset() + const { + // TODO +} + +MuxConfigPtr +MuxConfig::load(QString const &fileName) { + auto config = std::make_shared(); + config->load(QSettings{fileName, QSettings::IniFormat}); + + return config; +} diff --git a/src/mmg-qt/mux_config.h b/src/mmg-qt/mux_config.h new file mode 100644 index 000000000..387633d70 --- /dev/null +++ b/src/mmg-qt/mux_config.h @@ -0,0 +1,56 @@ +#ifndef MTX_MMGQT_MUX_CONFIG_H +#define MTX_MMGQT_MUX_CONFIG_H + +#include "common/common_pch.h" + +// #include "mmg-qt/attachment.h" +#include "mmg-qt/source_file.h" +#include "mmg-qt/track.h" + +#include +#include +#include +#include + +class MuxConfig; +typedef std::shared_ptr MuxConfigPtr; + +class MuxConfig : public QObject { + Q_OBJECT; + +public: + enum SplitMode { + DoNotSplit = 1, + SplitAfterSize, + SplitAfterDuration, + SplitAfterTimecodes, + SplitByParts, + }; + +public: + QString m_configFileName; + + QList m_files; + QList m_tracks; + // QList m_attachments; + + QString m_title, m_destination, m_globalTags, m_segmentinfo, m_splitAfterSize, m_splitAfterDuration, m_splitAfterTimecodes, m_splitByParts; + QString m_segmentUIDs, m_previousSegmentUID, m_nextSegmentUID, m_chapters, m_chapterLanguage, m_chapterCharacterSet, m_chapterCueNameFormat, m_userDefinedOptions; + SplitMode m_splitMode; + unsigned int m_splitMaxFiles; + bool m_linkFiles, m_webmMode; + +public: + MuxConfig(); + virtual ~MuxConfig(); + + virtual void load(QSettings const &settings); + virtual void save(QSettings &settings) const; + virtual void save(QString const &fileName) const; + virtual void reset() const; + +public: + static MuxConfigPtr load(QString const &fileName); +}; + +#endif // MTX_MMGQT_MUX_CONFIG_H