Performance fixes

Removes some repeated calls to Qt's font layouting by using QStaticText
in FxLine and removing the overridden method ComboBox::sizeHint.

Unifies Mixer::peakValueLeft and Mixer::peakValueRight into
Mixer::getPeakValues so the array is only iterated once.
This commit is contained in:
Michael Gregorius
2016-01-31 13:18:36 +01:00
parent 8928ad751c
commit f6317f126b
8 changed files with 47 additions and 53 deletions

View File

@@ -51,8 +51,6 @@ public:
return castModel<ComboBoxModel>();
}
virtual QSize sizeHint() const;
public slots:
void selectNext();
void selectPrevious();

View File

@@ -28,6 +28,7 @@
#include <QWidget>
#include <QLabel>
#include <QStaticText>
#include "Knob.h"
#include "LcdWidget.h"
@@ -78,7 +79,7 @@ public:
static const int FxLineHeight;
private:
static void drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name, bool isActive, bool sendToThis, bool receiveFromThis );
void drawFxLine( QPainter* p, const FxLine *fxLine, const QString& name, bool isActive, bool sendToThis, bool receiveFromThis );
FxMixerView * m_mv;
LcdWidget* m_lcd;
@@ -91,6 +92,8 @@ private:
static QPixmap * s_sendBgArrow;
static QPixmap * s_receiveBgArrow;
QStaticText m_staticTextName;
private slots:
void renameChannel();
void removeChannel();

View File

@@ -314,8 +314,7 @@ public:
m_playHandleRemovalMutex.unlock();
}
static float peakValueLeft( sampleFrame * _ab, const f_cnt_t _frames );
static float peakValueRight( sampleFrame * _ab, const f_cnt_t _frames );
void getPeakValues( sampleFrame * _ab, const f_cnt_t _frames, float & peakLeft, float & peakRight ) const;
bool criticalXRuns() const;