From 57c006a5cc65f61cb5b279e93ee8d94261a2585b Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Thu, 24 Jun 2021 21:47:31 +0200
Subject: [PATCH] MISC: Apply clang-format

---
 src/Ass/Char.cc        |  3 ++-
 src/Ass/Char.h         |  8 ++++----
 src/Ass/Line.cc        |  2 +-
 src/Ass/Line.h         | 12 ++++++------
 src/Ass/Style.cc       |  2 +-
 src/Ass/Style.h        | 19 +++++++++----------
 src/Ass/Syl.cc         |  2 +-
 src/Ass/Syl.h          | 10 +++++-----
 src/AudioUtils.c       |  4 ++--
 src/AudioVisualizer.cc |  2 +-
 src/TimingScene.hpp    |  5 ++++-
 src/TimingView.cc      |  4 ++--
 src/TimingView.hpp     |  2 +-
 13 files changed, 39 insertions(+), 36 deletions(-)

diff --git a/src/Ass/Char.cc b/src/Ass/Char.cc
index 32bbc95e..fbc0f7cf 100644
--- a/src/Ass/Char.cc
+++ b/src/Ass/Char.cc
@@ -2,6 +2,7 @@
 #include "Syl.h"
 
 Char::Char(Syl *const syl, const QChar)
-    : parentLine(syl->parentLine), parentSyl(syl)
+    : parentLine(syl->parentLine)
+    , parentSyl(syl)
 {
 }
diff --git a/src/Ass/Char.h b/src/Ass/Char.h
index 032daead..f031e8b8 100644
--- a/src/Ass/Char.h
+++ b/src/Ass/Char.h
@@ -11,7 +11,7 @@ class Syl;
 class Char {
 private:
     QChar content;
-    quint64 dur{0};
+    quint64 dur{ 0 };
 
 public:
     Line *const parentLine;
@@ -19,11 +19,11 @@ public:
 
 public:
     // Copy constructor
-    explicit Char(const Char&) = default;
+    explicit Char(const Char &) = default;
     explicit Char(Syl *const, const QChar);
 
-    Char& operator=(const Char&) = delete;
-    ~Char() noexcept = default;
+    Char &operator=(const Char &) = delete;
+    ~Char() noexcept              = default;
 };
 
 #endif // VIVY_ASS_CHAR_H
diff --git a/src/Ass/Line.cc b/src/Ass/Line.cc
index d9c6e84a..b4da36c7 100644
--- a/src/Ass/Line.cc
+++ b/src/Ass/Line.cc
@@ -1,5 +1,5 @@
 #include "Line.h"
 
-Line::Line(const QString&)
+Line::Line(const QString &)
 {
 }
diff --git a/src/Ass/Line.h b/src/Ass/Line.h
index 6904659e..f42abdac 100644
--- a/src/Ass/Line.h
+++ b/src/Ass/Line.h
@@ -8,16 +8,16 @@
 
 class Line {
 private:
-    quint64 start{0};
-    quint64 end{0};
+    quint64 start{ 0 };
+    quint64 end{ 0 };
 
     QVector<Syl> content{};
 
 public:
-    explicit Line() = default;
-    explicit Line(const Line&) = default;
-    explicit Line(const QString&);
-    Line& operator=(const Line&) = delete;
+    explicit Line()             = default;
+    explicit Line(const Line &) = default;
+    explicit Line(const QString &);
+    Line &operator=(const Line &) = delete;
 
     ~Line() noexcept = default;
 
diff --git a/src/Ass/Style.cc b/src/Ass/Style.cc
index 152c8599..557b2866 100644
--- a/src/Ass/Style.cc
+++ b/src/Ass/Style.cc
@@ -1,5 +1,5 @@
 #include "Style.h"
 
-Style::Style(const QString&)
+Style::Style(const QString &)
 {
 }
diff --git a/src/Ass/Style.h b/src/Ass/Style.h
index 485678db..2f9d30cc 100644
--- a/src/Ass/Style.h
+++ b/src/Ass/Style.h
@@ -23,23 +23,22 @@ private:
 
     Color primaryColor, secondaryColor, outlineColor, backColor;
 
-    bool bold{false}, italic{false}, underline{false}, strikeOut{false};
+    bool bold{ false }, italic{ false }, underline{ false }, strikeOut{ false };
 
-    float scaleX{0.0}, scaleY{0.0};
-    float spacing{0.0}, angle{0.0}, borderStyle{0.0};
+    float scaleX{ 0.0 }, scaleY{ 0.0 };
+    float spacing{ 0.0 }, angle{ 0.0 }, borderStyle{ 0.0 };
 
-    int alignment{2}, marginL{0}, marginR{0}, marginV{0};
+    int alignment{ 2 }, marginL{ 0 }, marginR{ 0 }, marginV{ 0 };
     int encoding;
 
 public:
     // Should grab and copy a user-changeable default style
-    explicit Style() = delete;
-    explicit Style(const Style&) = default;
-    explicit Style(const QString&);
+    explicit Style()              = delete;
+    explicit Style(const Style &) = default;
+    explicit Style(const QString &);
 
-    Style& operator=(const Style&) = delete;
-    ~Style() noexcept = default;
+    Style &operator=(const Style &) = delete;
+    ~Style() noexcept               = default;
 };
 
