1 //=============================================================================
2 //  MuseScore
3 //  Linux Music Score Editor
4 //
5 //  Copyright (C) 2002-2010 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 __EDITSTAFF_H__
21 #define __EDITSTAFF_H__
22 
23 #include "ui_editstaff.h"
24 #include "ui_selectinstr.h"
25 #include "libmscore/instrument.h"
26 #include "libmscore/stafftype.h"
27 
28 namespace Ms {
29 
30 class Staff;
31 class InstrumentTemplate;
32 
33 //---------------------------------------------------------
34 //   EditStaff
35 //    edit staff and part properties
36 //---------------------------------------------------------
37 
38 class EditStaff : public QDialog, private Ui::EditStaffBase {
39       Q_OBJECT
40 
41       Staff*      staff;
42       Staff*      orgStaff;
43       Instrument  instrument;
44       int         _minPitchA, _maxPitchA, _minPitchP, _maxPitchP;
45       Fraction    _tickStart, _tickEnd;
46 
47       virtual void hideEvent(QHideEvent*);
48       void apply();
49       void setStaff(Staff*, const Fraction& tick);
50       void updateInterval(const Interval&);
51       void updateStaffType();
52       void updateInstrument();
53       void updateNextPreviousButtons();
54 
55    protected:
56       QString midiCodeToStr(int midiCode);
57 
58    private slots:
59       void bboxClicked(QAbstractButton* button);
60       void editStringDataClicked();
61       void showInstrumentDialog();
62       void showStaffTypeDialog();
63       void minPitchAClicked();
64       void maxPitchAClicked();
65       void minPitchPClicked();
66       void maxPitchPClicked();
67       void lineDistanceChanged();
68       void numOfLinesChanged();
69       void showClefChanged();
70       void showTimeSigChanged();
71       void showBarlinesChanged();
72       void invisibleChanged();
73       void gotoNextStaff();
74       void gotoPreviousStaff();
75       void transpositionChanged();
76 
77    signals:
78       void instrumentChanged();
79 
80    public:
81       EditStaff(Staff*, const Fraction& tick, QWidget* parent = 0);
82       };
83 
84 
85 } // namespace Ms
86 #endif
87 
88