various: encapsulate all code in the olive namespace to avoid name collisions

Large-scale code cleanup. Also adds a license to the top of all files that were
missing it.
This commit is contained in:
itsmattkc
2020-04-06 15:29:53 +10:00
parent 82b6ddccc8
commit 1aa87cbda6
519 changed files with 7939 additions and 158 deletions
+3 -3
View File
@@ -25,9 +25,7 @@
#include "project/item/sequence/sequence.h"
#include "ui/icons/icons.h"
Folder::Folder()
{
}
OLIVE_NAMESPACE_ENTER
Item::Type Folder::type() const
{
@@ -91,3 +89,5 @@ void Folder::Save(QXmlStreamWriter *writer) const
writer->writeEndElement(); // folder
}
OLIVE_NAMESPACE_EXIT
+5 -1
View File
@@ -25,6 +25,8 @@
#include "project/item/footage/footage.h"
#include "project/item/item.h"
OLIVE_NAMESPACE_ENTER
/**
* @brief The Folder class representing a directory in a project structure
*
@@ -34,7 +36,7 @@
class Folder : public Item
{
public:
Folder();
Folder() = default;
virtual Type type() const override;
@@ -50,4 +52,6 @@ private:
};
OLIVE_NAMESPACE_EXIT
#endif // FOLDER_H
+4
View File
@@ -20,6 +20,8 @@
#include "audiostream.h"
OLIVE_NAMESPACE_ENTER
AudioStream::AudioStream() :
index_done_(false)
{
@@ -130,3 +132,5 @@ void AudioStream::append_conformed_version(const AudioRenderingParams &params)
emit ConformAppended(params);
}
OLIVE_NAMESPACE_EXIT
+4
View File
@@ -27,6 +27,8 @@
#include "render/audioparams.h"
#include "stream.h"
OLIVE_NAMESPACE_ENTER
/**
* @brief A Stream derivative containing audio-specific information
*/
@@ -76,4 +78,6 @@ private:
using AudioStreamPtr = std::shared_ptr<AudioStream>;
OLIVE_NAMESPACE_EXIT
#endif // AUDIOSTREAM_H
+4
View File
@@ -28,6 +28,8 @@
#include "core.h"
#include "ui/icons/icons.h"
OLIVE_NAMESPACE_ENTER
Footage::Footage()
{
Clear();
@@ -374,3 +376,5 @@ void Footage::UpdateTooltip()
break;
}
}
OLIVE_NAMESPACE_EXIT
+4
View File
@@ -32,6 +32,8 @@
#include "project/item/footage/videostream.h"
#include "timeline/timelinepoints.h"
OLIVE_NAMESPACE_ENTER
/**
* @brief A reference to an external media file with metadata in a project structure
*
@@ -265,4 +267,6 @@ private:
using FootagePtr = std::shared_ptr<Footage>;
OLIVE_NAMESPACE_EXIT
#endif // FOOTAGE_H
+4
View File
@@ -25,6 +25,8 @@
#include "project/project.h"
#include "render/colormanager.h"
OLIVE_NAMESPACE_ENTER
ImageStream::ImageStream() :
premultiplied_alpha_(false)
{
@@ -136,3 +138,5 @@ void ImageStream::DefaultColorSpaceChanged()
emit ParametersChanged();
}
}
OLIVE_NAMESPACE_EXIT
+4
View File
@@ -23,6 +23,8 @@
#include "stream.h"
OLIVE_NAMESPACE_ENTER
/**
* @brief A Stream derivative containing video-specific information
*/
@@ -67,4 +69,6 @@ private slots:
using ImageStreamPtr = std::shared_ptr<ImageStream>;
OLIVE_NAMESPACE_EXIT
#endif // IMAGESTREAM_H
+4
View File
@@ -23,6 +23,8 @@
#include "footage.h"
#include "ui/icons/icons.h"
OLIVE_NAMESPACE_ENTER
Stream::Stream() :
footage_(nullptr),
type_(kUnknown),
@@ -165,3 +167,5 @@ void Stream::SaveCustomParameters(QXmlStreamWriter*) const
stream_index_(stream_index)
{
}*/
OLIVE_NAMESPACE_EXIT
+5 -1
View File
@@ -29,6 +29,8 @@
#include "common/rational.h"
OLIVE_NAMESPACE_ENTER
class Footage;
/*class StreamID {
@@ -136,7 +138,9 @@ private:
using StreamPtr = std::shared_ptr<Stream>;
OLIVE_NAMESPACE_EXIT
#include <QMetaType>
Q_DECLARE_METATYPE(StreamPtr)
Q_DECLARE_METATYPE(OLIVE_NAMESPACE::StreamPtr)
#endif // STREAM_H
+4
View File
@@ -24,6 +24,8 @@
#include "common/timecodefunctions.h"
OLIVE_NAMESPACE_ENTER
const int64_t VideoStream::kEndTimestamp = AV_NOPTS_VALUE;
VideoStream::VideoStream() :
@@ -202,3 +204,5 @@ bool VideoStream::save_frame_index(const QString &s)
return false;
}
OLIVE_NAMESPACE_EXIT
+4
View File
@@ -23,6 +23,8 @@
#include "imagestream.h"
OLIVE_NAMESPACE_ENTER
class VideoStream : public ImageStream
{
Q_OBJECT
@@ -72,4 +74,6 @@ private:
using VideoStreamPtr = std::shared_ptr<VideoStream>;
OLIVE_NAMESPACE_EXIT
#endif // VIDEOSTREAM_H
+4
View File
@@ -20,6 +20,8 @@
#include "item.h"
OLIVE_NAMESPACE_ENTER
Item::Item() :
parent_(nullptr),
project_(nullptr)
@@ -200,3 +202,5 @@ bool Item::ChildExistsWithNameInternal(const QString &name, Item *folder)
return false;
}
OLIVE_NAMESPACE_EXIT
+4
View File
@@ -34,6 +34,8 @@
#include "node/param.h"
#include "project/item/footage/stream.h"
OLIVE_NAMESPACE_ENTER
class Project;
class Item;
@@ -122,4 +124,6 @@ private:
};
OLIVE_NAMESPACE_EXIT
#endif // ITEM_H
+4
View File
@@ -35,6 +35,8 @@
#include "panel/sequenceviewer/sequenceviewer.h"
#include "ui/icons/icons.h"
OLIVE_NAMESPACE_ENTER
Sequence::Sequence()
{
viewer_output_ = new ViewerOutput();
@@ -283,3 +285,5 @@ void Sequence::NameChangedEvent(const QString &name)
{
viewer_output_->set_media_name(name);
}
OLIVE_NAMESPACE_EXIT
+4
View File
@@ -29,6 +29,8 @@
#include "project/item/item.h"
#include "timeline/timelinepoints.h"
OLIVE_NAMESPACE_ENTER
class Sequence;
using SequencePtr = std::shared_ptr<Sequence>;
@@ -82,4 +84,6 @@ private:
};
OLIVE_NAMESPACE_EXIT
#endif // SEQUENCE_H
@@ -1,6 +0,0 @@
#include "sequenceparams.h"
SequenceParams::SequenceParams()
{
}
@@ -1,11 +0,0 @@
#ifndef SEQUENCEPARAMS_H
#define SEQUENCEPARAMS_H
class SequenceParams
{
public:
SequenceParams();
};
#endif // SEQUENCEPARAMS_H
+4
View File
@@ -28,6 +28,8 @@
#include "dialog/progress/progress.h"
#include "window/mainwindow/mainwindow.h"
OLIVE_NAMESPACE_ENTER
Project::Project()
{
root_.set_project(this);
@@ -153,3 +155,5 @@ QList<ItemPtr> Project::get_items_of_type(Item::Type type) const
{
return root_.get_children_of_type(type, true);
}
OLIVE_NAMESPACE_EXIT
+4
View File
@@ -27,6 +27,8 @@
#include "render/colormanager.h"
#include "project/item/folder/folder.h"
OLIVE_NAMESPACE_ENTER
/**
* @brief A project instance containing all the data pertaining to the user's project
*
@@ -82,4 +84,6 @@ private:
using ProjectPtr = std::shared_ptr<Project>;
OLIVE_NAMESPACE_EXIT
#endif // PROJECT_H
+24
View File
@@ -1,3 +1,23 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2019 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "projectimportmanager.h"
#include <QDir>
@@ -7,6 +27,8 @@
#include "codec/decoder.h"
#include "project/item/footage/footage.h"
OLIVE_NAMESPACE_ENTER
ProjectImportManager::ProjectImportManager(ProjectViewModel *model, Folder *folder, const QStringList &filenames) :
model_(model),
folder_(folder)
@@ -112,3 +134,5 @@ void ProjectImportManager::Import(Folder *folder, const QFileInfoList &import, i
}
}
}
OLIVE_NAMESPACE_EXIT
+24
View File
@@ -1,3 +1,23 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2019 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef PROJECTIMPORTMANAGER_H
#define PROJECTIMPORTMANAGER_H
@@ -7,6 +27,8 @@
#include "projectviewmodel.h"
#include "task/task.h"
OLIVE_NAMESPACE_ENTER
class ProjectImportManager : public Task
{
Q_OBJECT
@@ -34,4 +56,6 @@ private:
};
OLIVE_NAMESPACE_EXIT
#endif // PROJECTIMPORTMANAGER_H
+24 -2
View File
@@ -1,3 +1,23 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2019 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "projectloadmanager.h"
#include <QApplication>
@@ -6,6 +26,8 @@
#include "common/xmlutils.h"
OLIVE_NAMESPACE_ENTER
ProjectLoadManager::ProjectLoadManager(const QString &filename) :
filename_(filename)
{
@@ -55,6 +77,6 @@ void ProjectLoadManager::Action()
project_file.close();
}
}
OLIVE_NAMESPACE_EXIT
+24
View File
@@ -1,9 +1,31 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2019 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef PROJECTLOADMANAGER_H
#define PROJECTLOADMANAGER_H
#include "project/project.h"
#include "task/task.h"
OLIVE_NAMESPACE_ENTER
class ProjectLoadManager : public Task
{
Q_OBJECT
@@ -21,4 +43,6 @@ private:
};
OLIVE_NAMESPACE_EXIT
#endif // PROJECTLOADMANAGER_H
+24
View File
@@ -1,8 +1,30 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2019 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#include "projectsavemanager.h"
#include <QFile>
#include <QXmlStreamWriter>
OLIVE_NAMESPACE_ENTER
ProjectSaveManager::ProjectSaveManager(Project *project) :
project_(project)
{
@@ -34,3 +56,5 @@ void ProjectSaveManager::Action()
emit Succeeded();
}
OLIVE_NAMESPACE_EXIT
+24
View File
@@ -1,9 +1,31 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2019 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef PROJECTSAVEMANAGER_H
#define PROJECTSAVEMANAGER_H
#include "project/project.h"
#include "task/task.h"
OLIVE_NAMESPACE_ENTER
class ProjectSaveManager : public Task
{
Q_OBJECT
@@ -18,4 +40,6 @@ private:
};
OLIVE_NAMESPACE_EXIT
#endif // PROJECTSAVEMANAGER_H
+4
View File
@@ -26,6 +26,8 @@
#include "core.h"
OLIVE_NAMESPACE_ENTER
ProjectViewModel::ProjectViewModel(QObject *parent) :
QAbstractItemModel(parent),
project_(nullptr)
@@ -580,3 +582,5 @@ void ProjectViewModel::RemoveItemCommand::undo_internal()
{
model_->AddChild(parent_, item_);
}
OLIVE_NAMESPACE_EXIT
+4
View File
@@ -26,6 +26,8 @@
#include "project.h"
#include "undo/undocommand.h"
OLIVE_NAMESPACE_ENTER
/**
* @brief An adapter that interprets the data in a Project into a Qt item model for usage in ViewModel Views.
*
@@ -239,4 +241,6 @@ private:
QVector<ColumnType> columns_;
};
OLIVE_NAMESPACE_EXIT
#endif // VIEWMODEL_H