Formatting

This commit is contained in:
Jonas Kvinge
2022-03-22 21:09:05 +01:00
parent 8cb4e75f70
commit f6b70fda71
106 changed files with 446 additions and 479 deletions

View File

@@ -154,7 +154,7 @@ int Analyzer::Base::resizeForBands(const int bands) {
}
else {
exp = 9;
}
}
resizeExponent(exp);
return fht_->size() / 2;

View File

@@ -74,7 +74,7 @@ class AnalyzerContainer : public QWidget {
void Load();
void Save();
void SaveFramerate(const int framerate);
template <typename T>
template<typename T>
void AddAnalyzerType();
void AddFramerate(const QString &name, const int framerate);
@@ -96,10 +96,9 @@ class AnalyzerContainer : public QWidget {
Analyzer::Base *current_analyzer_;
EngineBase *engine_;
};
template <typename T>
template<typename T>
void AnalyzerContainer::AddAnalyzerType() {
int id = analyzer_types_.count();

View File

@@ -63,8 +63,7 @@ BlockAnalyzer::BlockAnalyzer(QWidget *parent)
setMaximumWidth(kMaxColumns * (kWidth + 1) - 1);
// mxcl says null pixmaps cause crashes, so let's play it safe
std::fill(fade_bars_.begin(), fade_bars_.end(), QPixmap(1, 1));
std::fill(fade_bars_.begin(), fade_bars_.end(), QPixmap(1, 1));
}
void BlockAnalyzer::resizeEvent(QResizeEvent *e) {
@@ -89,7 +88,7 @@ void BlockAnalyzer::resizeEvent(QResizeEvent *e) {
if (rows_ != oldRows) {
barpixmap_ = QPixmap(kWidth, rows_ * (kHeight + 1));
std::fill(fade_bars_.begin(), fade_bars_.end(), QPixmap(kWidth, rows_ * (kHeight + 1)));
std::fill(fade_bars_.begin(), fade_bars_.end(), QPixmap(kWidth, rows_ * (kHeight + 1)));
yscale_.resize(rows_ + 1);

View File

@@ -65,14 +65,14 @@ class BlockAnalyzer : public Analyzer::Base {
private:
QPixmap *bar() { return &barpixmap_; }
int columns_, rows_; // number of rows and columns of blocks
int y_; // y-offset from top of widget
int columns_, rows_; // number of rows and columns of blocks
int y_; // y-offset from top of widget
QPixmap barpixmap_;
QPixmap topbarpixmap_;
QPixmap background_;
QPixmap canvas_;
Analyzer::Scope scope_; // so we don't create a vector every frame
QVector<double> store_; // current bar heights
Analyzer::Scope scope_; // so we don't create a vector every frame
QVector<double> store_; // current bar heights
QVector<double> yscale_;
QVector<QPixmap> fade_bars_;

View File

@@ -43,12 +43,12 @@
using Analyzer::Scope;
const int Rainbow::RainbowAnalyzer::kHeight[] = {21, 33};
const int Rainbow::RainbowAnalyzer::kWidth[] = {34, 53};
const int Rainbow::RainbowAnalyzer::kFrameCount[] = {6, 16};
const int Rainbow::RainbowAnalyzer::kRainbowHeight[] = {21, 16};
const int Rainbow::RainbowAnalyzer::kRainbowOverlap[] = {13, 15};
const int Rainbow::RainbowAnalyzer::kSleepingHeight[] = {24, 33};
const int Rainbow::RainbowAnalyzer::kHeight[] = { 21, 33 };
const int Rainbow::RainbowAnalyzer::kWidth[] = { 34, 53 };
const int Rainbow::RainbowAnalyzer::kFrameCount[] = { 6, 16 };
const int Rainbow::RainbowAnalyzer::kRainbowHeight[] = { 21, 16 };
const int Rainbow::RainbowAnalyzer::kRainbowOverlap[] = { 13, 15 };
const int Rainbow::RainbowAnalyzer::kSleepingHeight[] = { 24, 33 };
const char *Rainbow::NyanCatAnalyzer::kName = "Nyanalyzer Cat";
const char *Rainbow::RainbowDashAnalyzer::kName = "Rainbow Dash";

View File

@@ -93,7 +93,7 @@ class RainbowAnalyzer : public Analyzer::Base {
private:
// "constants" that get initialized in the constructor
float band_scale_[kRainbowBands]{};
float band_scale_[kRainbowBands] {};
QPen colors_[kRainbowBands];
// Rainbow Nyancat & Dash
@@ -104,7 +104,7 @@ class RainbowAnalyzer : public Analyzer::Base {
int frame_;
// The y positions of each point on the rainbow.
float history_[kHistorySize * kRainbowBands]{};
float history_[kHistorySize * kRainbowBands] {};
// A cache of the last frame's rainbow,
// so it can be used in the next frame.
@@ -142,6 +142,6 @@ class RainbowDashAnalyzer : public RainbowAnalyzer {
static const char *kName;
};
}
} // namespace Rainbow
#endif // RAINBOWANALYZER_H