LMMS
Loading...
Searching...
No Matches
MixerChannelView.h
Go to the documentation of this file.
1/*
2 * MixerChannelView.h
3 *
4 * Copyright (c) 2024 saker
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_GUI_MIXER_CHANNEL_VIEW_H
26#define LMMS_GUI_MIXER_CHANNEL_VIEW_H
27
28#include <QWidget>
29
30class QGraphicsView;
31class QLabel;
32class QLineEdit;
33class QStackedWidget;
34
35namespace lmms {
36class MixerChannel;
37}
38
39namespace lmms::gui {
41class EffectRackView;
42class Fader;
43class Knob;
44class LcdWidget;
45class MixerView;
46class PeakIndicator;
48
49
50class MixerChannelView : public QWidget
51{
52 Q_OBJECT
58public:
59 MixerChannelView(QWidget* parent, MixerView* mixerView, int channelIndex);
60 void paintEvent(QPaintEvent* event) override;
61 void contextMenuEvent(QContextMenuEvent*) override;
62 void mousePressEvent(QMouseEvent*) override;
63 void mouseDoubleClickEvent(QMouseEvent*) override;
64 void keyPressEvent(QKeyEvent* ke) override;
65
66 void reset();
67
68 int channelIndex() const { return m_channelIndex; }
69 void setChannelIndex(int index);
70
71 QBrush backgroundActive() const { return m_backgroundActive; }
72 void setBackgroundActive(const QBrush& c) { m_backgroundActive = c; }
73
74 QColor strokeOuterActive() const { return m_strokeOuterActive; }
75 void setStrokeOuterActive(const QColor& c) { m_strokeOuterActive = c; }
76
77 QColor strokeOuterInactive() const { return m_strokeOuterInactive; }
79
80 QColor strokeInnerActive() const { return m_strokeInnerActive; }
81 void setStrokeInnerActive(const QColor& c) { m_strokeInnerActive = c; }
82
83 QColor strokeInnerInactive() const { return m_strokeInnerInactive; }
85
86 Fader* fader() const { return m_fader; }
87
88public slots:
89 void renameChannel();
90 void resetColor();
91 void selectColor();
92 void randomizeColor();
93
94private slots:
95 void renameFinished();
96 void removeChannel();
98 void moveChannelLeft();
99 void moveChannelRight();
100
101private:
102 bool confirmRemoval(int index);
103 QString elideName(const QString& name);
104 MixerChannel* mixerChannel() const;
105 auto isMasterChannel() const -> bool { return m_channelIndex == 0; }
106
107private:
113
117 QGraphicsView* m_renameLineEditView;
118 QLabel* m_sendArrow;
126 bool m_inRename = false;
127
133
134 friend class MixerView;
135};
136} // namespace lmms::gui
137
138#endif // LMMS_GUI_MIXER_CHANNEL_VIEW_H
#define READ(addr)
Definition Ay_Cpu.cpp:92
#define WRITE(addr, data)
Definition Ay_Cpu.cpp:93
#define override
Definition DistrhoDefines.h:73
Definition Mixer.h:46
Definition AutomatableButton.h:39
Definition EffectRackView.h:44
Definition Fader.h:67
Definition Knob.h:47
Definition LcdWidget.h:37
void setStrokeInnerInactive(const QColor &c)
Definition MixerChannelView.h:84
void mouseDoubleClickEvent(QMouseEvent *) override
Definition MixerChannelView.cpp:230
QBrush m_backgroundActive
Definition MixerChannelView.h:128
void keyPressEvent(QKeyEvent *ke) override
Definition MixerChannelView.cpp:235
QBrush backgroundActive() const
Definition MixerChannelView.h:71
void removeUnusedChannels()
Definition MixerChannelView.cpp:373
QString elideName(const QString &name)
Definition MixerChannelView.cpp:391
void randomizeColor()
Definition MixerChannelView.cpp:317
QColor strokeOuterActive() const
Definition MixerChannelView.h:74
EffectRackView * m_effectRackView
Definition MixerChannelView.h:123
Knob * m_sendKnob
Definition MixerChannelView.h:114
void reset()
Definition MixerChannelView.cpp:404
QColor strokeOuterInactive() const
Definition MixerChannelView.h:77
QColor m_strokeInnerActive
Definition MixerChannelView.h:131
void paintEvent(QPaintEvent *event) override
Definition MixerChannelView.cpp:199
void contextMenuEvent(QContextMenuEvent *) override
Definition MixerChannelView.cpp:164
Fader * m_fader
Definition MixerChannelView.h:122
MixerChannelView(QWidget *parent, MixerView *mixerView, int channelIndex)
Definition MixerChannelView.cpp:57
void moveChannelLeft()
Definition MixerChannelView.cpp:379
QColor m_strokeOuterActive
Definition MixerChannelView.h:129
QLineEdit * m_renameLineEdit
Definition MixerChannelView.h:116
void setStrokeOuterInactive(const QColor &c)
Definition MixerChannelView.h:78
int m_sendButtonStackedIndex
Definition MixerChannelView.h:112
QStackedWidget * m_receiveArrowOrSendButton
Definition MixerChannelView.h:110
QColor m_strokeOuterInactive
Definition MixerChannelView.h:130
void resetColor()
Definition MixerChannelView.cpp:294
QGraphicsView * m_renameLineEditView
Definition MixerChannelView.h:117
friend class MixerView
Definition MixerChannelView.h:134
Fader * fader() const
Definition MixerChannelView.h:86
void setBackgroundActive(const QBrush &c)
Definition MixerChannelView.h:72
MixerChannel * mixerChannel() const
Definition MixerChannelView.cpp:399
void selectColor()
Definition MixerChannelView.cpp:301
QColor strokeInnerActive() const
Definition MixerChannelView.h:80
LcdWidget * m_channelNumberLcd
Definition MixerChannelView.h:115
void setStrokeInnerActive(const QColor &c)
Definition MixerChannelView.h:81
int channelIndex() const
Definition MixerChannelView.h:68
QLabel * m_receiveArrow
Definition MixerChannelView.h:109
QColor strokeInnerInactive
Definition MixerChannelView.h:57
QColor strokeOuterInactive
Definition MixerChannelView.h:55
void removeChannel()
Definition MixerChannelView.cpp:366
void renameFinished()
Definition MixerChannelView.cpp:271
QLabel * m_sendArrow
Definition MixerChannelView.h:118
SendButtonIndicator * m_sendButton
Definition MixerChannelView.h:108
QColor strokeInnerActive
Definition MixerChannelView.h:56
MixerView * m_mixerView
Definition MixerChannelView.h:124
QColor strokeOuterActive
Definition MixerChannelView.h:54
void setStrokeOuterActive(const QColor &c)
Definition MixerChannelView.h:75
PeakIndicator * m_peakIndicator
Definition MixerChannelView.h:121
bool confirmRemoval(int index)
Definition MixerChannelView.cpp:325
void moveChannelRight()
Definition MixerChannelView.cpp:385
void mousePressEvent(QMouseEvent *) override
Definition MixerChannelView.cpp:225
AutomatableButton * m_muteButton
Definition MixerChannelView.h:119
auto isMasterChannel() const -> bool
Definition MixerChannelView.h:105
int m_channelIndex
Definition MixerChannelView.h:125
void renameChannel()
Definition MixerChannelView.cpp:256
void setChannelIndex(int index)
Definition MixerChannelView.cpp:250
int m_receiveArrowStackedIndex
Definition MixerChannelView.h:111
QBrush backgroundActive
Definition MixerChannelView.h:53
QColor m_strokeInnerInactive
Definition MixerChannelView.h:132
bool m_inRename
Definition MixerChannelView.h:126
AutomatableButton * m_soloButton
Definition MixerChannelView.h:120
QColor strokeInnerInactive() const
Definition MixerChannelView.h:83
Definition MixerView.h:52
Definition PeakIndicator.h:38
Definition SendButtonIndicator.h:44
static const char * name
Definition pugl.h:1582
static uintptr_t parent
Definition pugl.h:1644
Definition AudioPortAudio.cpp:223
Definition AudioAlsa.cpp:35
return c
Definition crypt.c:175
#define const
Definition zconf.h:137