Skip to content

Commit

Permalink
clang-tidy: implementing some suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmm committed Mar 9, 2024
1 parent 52c6ceb commit 0b38075
Show file tree
Hide file tree
Showing 25 changed files with 127 additions and 14 deletions.
2 changes: 2 additions & 0 deletions src/autogain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <mutex>
#include <span>
#include <string>
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down
3 changes: 3 additions & 0 deletions src/bass_loudness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <memory>
#include <span>
#include <string>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down
7 changes: 6 additions & 1 deletion src/compressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
#include <memory>
#include <span>
#include <string>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "pipe_objects.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Compressor::Compressor(const std::string& tag,
const std::string& schema,
Expand Down Expand Up @@ -174,7 +179,7 @@ void Compressor::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
2 changes: 2 additions & 0 deletions src/crossfeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <mutex>
#include <span>
#include <string>
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/crystalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void Crystalizer::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions src/deepfilternet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#include <span>
#include <string>
#include <vector>
#include "ladspa_wrapper.hpp"
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "resampler.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down
3 changes: 3 additions & 0 deletions src/deesser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <memory>
#include <span>
#include <string>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down
5 changes: 4 additions & 1 deletion src/delay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <memory>
#include <span>
#include <string>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down Expand Up @@ -113,7 +116,7 @@ void Delay::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
4 changes: 3 additions & 1 deletion src/echo_canceller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <mutex>
#include <span>
#include <string>
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down Expand Up @@ -185,7 +187,7 @@ void EchoCanceller::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
6 changes: 5 additions & 1 deletion src/equalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include "equalizer.hpp"
#include <bits/basic_string.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <glib.h>
Expand All @@ -29,6 +30,9 @@
#include <string>
#include <utility>
#include <vector>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_equalizer.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"
Expand Down Expand Up @@ -263,7 +267,7 @@ void Equalizer::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
6 changes: 5 additions & 1 deletion src/expander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include <memory>
#include <span>
#include <string>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "pipe_objects.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down Expand Up @@ -165,7 +169,7 @@ void Expander::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
3 changes: 3 additions & 0 deletions src/filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <memory>
#include <span>
#include <string>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down
6 changes: 5 additions & 1 deletion src/gate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include <memory>
#include <span>
#include <string>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "pipe_objects.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down Expand Up @@ -164,7 +168,7 @@ void Gate::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
6 changes: 5 additions & 1 deletion src/limiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include <memory>
#include <span>
#include <string>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "pipe_objects.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down Expand Up @@ -148,7 +152,7 @@ void Limiter::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
5 changes: 4 additions & 1 deletion src/loudness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <memory>
#include <span>
#include <string>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down Expand Up @@ -107,7 +110,7 @@ void Loudness::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
5 changes: 4 additions & 1 deletion src/maximizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <memory>
#include <span>
#include <string>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down Expand Up @@ -116,7 +119,7 @@ void Maximizer::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
6 changes: 5 additions & 1 deletion src/multiband_compressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include <span>
#include <string>
#include <utility>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "pipe_objects.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down Expand Up @@ -130,7 +134,7 @@ void MultibandCompressor::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
18 changes: 18 additions & 0 deletions src/multiband_compressor_band_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
*/

#include "multiband_compressor_band_box.hpp"
#define FMT_HEADER_ONLY
#include <fmt/core.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <glib.h>
#include <gobject/gobject.h>
#include <gtk/gtk.h>
#include <gtk/gtkbox.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtkdropdown.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtktogglebutton.h>
#include <vector>
#include "tags_multiband_compressor.hpp"
#include "tags_resources.hpp"
#include "ui_helpers.hpp"
#include "util.hpp"

namespace ui::multiband_compressor_band_box {

Expand Down
6 changes: 5 additions & 1 deletion src/multiband_gate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include <span>
#include <string>
#include <utility>
#include "lv2_wrapper.hpp"
#include "pipe_manager.hpp"
#include "pipe_objects.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down Expand Up @@ -130,7 +134,7 @@ void MultibandGate::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
18 changes: 18 additions & 0 deletions src/multiband_gate_band_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
*/

#include "multiband_gate_band_box.hpp"
#define FMT_HEADER_ONLY
#include <fmt/core.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <glib.h>
#include <gobject/gobject.h>
#include <gtk/gtk.h>
#include <gtk/gtkbox.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtkdropdown.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtktogglebutton.h>
#include <vector>
#include "tags_multiband_gate.hpp"
#include "tags_resources.hpp"
#include "ui_helpers.hpp"
#include "util.hpp"

namespace ui::multiband_gate_band_box {

Expand Down
4 changes: 3 additions & 1 deletion src/pitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <mutex>
#include <span>
#include <string>
#include "pipe_manager.hpp"
#include "plugin_base.hpp"
#include "tags_plugin_name.hpp"
#include "util.hpp"

Expand Down Expand Up @@ -300,7 +302,7 @@ void Pitch::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
15 changes: 15 additions & 0 deletions src/preferences_spectrum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@
*/

#include "preferences_spectrum.hpp"
#include <adwaita.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <glib.h>
#include <gobject/gobject.h>
#include <gtk/gtk.h>
#include <gtk/gtkcolordialogbutton.h>
#include <gtk/gtkdropdown.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkswitch.h>
#include <vector>
#include "tags_resources.hpp"
#include "tags_schema.hpp"
#include "ui_helpers.hpp"
#include "util.hpp"

namespace ui::preferences::spectrum {

Expand Down
1 change: 1 addition & 0 deletions src/resampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include "resampler.hpp"
#include <samplerate.h>

Resampler::Resampler(const int& input_rate, const int& output_rate) : output(1, 0) {
resample_ratio = static_cast<double>(output_rate) / static_cast<double>(input_rate);
Expand Down
2 changes: 1 addition & 1 deletion src/rnnoise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void RNNoise::process(std::span<float>& left_in,

util::debug(log_tag + name + " latency: " + util::to_string(latency_value, "") + " s");

util::idle_add([=, this]() {
util::idle_add([this]() {
if (!post_messages || latency.empty()) {
return;
}
Expand Down
Loading

0 comments on commit 0b38075

Please sign in to comment.