MuseScore  3.4
Music composition and notation
importmxmlnotepitch.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2018 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 LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __IMPORTMXMLNOTEPITCH_H__
14 #define __IMPORTMXMLNOTEPITCH_H__
15 
16 #include "libmscore/accidental.h"
17 
18 namespace Ms {
19 
20 class MxmlLogger;
21 class Score;
22 
23 //---------------------------------------------------------
24 // mxmlNotePitch
25 //---------------------------------------------------------
26 
32  {
33 public:
34  mxmlNotePitch(MxmlLogger* logger) : _logger(logger) { /* nothing so far */ }
35  void pitch(QXmlStreamReader& e);
36  bool readProperties(QXmlStreamReader& e, Score* score);
37  Accidental* acc() const { return _acc; }
38  AccidentalType accType() const { return _accType; }
39  int alter() const { return _alter; }
40  int displayOctave() const { return _displayOctave; }
41  int displayStep() const { return _displayStep; }
42  void displayStepOctave(QXmlStreamReader& e);
43  int octave() const { return _octave; }
44  int step() const { return _step; }
45  bool unpitched() const { return _unpitched; }
46 
47 private:
48  Accidental* _acc = 0; // created based on accidental element
49  AccidentalType _accType = AccidentalType::NONE; // set by pitch() based on alter value (can be microtonal)
50  int _alter = 0;
51  int _displayStep = -1; // invalid
52  int _displayOctave = -1; // invalid
53  int _octave = -1;
54  int _step = 0;
55  bool _unpitched = false;
57  };
58 
59 
60 } // namespace Ms
61 
62 #endif
int _displayStep
Definition: importmxmlnotepitch.h:51
Definition of class Accidental.
int _octave
Definition: importmxmlnotepitch.h:53
Accidental * acc() const
Definition: importmxmlnotepitch.h:37
MxmlLogger * _logger
Error logger.
Definition: importmxmlnotepitch.h:56
void pitch(QXmlStreamReader &e)
Parse the /score-partwise/part/measure/note/pitch node.
Definition: importmxmlnotepitch.cpp:100
AccidentalType
Definition: types.h:152
bool readProperties(QXmlStreamReader &e, Score *score)
Handle selected child elements of the /score-partwise/part/measure/note node.
Definition: importmxmlnotepitch.cpp:158
Definition: importmxmllogger.h:20
mxmlNotePitch(MxmlLogger *logger)
Definition: importmxmlnotepitch.h:34
int _displayOctave
Definition: importmxmlnotepitch.h:52
Definition: accidental.h:65
Definition: score.h:391
bool unpitched() const
Definition: importmxmlnotepitch.h:45
int step() const
Definition: importmxmlnotepitch.h:44
bool _unpitched
Definition: importmxmlnotepitch.h:55
AccidentalType _accType
Definition: importmxmlnotepitch.h:49
int octave() const
Definition: importmxmlnotepitch.h:43
AccidentalType accType() const
Definition: importmxmlnotepitch.h:38
void displayStepOctave(QXmlStreamReader &e)
Handle <display-step> and <display-octave> for <rest> and <unpitched>
Definition: importmxmlnotepitch.cpp:62
Definition: aeolus.cpp:26
int alter() const
Definition: importmxmlnotepitch.h:39
int displayStep() const
Definition: importmxmlnotepitch.h:41
int _alter
Definition: importmxmlnotepitch.h:50
int displayOctave() const
Definition: importmxmlnotepitch.h:40
int _step
Definition: importmxmlnotepitch.h:54
Accidental * _acc
Definition: importmxmlnotepitch.h:48
Parse the note pitch related part of the /score-partwise/part/measure/note node.
Definition: importmxmlnotepitch.h:31