diff --git a/README.md b/README.md index 5b28b7c4c8e1f2b73a99e65944c48b4bb3f8cc1e..a179e61ed95560827ceb8e0395535b37d9ccdcc7 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,33 @@ # Vivy -## Build +## Prerequisites + +- [rust](https://www.rust-lang.org) compiler with version >= 1.70 +- [cmake](https://cmake.org/) at least the version 3.18 +- C++ compiler with [C++17 support](https://en.cppreference.com/w/cpp/17) +- [mpv](https://mpv.io/) development library +- [Qt6](https://www.qt.io/) development library: QtCore, QtWidgets, QtOpenGL, QtOpenGLWidgets. +- The AV libraries: libavutil libavcodec libavformat +- [cbindgen](https://github.com/mozilla/cbindgen): `cargo install --force cbindgen` -### Using cmake +## Build Simply use cmake to build in another folder of the source folder: ``` cmake -Bbuild -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ``` -To do a debug build, use the debug switch with cmake: -`-DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON`. Note that -the last option is here to generate the `compile_commands.json`, you -should copy it at the root of the project. - -### Dependencies - -This project depends on cmake as a build system. For dependencies on -Windows and MacOS, the easier thing to do is grab qtcreator and find a -way to add the av libraries to it. - -- Ubuntu/debian: Vivy depends on Qt5 and libav. On ubuntu install the - following packages: `qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools - libavutil-dev libavcodec-dev libavformat-dev libmpv-dev cmake clang - clang-format libomp-dev`. -- Arch/Manjaro: TODO! -- FreeBSD and other toasters: You will need cmake, qt and av dev - packages. Set your favorite C++ compiler with `-DCMAKE_CXX_COMPILER` - and you're good to go. +To do a debug build, use the debug switch with cmake: `-DCMAKE_BUILD_TYPE=Debug`. Note that the last +option is here to generate the `compile_commands.json`, you should copy it at the root of the +project. ## Licence -This software is licenced under the LGPL v3.0 or latter. +The C++ part of this software is licenced under the LGPL v3.0 or latter. The Rust part is under the +MIT license. --- -## TODO! +# TODO! + +- Use the rust things for the ASS instead of the C++ thing. diff --git a/src/Lib/Ass/Line.hh b/src/Lib/Ass/Line.hh index 1a7bce03e181f03342f493d082b0abbbd7487b4f..940571ebf47248c00a0bf015bf58dc3d76764337 100644 --- a/src/Lib/Ass/Line.hh +++ b/src/Lib/Ass/Line.hh @@ -27,16 +27,12 @@ class Line final { QString contentAsText; - AssFactory *const assFactory; + AssFactory *assFactory; public: - //explicit Line(const Line &) = default; explicit Line(AssFactory *const, const QString &); explicit Line(); explicit Line(const Line &c) = default; - Line &operator=(const Line &) = delete; - - ~Line() noexcept = default; void setStart(quint64 s) noexcept; void setEnd(quint64 s) noexcept; diff --git a/src/Lib/Ass/Syl.hh b/src/Lib/Ass/Syl.hh index 920dba5ed139b58a04b95b96824e9719c2332205..84e8ea8b3791f7dcaf48fc0968eed9a1fa70c853 100644 --- a/src/Lib/Ass/Syl.hh +++ b/src/Lib/Ass/Syl.hh @@ -14,7 +14,7 @@ private: quint64 duration{ 0 }; public: - Line *const parentLine; + Line *parentLine; public: enum class ConstructMode { @@ -22,7 +22,6 @@ public: ReadAssTags // Read ass tags }; - //explicit Syl(const Syl &) noexcept = default; // FIXME: define copy contructor explicit Syl(Line *const, const QString &, ConstructMode mode = ConstructMode::ReadAssTags) noexcept; diff --git a/src/Lib/JsonBuilder.hh b/src/Lib/JsonBuilder.hh index 103187e0f32cdc14883af0093bbe1ded7f51afeb..9bd1a0748649af930ed5e2c6b247e8bfc36d9a74 100644 --- a/src/Lib/JsonBuilder.hh +++ b/src/Lib/JsonBuilder.hh @@ -20,10 +20,11 @@ struct JsonBuilder final { template <PropertyConstViewable T> static QPair<QString, QJsonValue> getSubDocumentJson(const QString &name, std::shared_ptr<T> subDocPtr) noexcept { - if (subDocPtr == nullptr) + if (subDocPtr == nullptr) { return QPair<QString, QJsonValue>{ name, QJsonValue() }; - else + } else { return QPair<QString, QJsonValue>{ name, subDocPtr->getProperties().object() }; + } } private: diff --git a/src/Lib/Utils.hh b/src/Lib/Utils.hh index 3783621edd799b3564d24b2da8f26f2ea74747ac..3da7aae9343c3fab69b1018e13f97a42a7e68f97 100644 --- a/src/Lib/Utils.hh +++ b/src/Lib/Utils.hh @@ -58,9 +58,6 @@ using chrono::duration_cast; #define VIVY_DEFAULT_MOVE_CTOR(classname) \ explicit classname(classname &&) noexcept = default; /* Move */ -// QStringLiteral but for regexes -#define QRegularExpressionLiteral(str) QRegularExpression(QStringLiteral(str)) - namespace Vivy { // Concept for classes that can be viewd inside a property view