MuseScore  3.4
Music composition and notation
mixerdetails.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2002-2016 Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __MIXERDETAILS_H__
21 #define __MIXERDETAILS_H__
22 
23 #include "ui_mixerdetails.h"
24 #include "libmscore/instrument.h"
25 #include "mixertrackitem.h"
26 
27 #include <functional>
28 #include <QPushButton>
29 
30 namespace Ms {
31 
32 
33 class MixerTrackItem;
34 
35 
36 //---------------------------------------------------------
37 // MixerDetails
38 //---------------------------------------------------------
39 
40 class MixerDetails : public QWidget, public Ui::MixerDetails, public ChannelListener
41  {
42  Q_OBJECT
43 
46  QGridLayout* mutePerVoiceGrid;
47  QList<QPushButton*> voiceButtons;
48 
49  void updateFromTrack();
50 
51 public slots:
52  void partNameChanged();
53  void trackColorChanged(QColor);
54  void patchChanged(int);
55  void volumeChanged(double);
56  void panChanged(double);
57  void chorusChanged(double);
58  void reverbChanged(double);
59  void drumkitToggled(bool);
60  void midiChannelChanged(int);
61 
62 public:
63  explicit MixerDetails(QWidget *parent);
64 
67  void setVoiceMute(int staffIdx, int voice, bool shouldMute);
68  void propertyChanged(Channel::Prop property) override;
69  };
70 
71 //---------------------------------------------------------
72 // MixerDetailsVoiceButtonHandler
73 //---------------------------------------------------------
74 
75 class MixerDetailsVoiceButtonHandler : public QObject
76  {
77  Q_OBJECT
78 
80  int _staff;
81  int _voice;
82 public:
83  MixerDetailsVoiceButtonHandler(MixerDetails* mixerDetails, int staff, int voice, QObject* parent = nullptr)
84  : QObject(parent),
85  _mixerDetails(mixerDetails),
86  _staff(staff),
87  _voice(voice)
88  {}
89 
90 public slots:
91  void setVoiceMute(bool checked)
92  {
93  _mixerDetails->setVoiceMute(_staff, _voice, checked);
94  }
95  };
96 }
97 #endif // __MIXERDETAILS_H__
QWidget * mutePerVoiceHolder
Definition: mixerdetails.h:45
QGridLayout * mutePerVoiceGrid
Definition: mixerdetails.h:46
Definition: mixerdetails.h:75
MixerDetails * _mixerDetails
Definition: mixerdetails.h:79
void setVoiceMute(int staffIdx, int voice, bool shouldMute)
Definition: mixerdetails.cpp:291
MixerTrackItemPtr track()
Definition: mixerdetails.h:65
Prop
Definition: instrument.h:141
void partNameChanged()
Definition: mixerdetails.cpp:316
Definition: mixerdetails.h:40
QList< QPushButton * > voiceButtons
Definition: mixerdetails.h:47
std::shared_ptr< MixerTrackItem > MixerTrackItemPtr
Definition: mixertrackitem.h:32
void chorusChanged(double)
Definition: mixerdetails.cpp:466
MixerTrackItemPtr _mti
Definition: mixerdetails.h:44
void reverbChanged(double)
Definition: mixerdetails.cpp:454
MixerDetails(QWidget *parent)
Definition: mixerdetails.cpp:41
void setVoiceMute(bool checked)
Definition: mixerdetails.h:91
Definition: aeolus.cpp:26
void drumkitToggled(bool)
Definition: mixerdetails.cpp:505
MixerDetailsVoiceButtonHandler(MixerDetails *mixerDetails, int staff, int voice, QObject *parent=nullptr)
Definition: mixerdetails.h:83
int _staff
Definition: mixerdetails.h:80
void panChanged(double)
Definition: mixerdetails.cpp:441
void midiChannelChanged(int)
Definition: mixerdetails.cpp:547
void trackColorChanged(QColor)
Definition: mixerdetails.cpp:339
void patchChanged(int)
Definition: mixerdetails.cpp:478
void volumeChanged(double)
Definition: mixerdetails.cpp:428
void setTrack(MixerTrackItemPtr track)
Definition: mixerdetails.cpp:70
Definition: instrument.h:208
void propertyChanged(Channel::Prop property) override
Definition: mixerdetails.cpp:354
int _voice
Definition: mixerdetails.h:81
void updateFromTrack()
Definition: mixerdetails.cpp:82