-
 #endif
diff --git a/src/Ass/Syl.cc b/src/Ass/Syl.cc
index 8f14ddbc..9edf155a 100644
--- a/src/Ass/Syl.cc
+++ b/src/Ass/Syl.cc
@@ -1,6 +1,6 @@
 #include "Syl.h"
 
-Syl::Syl(Line *const line, const QString&)
+Syl::Syl(Line *const line, const QString &)
     : parentLine(line)
 {
 }
diff --git a/src/Ass/Syl.h b/src/Ass/Syl.h
index a1cad338..3dd6c425 100644
--- a/src/Ass/Syl.h
+++ b/src/Ass/Syl.h
@@ -10,17 +10,17 @@ class Line;
 class Syl {
 private:
     QVector<Char> content;
-    quint64 dur{0};
+    quint64 dur{ 0 };
 
 public:
     Line *const parentLine;
 
 public:
-    explicit Syl(const Syl&) = default;
-    explicit Syl(Line *const, const QString&);
+    explicit Syl(const Syl &) = default;
+    explicit Syl(Line *const, const QString &);
 
-    Syl& operator=(const Syl&) = delete;
-    ~Syl() noexcept = default;
+    Syl &operator=(const Syl &) = delete;
+    ~Syl() noexcept             = default;
 };
 
 #endif
diff --git a/src/AudioUtils.c b/src/AudioUtils.c
index c2d7f7f4..fc7cf397 100644
--- a/src/AudioUtils.c
+++ b/src/AudioUtils.c
@@ -175,8 +175,8 @@ RawImageDataNewFromData(const double *data, const size_t size)
     const int chunk_size  = 512;
     const int overlap     = 128;
     const int decal       = chunk_size - overlap;
-    const size_t width       = (size - chunk_size) / decal;
-    const size_t height      = chunk_size;
+    const size_t width    = (size - chunk_size) / decal;
+    const size_t height   = chunk_size;
     unsigned char *pixs   = (unsigned char *)malloc(sizeof(unsigned char) * width * height / 2);
     FFTSample *chunk_data = (FFTSample *)av_malloc_array(2 * chunk_size, sizeof(FFTSample));
     RDFTContext *ctx      = av_rdft_init((int)log2(chunk_size), DFT_R2C);
diff --git a/src/AudioVisualizer.cc b/src/AudioVisualizer.cc
index 0503720c..19942f59 100644
--- a/src/AudioVisualizer.cc
+++ b/src/AudioVisualizer.cc
@@ -16,7 +16,7 @@ AudioVisualizer::AudioVisualizer(QWidget *parent) noexcept
 void
 AudioVisualizer::printSpectrum(QImage pixmap) noexcept
 {
-    TimingView *timer        = new TimingView(pixmap, 0);
+    TimingView *timer   = new TimingView(pixmap, 0);
     QVBoxLayout *layout = new QVBoxLayout;
 
     layout->addWidget(timer);
diff --git a/src/TimingScene.hpp b/src/TimingScene.hpp
index a1a799b5..352b2099 100644
--- a/src/TimingScene.hpp
+++ b/src/TimingScene.hpp
@@ -40,7 +40,10 @@ private:
     TimingMode timingMode;
 
 public:
-    inline QGraphicsPixmapItem* bg() { return backgroundImg; };
+    inline QGraphicsPixmapItem *bg()
+    {
+        return backgroundImg;
+    };
 
     void mousePressEvent(QGraphicsSceneMouseEvent *event) noexcept override;
 
diff --git a/src/TimingView.cc b/src/TimingView.cc
index 81bd2856..278936b2 100644
--- a/src/TimingView.cc
+++ b/src/TimingView.cc
@@ -35,8 +35,8 @@ TimingView::mousePressEvent(QMouseEvent *event) noexcept
     QGraphicsItem *got;
     if ((got = scene->itemAt(pos, QTransform())) == nullptr || got == scene->bg()) {
         const int height = static_cast<int>(scene->height());
-        scene->addItem(new TimingBar(QLine(x, 0, x, height),
-                                     event->button() == Qt::LeftButton ? startColour : endColour));
+        scene->addItem(
+            new TimingBar(QLine(x, 0, x, height), event->button() == Qt::LeftButton ? startColour : endColour));
     }
 
     QGraphicsView::mousePressEvent(event);
diff --git a/src/TimingView.hpp b/src/TimingView.hpp
index eb699282..1b6a8647 100644
--- a/src/TimingView.hpp
+++ b/src/TimingView.hpp
@@ -26,7 +26,7 @@ public:
     ~TimingView() noexcept = default;
 
 private:
-    TimingScene* scene;
+    TimingScene *scene;
 
 public slots:
 };
-- 
GitLab