Reformat MixerChannelView classes (#7431)
This commit is contained in:
@@ -25,6 +25,13 @@
|
||||
#ifndef MIXER_CHANNEL_VIEW_H
|
||||
#define MIXER_CHANNEL_VIEW_H
|
||||
|
||||
#include <QGraphicsView>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPixmap>
|
||||
#include <QStackedWidget>
|
||||
#include <QWidget>
|
||||
|
||||
#include "EffectRackView.h"
|
||||
#include "Fader.h"
|
||||
#include "Knob.h"
|
||||
@@ -32,109 +39,100 @@
|
||||
#include "PixmapButton.h"
|
||||
#include "SendButtonIndicator.h"
|
||||
|
||||
#include <QGraphicsView>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPixmap>
|
||||
#include <QWidget>
|
||||
#include <QStackedWidget>
|
||||
|
||||
namespace lmms
|
||||
{
|
||||
class MixerChannel;
|
||||
namespace lmms {
|
||||
class MixerChannel;
|
||||
}
|
||||
|
||||
namespace lmms::gui
|
||||
namespace lmms::gui {
|
||||
class PeakIndicator;
|
||||
|
||||
constexpr int MIXER_CHANNEL_INNER_BORDER_SIZE = 3;
|
||||
constexpr int MIXER_CHANNEL_OUTER_BORDER_SIZE = 1;
|
||||
|
||||
class MixerChannelView : public QWidget
|
||||
{
|
||||
class PeakIndicator;
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QBrush backgroundActive READ backgroundActive WRITE setBackgroundActive)
|
||||
Q_PROPERTY(QColor strokeOuterActive READ strokeOuterActive WRITE setStrokeOuterActive)
|
||||
Q_PROPERTY(QColor strokeOuterInactive READ strokeOuterInactive WRITE setStrokeOuterInactive)
|
||||
Q_PROPERTY(QColor strokeInnerActive READ strokeInnerActive WRITE setStrokeInnerActive)
|
||||
Q_PROPERTY(QColor strokeInnerInactive READ strokeInnerInactive WRITE setStrokeInnerInactive)
|
||||
public:
|
||||
MixerChannelView(QWidget* parent, MixerView* mixerView, int channelIndex);
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
void contextMenuEvent(QContextMenuEvent*) override;
|
||||
void mousePressEvent(QMouseEvent*) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent*) override;
|
||||
bool eventFilter(QObject* dist, QEvent* event) override;
|
||||
|
||||
constexpr int MIXER_CHANNEL_INNER_BORDER_SIZE = 3;
|
||||
constexpr int MIXER_CHANNEL_OUTER_BORDER_SIZE = 1;
|
||||
int channelIndex() const;
|
||||
void setChannelIndex(int index);
|
||||
|
||||
class MixerChannelView : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QBrush backgroundActive READ backgroundActive WRITE setBackgroundActive)
|
||||
Q_PROPERTY(QColor strokeOuterActive READ strokeOuterActive WRITE setStrokeOuterActive)
|
||||
Q_PROPERTY(QColor strokeOuterInactive READ strokeOuterInactive WRITE setStrokeOuterInactive)
|
||||
Q_PROPERTY(QColor strokeInnerActive READ strokeInnerActive WRITE setStrokeInnerActive)
|
||||
Q_PROPERTY(QColor strokeInnerInactive READ strokeInnerInactive WRITE setStrokeInnerInactive)
|
||||
public:
|
||||
MixerChannelView(QWidget* parent, MixerView* mixerView, int channelIndex);
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
void contextMenuEvent(QContextMenuEvent*) override;
|
||||
void mousePressEvent(QMouseEvent*) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent*) override;
|
||||
bool eventFilter(QObject* dist, QEvent* event) override;
|
||||
QBrush backgroundActive() const;
|
||||
void setBackgroundActive(const QBrush& c);
|
||||
|
||||
int channelIndex() const;
|
||||
void setChannelIndex(int index);
|
||||
QColor strokeOuterActive() const;
|
||||
void setStrokeOuterActive(const QColor& c);
|
||||
|
||||
QBrush backgroundActive() const;
|
||||
void setBackgroundActive(const QBrush& c);
|
||||
QColor strokeOuterInactive() const;
|
||||
void setStrokeOuterInactive(const QColor& c);
|
||||
|
||||
QColor strokeOuterActive() const;
|
||||
void setStrokeOuterActive(const QColor& c);
|
||||
QColor strokeInnerActive() const;
|
||||
void setStrokeInnerActive(const QColor& c);
|
||||
|
||||
QColor strokeOuterInactive() const;
|
||||
void setStrokeOuterInactive(const QColor& c);
|
||||
QColor strokeInnerInactive() const;
|
||||
void setStrokeInnerInactive(const QColor& c);
|
||||
|
||||
QColor strokeInnerActive() const;
|
||||
void setStrokeInnerActive(const QColor& c);
|
||||
void reset();
|
||||
|
||||
QColor strokeInnerInactive() const;
|
||||
void setStrokeInnerInactive(const QColor& c);
|
||||
public slots:
|
||||
void renameChannel();
|
||||
void resetColor();
|
||||
void selectColor();
|
||||
void randomizeColor();
|
||||
|
||||
void reset();
|
||||
private slots:
|
||||
void renameFinished();
|
||||
void removeChannel();
|
||||
void removeUnusedChannels();
|
||||
void moveChannelLeft();
|
||||
void moveChannelRight();
|
||||
|
||||
public slots:
|
||||
void renameChannel();
|
||||
void resetColor();
|
||||
void selectColor();
|
||||
void randomizeColor();
|
||||
private:
|
||||
bool confirmRemoval(int index);
|
||||
QString elideName(const QString& name);
|
||||
MixerChannel* mixerChannel() const;
|
||||
auto isMasterChannel() const -> bool { return m_channelIndex == 0; }
|
||||
|
||||
private slots:
|
||||
void renameFinished();
|
||||
void removeChannel();
|
||||
void removeUnusedChannels();
|
||||
void moveChannelLeft();
|
||||
void moveChannelRight();
|
||||
private:
|
||||
SendButtonIndicator* m_sendButton;
|
||||
QLabel* m_receiveArrow;
|
||||
QStackedWidget* m_receiveArrowOrSendButton;
|
||||
int m_receiveArrowStackedIndex = -1;
|
||||
int m_sendButtonStackedIndex = -1;
|
||||
|
||||
private:
|
||||
bool confirmRemoval(int index);
|
||||
QString elideName(const QString& name);
|
||||
MixerChannel* mixerChannel() const;
|
||||
auto isMasterChannel() const -> bool { return m_channelIndex == 0; }
|
||||
Knob* m_sendKnob;
|
||||
LcdWidget* m_channelNumberLcd;
|
||||
QLineEdit* m_renameLineEdit;
|
||||
QGraphicsView* m_renameLineEditView;
|
||||
QLabel* m_sendArrow;
|
||||
PixmapButton* m_muteButton;
|
||||
PixmapButton* m_soloButton;
|
||||
PeakIndicator* m_peakIndicator = nullptr;
|
||||
Fader* m_fader;
|
||||
EffectRackView* m_effectRackView;
|
||||
MixerView* m_mixerView;
|
||||
int m_channelIndex = 0;
|
||||
bool m_inRename = false;
|
||||
|
||||
private:
|
||||
SendButtonIndicator* m_sendButton;
|
||||
QLabel* m_receiveArrow;
|
||||
QStackedWidget* m_receiveArrowOrSendButton;
|
||||
int m_receiveArrowStackedIndex = -1;
|
||||
int m_sendButtonStackedIndex = -1;
|
||||
QBrush m_backgroundActive;
|
||||
QColor m_strokeOuterActive;
|
||||
QColor m_strokeOuterInactive;
|
||||
QColor m_strokeInnerActive;
|
||||
QColor m_strokeInnerInactive;
|
||||
|
||||
Knob* m_sendKnob;
|
||||
LcdWidget* m_channelNumberLcd;
|
||||
QLineEdit* m_renameLineEdit;
|
||||
QGraphicsView* m_renameLineEditView;
|
||||
QLabel* m_sendArrow;
|
||||
PixmapButton* m_muteButton;
|
||||
PixmapButton* m_soloButton;
|
||||
PeakIndicator* m_peakIndicator = nullptr;
|
||||
Fader* m_fader;
|
||||
EffectRackView* m_effectRackView;
|
||||
MixerView* m_mixerView;
|
||||
int m_channelIndex = 0;
|
||||
bool m_inRename = false;
|
||||
|
||||
QBrush m_backgroundActive;
|
||||
QColor m_strokeOuterActive;
|
||||
QColor m_strokeOuterInactive;
|
||||
QColor m_strokeInnerActive;
|
||||
QColor m_strokeInnerInactive;
|
||||
|
||||
friend class MixerView;
|
||||
};
|
||||
friend class MixerView;
|
||||
};
|
||||
} // namespace lmms::gui
|
||||
|
||||
#endif // MIXER_CHANNEL_VIEW_H
|
||||
|
||||
Reference in New Issue
Block a user