Skip to content

Commit

Permalink
Start using namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Sep 7, 2024
1 parent d1efe71 commit 0e2c38f
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 26 deletions.
2 changes: 2 additions & 0 deletions src/app/GUI/RenderWidgets/outputsettingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "themesupport.h"
#include "formatoptions.h"

using namespace Friction::Core;

OutputSettingsDialog::OutputSettingsDialog(const OutputSettings &settings,
QWidget *parent) :
QDialog(parent), mInitialSettings(settings) {
Expand Down
6 changes: 3 additions & 3 deletions src/app/GUI/RenderWidgets/outputsettingsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ class OutputSettingsDialog : public QDialog {

QTreeWidget *mFormatOptionsTree;
void setupFormatOptionsTree();
void populateFormatOptionsTree(const FormatOptions &options);
QComboBox *createComboBoxFormatOptType(int selected = FormatType::fTypeMeta);
FormatOptions getFormatOptions();
void populateFormatOptionsTree(const Friction::Core::FormatOptions &options);
QComboBox *createComboBoxFormatOptType(int selected = Friction::Core::FormatType::fTypeMeta);
Friction::Core::FormatOptions getFormatOptions();

void addVideoCodec(const AVCodec * const codec,
const AVOutputFormat *outputFormat,
Expand Down
2 changes: 2 additions & 0 deletions src/core/ReadWrite/ereadstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "evformat.h"
#include "Boxes/boundingbox.h"

using namespace Friction::Core;

eReadFutureTable::eReadFutureTable(QIODevice * const main) : mMain(main) {}

void eReadFutureTable::read() {
Expand Down
2 changes: 1 addition & 1 deletion src/core/ReadWrite/ereadstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class CORE_EXPORT eReadStream {
eReadStream& operator>>(QString &val);
eReadStream& operator>>(QByteArray &val);
eReadStream& operator>>(SimpleBrushWrapper*& brush);
eReadStream& operator>>(FormatOptions &val);
eReadStream& operator>>(Friction::Core::FormatOptions &val);

QString readFilePath();

Expand Down
2 changes: 2 additions & 0 deletions src/core/ReadWrite/ewritestream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "filefooter.h"
#include "framerange.h"

using namespace Friction::Core;

void eWriteFutureTable::write(eWriteStream &dst) {
for(const auto& future : mFutures) {
dst.write(&future, sizeof(eFuturePos));
Expand Down
2 changes: 1 addition & 1 deletion src/core/ReadWrite/ewritestream.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CORE_EXPORT eWriteStream {
eWriteStream& operator<<(const QString& val);
eWriteStream& operator<<(const QByteArray& val);
eWriteStream& operator<<(SimpleBrushWrapper* const brush);
eWriteStream& operator<<(const FormatOptions &val);
eWriteStream& operator<<(const Friction::Core::FormatOptions &val);

void writeFilePath(const QString& absPath);

Expand Down
51 changes: 32 additions & 19 deletions src/core/formatoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,44 @@
#
*/

#ifndef FORMATOPTIONS_H
#define FORMATOPTIONS_H
#ifndef FRICTION_FORMAT_OPTIONS_H
#define FRICTION_FORMAT_OPTIONS_H

#include "core_global.h"

#include <QList>
#include <QString>
#include <QStringList>

enum CORE_EXPORT FormatType
namespace Friction
{
fTypeMeta,
fTypeFormat,
fTypeCodec
};
namespace Core
{
enum CORE_EXPORT FormatType
{
fTypeMeta,
fTypeFormat,
fTypeCodec
};

struct CORE_EXPORT FormatOption
{
QString fKey;
QString fValue;
int fType;
};
struct CORE_EXPORT FormatOption
{
QString fKey;
QString fValue;
int fType;
};

struct CORE_EXPORT FormatOptions
{
QList<FormatOption> fValues;
};
struct CORE_EXPORT FormatOptions
{
QList<FormatOption> fValues;
};

struct CORE_EXPORT FormatOptionsList
{
QStringList fTypes;
QStringList fKeys;
QStringList fValues;
};
}
}

#endif // FORMATOPTIONS_H
#endif // FRICTION_FORMAT_OPTIONS_H
14 changes: 14 additions & 0 deletions src/core/outputsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "ReadWrite/evformat.h"
#include "appsupport.h"

using namespace Friction::Core;

QList<qsptr<OutputSettingsProfile>> OutputSettingsProfile::sOutputProfiles;
bool OutputSettingsProfile::sOutputProfilesLoaded = false;

Expand Down Expand Up @@ -299,3 +301,15 @@ OutputSettingsProfile *OutputSettingsProfile::sGetByName(const QString &name)
}
return nullptr;
}

FormatOptions OutputSettingsProfile::toFormatOptions(const FormatOptionsList &list)
{
FormatOptions options;
return options;
}

FormatOptionsList OutputSettingsProfile::toFormatOptionsList(const FormatOptions &options)
{
FormatOptionsList list;
return list;
}
7 changes: 5 additions & 2 deletions src/core/outputsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct CORE_EXPORT OutputSettings
AVPixelFormat fVideoPixelFormat = AV_PIX_FMT_NONE;
int fVideoBitrate = 0;
int fVideoProfile = FF_PROFILE_UNKNOWN;
FormatOptions fVideoOptions;
Friction::Core::FormatOptions fVideoOptions;

bool fAudioEnabled = false;
const AVCodec *fAudioCodec = nullptr;
Expand Down Expand Up @@ -92,12 +92,15 @@ class CORE_EXPORT OutputSettingsProfile : public SelfRef
static QList<qsptr<OutputSettingsProfile>> sOutputProfiles;
static bool sOutputProfilesLoaded;

static Friction::Core::FormatOptions toFormatOptions(const Friction::Core::FormatOptionsList &list);
static Friction::Core::FormatOptionsList toFormatOptionsList(const Friction::Core::FormatOptions &options);

signals:
void changed();

private:
QString mPath;
QString mName = "Untitled";
QString mName = tr("Untitled");
OutputSettings mSettings;
};

Expand Down
2 changes: 2 additions & 0 deletions src/core/videoencoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
} \
}

using namespace Friction::Core;

VideoEncoder *VideoEncoder::sInstance = nullptr;

VideoEncoder::VideoEncoder() {
Expand Down

0 comments on commit 0e2c38f

Please sign in to comment.