MuseScore  3.4
Music composition and notation
transposedialog.h
Go to the documentation of this file.
1 //=============================================================================
2 // MusE Score
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2008-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 __TRANSPOSEDIALOG_H__
21 #define __TRANSPOSEDIALOG_H__
22 
23 #include "ui_transposedialog.h"
24 #include "libmscore/mscore.h"
25 
26 namespace Ms {
27 
28 enum class Key;
29 
30 //---------------------------------------------------------
31 // TransposeDialog
32 //---------------------------------------------------------
33 
34 class TransposeDialog : public QDialog, Ui::TransposeDialogBase {
35  Q_OBJECT
36 
37  virtual void hideEvent(QHideEvent*);
38  private slots:
39  void transposeByKeyToggled(bool);
40  void transposeByIntervalToggled(bool);
41  void on_chromaticBox_toggled(bool val);
42  void on_diatonicBox_toggled(bool val);
43 
44  public:
45  TransposeDialog(QWidget* parent = 0);
46  void enableTransposeKeys(bool val) { transposeKeys->setEnabled(val); }
47  void enableTransposeByKey(bool val);
48  void enableTransposeChordNames(bool val);
49  bool getTransposeKeys() const { return chromaticBox->isChecked()
50  ? transposeKeys->isChecked()
51  : keepDegreeAlterations->isChecked();}
52  bool getTransposeChordNames() const { return transposeChordNames->isChecked(); }
53  Key transposeKey() const { return Key(keyList->currentIndex() - 7); }
54  int transposeInterval() const { return chromaticBox->isChecked()
55  ? intervalList->currentIndex()
56  : degreeList->currentIndex() + 1; }
58  TransposeMode mode() const;
59  void setKey(Key k) { keyList->setCurrentIndex(int(k) + 7); }
60  bool useDoubleSharpsFlats() const { return accidentalOptions->currentIndex() == 1; }
61  };
62 }
63 
64 #endif
65 
void transposeByKeyToggled(bool)
Definition: transposedialog.cpp:61
Key
Definition: key.h:28
virtual void hideEvent(QHideEvent *)
Definition: transposedialog.cpp:143
bool getTransposeKeys() const
Definition: transposedialog.h:49
int transposeInterval() const
Definition: transposedialog.h:54
Key transposeKey() const
Definition: transposedialog.h:53
bool getTransposeChordNames() const
Definition: transposedialog.h:52
TransposeDirection direction() const
Definition: transposedialog.cpp:112
void enableTransposeByKey(bool val)
Definition: transposedialog.cpp:90
void on_chromaticBox_toggled(bool val)
Definition: transposedialog.cpp:129
TransposeMode mode() const
Definition: transposedialog.cpp:79
void on_diatonicBox_toggled(bool val)
Definition: transposedialog.cpp:134
void enableTransposeKeys(bool val)
Definition: transposedialog.h:46
Definition: aeolus.cpp:26
TransposeDialog(QWidget *parent=0)
Definition: transposedialog.cpp:44
void setKey(Key k)
Definition: transposedialog.h:59
void enableTransposeChordNames(bool val)
Definition: transposedialog.cpp:101
void transposeByIntervalToggled(bool)
Definition: transposedialog.cpp:70
bool useDoubleSharpsFlats() const
Definition: transposedialog.h:60
Definition: transposedialog.h:34
TransposeDirection
Definition: mscore.h:123
Interval intervalList[intervalListSize]
Definition: utils.cpp:505
TransposeMode
Definition: mscore.h:131