FxMixer GUI updates: code

This commit is contained in:
Vesa
2014-06-19 17:59:15 +03:00
parent 29c7894993
commit 4bcbb1abcc
9 changed files with 141 additions and 64 deletions

View File

@@ -40,6 +40,7 @@ class FxLine : public QWidget
{
Q_OBJECT
public:
Q_PROPERTY( QBrush backgroundActive READ backgroundActive WRITE setBackgroundActive )
FxLine( QWidget * _parent, FxMixerView * _mv, int _channelIndex);
~FxLine();
@@ -54,10 +55,14 @@ public:
knob * m_sendKnob;
SendButtonIndicator * m_sendBtn;
QBrush backgroundActive() const;
void setBackgroundActive( const QBrush & c );
private:
FxMixerView * m_mv;
LcdWidget* m_lcd;
int m_channelIndex;
QBrush m_backgroundActive;
private slots:
void renameChannel();

View File

@@ -22,8 +22,8 @@
*
*/
#ifndef _FX_MIXER_VIEW_H
#define _FX_MIXER_VIEW_H
#ifndef FX_MIXER_VIEW_H
#define FX_MIXER_VIEW_H
#include <QtGui/QWidget>
#include <QtGui/QHBoxLayout>

View File

@@ -11,22 +11,23 @@
class FxLine;
class FxMixerView;
class SendButtonIndicator : public QLabel {
public:
SendButtonIndicator( QWidget * _parent, FxLine * _owner,
FxMixerView * _mv);
class SendButtonIndicator : public QLabel
{
public:
SendButtonIndicator( QWidget * _parent, FxLine * _owner,
FxMixerView * _mv);
virtual void mousePressEvent( QMouseEvent * e );
void updateLightStatus();
virtual void mousePressEvent( QMouseEvent * e );
void updateLightStatus();
private:
private:
FxLine * m_parent;
FxMixerView * m_mv;
QPixmap qpmOn;
QPixmap qpmOff;
FxLine * m_parent;
FxMixerView * m_mv;
static QPixmap * s_qpmOn;
static QPixmap * s_qpmOff;
FloatModel * getSendModel();
FloatModel * getSendModel();
};
#endif // SENDBUTTONINDICATOR_H

View File

@@ -45,8 +45,8 @@
*/
#ifndef _FADER_H
#define _FADER_H
#ifndef FADER_H
#define FADER_H
#include <QtCore/QTime>
#include <QtGui/QWidget>
@@ -61,6 +61,8 @@ class fader : public QWidget, public FloatModelView
{
Q_OBJECT
public:
Q_PROPERTY( QColor peakGreen READ peakGreen WRITE setPeakGreen )
Q_PROPERTY( QColor peakRed READ peakRed WRITE setPeakRed )
fader( FloatModel * _model, const QString & _name, QWidget * _parent );
virtual ~fader();
@@ -70,6 +72,10 @@ public:
void setPeak_R( float fPeak );
float getPeak_R() { return m_fPeakValue_R; }
QColor peakGreen() const;
QColor peakRed() const;
void setPeakGreen( const QColor & c );
void setPeakRed( const QColor & c );
private:
virtual void contextMenuEvent( QContextMenuEvent * _me );
@@ -85,7 +91,7 @@ private:
float fRange = m_model->maxValue() - m_model->minValue();
float realVal = m_model->value() - m_model->minValue();
return height() - ( ( height() - m_knob.height() ) * ( realVal / fRange ) );
return height() - ( ( height() - ( *s_knob ).height() ) * ( realVal / fRange ) );
}
FloatModel * m_model;
@@ -103,9 +109,9 @@ private:
QTime m_lastPeakTime_L;
QTime m_lastPeakTime_R;
QPixmap m_back;
QPixmap m_leds;
QPixmap m_knob;
static QPixmap * s_back;
static QPixmap * s_leds;
static QPixmap * s_knob;
int m_moveStartPoint;
float m_startValue;
@@ -113,6 +119,8 @@ private:
static textFloat * s_textFloat;
void updateTextFloat();
QColor m_peakGreen;
QColor m_peakRed;
} ;