1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2011 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 // as published by the Free Software Foundation and appearing in
10 // the file LICENSE.GPL
11 //=============================================================================
12
13 #include "inspectorHarmony.h"
14 #include "libmscore/harmony.h"
15
16 namespace Ms {
17
18 //---------------------------------------------------------
19 // InspectorHarmony
20 //---------------------------------------------------------
21
InspectorHarmony(QWidget * parent)22 InspectorHarmony::InspectorHarmony(QWidget* parent)
23 : InspectorTextBase(parent)
24 {
25 h.setupUi(addWidget());
26
27 const std::vector<InspectorItem> iiList = {
28 { Pid::SUB_STYLE, 0, h.style, h.resetStyle },
29 { Pid::PLACEMENT, 0, h.placement, h.resetPlacement },
30 { Pid::PLAY, 0, h.play, h.resetPlay },
31 { Pid::HARMONY_VOICE_LITERAL, 0, h.voicingSelect->interpretBox, h.resetVoicing },
32 { Pid::HARMONY_VOICING, 0, h.voicingSelect->voicingBox, h.resetVoicing},
33 { Pid::HARMONY_DURATION, 0, h.voicingSelect->durationBox, h.resetVoicing}
34 };
35
36 const std::vector<InspectorPanel> ppList = {
37 { h.title, h.panel }
38 };
39
40 populateStyle(h.style);
41 t.resetToStyle->setVisible(false);
42 mapSignals(iiList, ppList);
43 }
44
45 //---------------------------------------------------------
46 // valueChanged
47 //---------------------------------------------------------
48
valueChanged(int idx,bool b)49 void InspectorHarmony::valueChanged(int idx, bool b)
50 {
51 InspectorTextBase::valueChanged(idx, b);
52 if (iList[idx].t == Pid::PLAY) {
53 bool playChecked = h.play->isChecked();
54 h.voicingSelect->setVisible(playChecked);
55 h.resetVoicing->setVisible(playChecked);
56 }
57 }
58 }
59
60