A config for mux configuration

This commit is contained in:
Moritz Bunkus 2012-04-10 22:18:09 +02:00
parent 3411067f23
commit 25e90df0f1
3 changed files with 107 additions and 0 deletions

View File

@ -3,6 +3,8 @@
#include "common/common_pch.h"
#include "mmg-qt/mux_config.h"
#include <QDir>
#include <QMainWindow>
@ -13,6 +15,9 @@ class MainWindow;
class MainWindow : public QMainWindow {
Q_OBJECT;
protected:
MuxConfig m_config;
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();

46
src/mmg-qt/mux_config.cpp Normal file
View File

@ -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<MuxConfig>();
config->load(QSettings{fileName, QSettings::IniFormat});
return config;
}

56
src/mmg-qt/mux_config.h Normal file
View File

@ -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 <QObject>
#include <QList>
#include <QSettings>
#include <QString>
class MuxConfig;
typedef std::shared_ptr<MuxConfig> MuxConfigPtr;
class MuxConfig : public QObject {
Q_OBJECT;
public:
enum SplitMode {
DoNotSplit = 1,
SplitAfterSize,
SplitAfterDuration,
SplitAfterTimecodes,
SplitByParts,
};
public:
QString m_configFileName;
QList<SourceFilePtr> m_files;
QList<Track *> m_tracks;
// QList<AttachmentPtr> 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