MuseScore  3.4
Music composition and notation
importmxmlnoteduration.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 __IMPORTMXMLNOTEDURATION_H__
14 #define __IMPORTMXMLNOTEDURATION_H__
15 
16 #include "libmscore/durationtype.h"
17 #include "libmscore/fraction.h"
18 
19 namespace Ms {
20 
21 class MxmlLogger;
22 
23 //---------------------------------------------------------
24 // mxmlNoteDuration
25 //---------------------------------------------------------
26 
32  {
33 public:
34  mxmlNoteDuration(int divs, MxmlLogger* logger) : _divs(divs), _logger(logger) { /* nothing so far */ }
35  QString checkTiming(const QString& type, const bool rest, const bool grace);
36  Fraction dura() const { return _dura; }
37  int dots() const { return _dots; }
38  TDuration normalType() const { return _normalType; }
39  bool readProperties(QXmlStreamReader& e);
40  Fraction timeMod() const { return _timeMod; }
41 
42 private:
43  void duration(QXmlStreamReader& e);
44  void timeModification(QXmlStreamReader& e);
45  const int _divs; // the current divisions value
46  int _dots = 0;
49  Fraction _timeMod { 1, 1 }; // default to no time modification
51  };
52 
53 } // namespace Ms
54 
55 #endif
Definition: durationtype.h:28
TDuration _normalType
Definition: importmxmlnoteduration.h:48
Fraction _dura
Definition: importmxmlnoteduration.h:47
Definition: importmxmllogger.h:20
int _dots
Definition: importmxmlnoteduration.h:46
Fraction timeMod() const
Definition: importmxmlnoteduration.h:40
Definition: aeolus.cpp:26
bool readProperties(QXmlStreamReader &e)
Handle selected child elements of the /score-partwise/part/measure/note/duration node.
Definition: importmxmlnoteduration.cpp:200
mxmlNoteDuration(int divs, MxmlLogger *logger)
Definition: importmxmlnoteduration.h:34
void timeModification(QXmlStreamReader &e)
Parse the /score-partwise/part/measure/note/time-modification node.
Definition: importmxmlnoteduration.cpp:228
int dots() const
Definition: importmxmlnoteduration.h:37
void duration(QXmlStreamReader &e)
Parse the /score-partwise/part/measure/note/duration node.
Definition: importmxmlnoteduration.cpp:171
MxmlLogger * _logger
Error logger.
Definition: importmxmlnoteduration.h:50
Definition: fraction.h:46
QString checkTiming(const QString &type, const bool rest, const bool grace)
Do timing error checks.
Definition: importmxmlnoteduration.cpp:99
const int _divs
Definition: importmxmlnoteduration.h:45
Fraction _timeMod
Definition: importmxmlnoteduration.h:49
TDuration normalType() const
Definition: importmxmlnoteduration.h:38
Fraction dura() const
Definition: importmxmlnoteduration.h:36
Parse the note time related part of the /score-partwise/part/measure/note node.
Definition: importmxmlnoteduration.h:31