diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-12-04 19:01:19 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-12-04 19:01:19 +0000 |
| commit | f19ebd13571a75761c951065f9b07b08332d171e (patch) | |
| tree | 4a5062f58c5c2133926ee2d7e6d52f5cfce2b167 /src/plugins/Ui/qsui | |
| parent | d3e52b51bfb4af2209a35acb7a35416feb5f7022 (diff) | |
| download | qmmp-f19ebd13571a75761c951065f9b07b08332d171e.tar.gz qmmp-f19ebd13571a75761c951065f9b07b08332d171e.tar.bz2 qmmp-f19ebd13571a75761c951065f9b07b08332d171e.zip | |
qsui: refactoring
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9134 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Ui/qsui')
| -rw-r--r-- | src/plugins/Ui/qsui/qsuianalyzer.cpp | 26 | ||||
| -rw-r--r-- | src/plugins/Ui/qsui/qsuianalyzer.h | 16 |
2 files changed, 16 insertions, 26 deletions
diff --git a/src/plugins/Ui/qsui/qsuianalyzer.cpp b/src/plugins/Ui/qsui/qsuianalyzer.cpp index 868a042c7..24b5811aa 100644 --- a/src/plugins/Ui/qsui/qsuianalyzer.cpp +++ b/src/plugins/Ui/qsui/qsuianalyzer.cpp @@ -33,15 +33,6 @@ QSUiAnalyzer::QSUiAnalyzer(QWidget *parent) : Visual (parent) { - m_intern_vis_data = nullptr; - m_peaks = nullptr; - m_x_scale = nullptr; - m_rows = 0; - m_cols = 0; - m_offset = 0; - m_update = false; - m_show_cover = false; - m_running = false; m_pixLabel = new QLabel(this); createMenu(); @@ -189,32 +180,31 @@ void QSUiAnalyzer::process() } } -void QSUiAnalyzer::draw (QPainter *p) +void QSUiAnalyzer::draw(QPainter *p) { QBrush brush(Qt::SolidPattern); - int x = 0; for (int j = 0; j < m_cols; ++j) { - x = m_offset + j * m_cell_size.width() + 1; + int x = m_offset + j * m_cell_size.width() + 1; for (int i = 0; i <= m_intern_vis_data[j]; ++i) { - if (i <= m_rows/3) + if (i <= m_rows / 3) brush.setColor(m_color1); - else if (i > m_rows/3 && i <= 2 * m_rows / 3) + else if (i > m_rows / 3 && i <= 2 * m_rows / 3) brush.setColor(m_color2); else brush.setColor(m_color3); - p->fillRect (x, height() - i * m_cell_size.height(), - m_cell_size.width() - 1, m_cell_size.height() - 4, brush); + p->fillRect(x, height() - i * m_cell_size.height(), + m_cell_size.width() - 1, m_cell_size.height() - 4, brush); } if (m_show_peaks) { - p->fillRect (x, height() - int(m_peaks[j]) * m_cell_size.height(), - m_cell_size.width() - 1, m_cell_size.height() - 4, m_peakColor); + p->fillRect(x, height() - int(m_peaks[j]) * m_cell_size.height(), + m_cell_size.width() - 1, m_cell_size.height() - 4, m_peakColor); } } } diff --git a/src/plugins/Ui/qsui/qsuianalyzer.h b/src/plugins/Ui/qsui/qsuianalyzer.h index 52c50c9f9..2194757cc 100644 --- a/src/plugins/Ui/qsui/qsuianalyzer.h +++ b/src/plugins/Ui/qsui/qsuianalyzer.h @@ -65,17 +65,17 @@ private: QPixmap m_bg; QPixmap m_cover; QTimer *m_timer; - double *m_intern_vis_data; - double *m_peaks; - int *m_x_scale; + double *m_intern_vis_data = nullptr; + double *m_peaks = nullptr; + int *m_x_scale = nullptr; double m_peaks_falloff; double m_analyzer_falloff; bool m_show_peaks; - bool m_show_cover; + bool m_show_cover = false; float m_buffer[QMMP_VISUAL_NODE_SIZE]; - int m_cols, m_rows; - int m_offset; - bool m_update; + int m_cols = 0, m_rows = 0; + int m_offset = 0; + bool m_update = false; QLabel *m_pixLabel; //colors QColor m_color1; @@ -90,7 +90,7 @@ private: QActionGroup *m_fpsGroup; QActionGroup *m_analyzerFalloffGroup; QActionGroup *m_peaksFalloffGroup; - bool m_running; + bool m_running = false; }; |
