LMMS
Loading...
Searching...
No Matches
MixerView.h
Go to the documentation of this file.
1/*
2 * MixerView.h - effect-mixer-view for LMMS
3 *
4 * Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
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_VIEW_H
26#define LMMS_GUI_MIXER_VIEW_H
27
28#include <QWidget>
29
30#include "MixerChannelView.h"
31#include "ModelView.h"
32#include "SerializingObject.h"
33
34class QDomDocument; // IWYU pragma: keep
35class QDomElement; // IWYU pragma: keep
36class QHBoxLayout;
37class QStackedLayout;
38class QScrollArea;
39
40namespace lmms
41{
42 class Mixer;
43}
44
45namespace lmms::gui
46{
47
48class LMMS_EXPORT MixerView
49 : public QWidget
50 , public ModelView
52{
53 Q_OBJECT
54public:
55 MixerView(Mixer* mixer);
56 void keyPressEvent(QKeyEvent* e) override;
57
58 void saveSettings(QDomDocument& doc, QDomElement& domElement) override;
59 void loadSettings(const QDomElement& domElement) override;
60
65
66 inline MixerChannelView* channelView(int index)
67 {
68 return m_mixerChannelViews[index];
69 }
70
71
72 void setCurrentMixerChannel(MixerChannelView* channel);
73 void setCurrentMixerChannel(int channel);
74
75 void clear();
76
77
78 // display the send button and knob correctly
79 void updateMixerChannel(int index);
80
81 // notify the view that a mixer channel was deleted
82 void deleteChannel(int index);
83
84 // delete all unused channels
85 void deleteUnusedChannels();
86
87 // move the channel to the left or right
88 void moveChannelLeft(int index);
89 void moveChannelRight(int index);
90
91 void renameChannel(int index);
92
93 // make sure the display syncs up with the mixer.
94 // useful for loading projects
95 void refreshDisplay();
96
97public slots:
98 int addNewChannel();
99
100private slots:
101 void updateFaders();
102 // TODO This should be improved. Currently the solo and mute models are connected via
103 // the MixerChannelView's constructor with the MixerView. It would already be an improvement
104 // if the MixerView connected itself to each new MixerChannel that it creates/handles.
105 void toggledSolo();
106 void toggledMute();
107
108private:
109 Mixer* getMixer() const;
110 void updateAllMixerChannels();
111 void connectToSoloAndMute(int channelIndex);
112 void disconnectFromSoloAndMute(int channelIndex);
113
114private:
115 QVector<MixerChannelView*> m_mixerChannelViews;
116
118
119 QScrollArea* channelArea;
120 QHBoxLayout* chLayout;
122 QStackedLayout* m_racksLayout;
125
127
128 friend class MixerChannelView;
129} ;
130
131
132} // namespace lmms::gui
133
134#endif // LMMS_GUI_MIXER_VIEW_H
Definition Mixer.h:139
SerializingObjectHook()
Definition SerializingObject.h:79
Definition MixerChannelView.h:51
void keyPressEvent(QKeyEvent *e) override
Definition MixerView.cpp:469
QStackedLayout * m_racksLayout
Definition MixerView.h:122
void loadSettings(const QDomElement &domElement) override
Definition MixerView.cpp:274
void saveSettings(QDomDocument &doc, QDomElement &domElement) override
Definition MixerView.cpp:266
QVector< MixerChannelView * > m_mixerChannelViews
Definition MixerView.h:115
MixerView(Mixer *mixer)
Definition MixerView.cpp:58
Mixer * m_mixer
Definition MixerView.h:124
void updateMaxChannelSelector()
Definition MixerView.cpp:240
MixerChannelView * channelView(int index)
Definition MixerView.h:66
MixerChannelView * m_currentMixerChannel
Definition MixerView.h:117
QWidget * m_channelAreaWidget
Definition MixerView.h:121
QScrollArea * channelArea
Definition MixerView.h:119
QHBoxLayout * chLayout
Definition MixerView.h:120
QWidget * m_racksWidget
Definition MixerView.h:123
MixerChannelView * currentMixerChannel()
Definition MixerView.h:61
friend class MixerChannelView
Definition MixerView.h:128
ModelView(Model *model, QWidget *widget)
Definition ModelView.cpp:33
* e
Definition inflate.c:1404
Definition AudioPortAudio.cpp:223
Definition AudioAlsa.cpp:35