1 //=============================================================================
2 //  MuseScore
3 //  Linux Music Score Editor
4 //
5 //  Copyright (C) 2002-2009 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 __EDITDRUMSET_H__
21 #define __EDITDRUMSET_H__
22 
23 #include "ui_editdrumset.h"
24 #include "libmscore/drumset.h"
25 
26 namespace Ms {
27 
28 //---------------------------------------------------------
29 //   EditDrumset
30 //---------------------------------------------------------
31 
32 class EditDrumset : public QDialog, private Ui::EditDrumsetBase {
33       Q_OBJECT
34 
35       Drumset  nDrumset;
36 
37       void apply();
38       void updatePitchesList();
39       void refreshPitchesList();
40       void updateExample();
41 
42       virtual void hideEvent(QHideEvent*);
43 
44       void fillCustomNoteheadsDataFromComboboxes(int pitch);
45       void setCustomNoteheadsGUIEnabled(bool enabled);
46 
47       void setEnabledPitchControls(bool enable);
48       void fillNoteheadsComboboxes(bool customGroup, int pitch);
49 private slots:
50       void bboxClicked(QAbstractButton* button);
51       void itemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
52       void nameChanged(const QString&);
53       void shortcutChanged();
54       void valueChanged();
55       void load();
56       void save();
57       void customGboxToggled(bool);
58       void customQuarterChanged(int);
59 
60    public:
61       EditDrumset(const Drumset* ds, QWidget* parent = 0);
drumset()62       const Drumset* drumset() const { return &nDrumset; }
63       };
64 
65 
66 class EditDrumsetTreeWidgetItem : public QTreeWidgetItem {
67    public:
EditDrumsetTreeWidgetItem(QTreeWidget * parent)68       EditDrumsetTreeWidgetItem(QTreeWidget * parent)
69          : QTreeWidgetItem(parent)  {}
70       virtual bool operator<(const QTreeWidgetItem & other) const;
71 };
72 
73 
74 } // namespace Ms
75 #endif
76 
77