MuseScore  3.4
Music composition and notation
writer.h
Go to the documentation of this file.
1 //=============================================================================
2 // BWW to MusicXML converter
3 // Part of MusE Score
4 // Linux Music Score Editor
5 //
6 // Copyright (C) 2010 Werner Schweer and others
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License version 2.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 //=============================================================================
20 
21 #ifndef WRITER_H
22 #define WRITER_H
23 
29 #include <QtCore/QString>
30 
31 #include "symbols.h"
32 
33 class QIODevice;
34 
35 namespace Bww {
36 
37  static const int maxBeamLevel = 3;
38 
39  enum BeamType
40  {
47  };
48 
58  bool irregular;
60  repeatBegin(false),
61  endingFirst(false),
62  endingSecond(false),
63  firstOfSystem(false),
64  irregular(false)
65  {}
66  };
67 
72  struct MeasureEndFlags {
73  bool repeatEnd;
74  bool endingEnd;
76  bool lastOfPart;
79  repeatEnd(false),
80  endingEnd(false),
81  lastOfSystem(false),
82  lastOfPart(false),
83  doubleBarLine(false)
84  {}
85  };
86 
91  class Writer
92  {
93  public:
94  virtual void header(const QString title, const QString type,
95  const QString composer, const QString footer,
96  const unsigned int temp) = 0;
97  virtual void tsig(const int beats, const int beat) = 0;
98  virtual void trailer() = 0;
99  virtual void beginMeasure(const Bww::MeasureBeginFlags mbf) = 0;
100  virtual void endMeasure(const Bww::MeasureEndFlags mef) = 0;
101  virtual void note(const QString pitch, const QVector<BeamType> beamList,
102  const QString type, const int dots,
103  bool tieStart = false, bool tieStop = false,
104  StartStop triplet = ST_NONE,
105  bool grace = false) = 0;
106  QString instrumentName() const { return "Bagpipe"; }
107  int midiProgram() const { return 110; }
108  };
109 
110 } // namespace Bww
111 
112 #endif // WRITER_H
bool doubleBarLine
Definition: writer.h:77
Definition: writer.h:46
bool endingEnd
Definition: writer.h:74
int midiProgram() const
Definition: writer.h:107
bool repeatEnd
Definition: writer.h:73
bool repeatBegin
Definition: writer.h:54
Definition: writer.h:43
bool irregular
Definition: writer.h:58
Definition: writer.h:42
The flags that need to be handled at the beginning of a measure.
Definition: writer.h:53
Symbol type to text translation.
Definition: lexer.cpp:34
Definition: writer.h:44
The flags that need to be handled at the end of a measure.
Definition: writer.h:72
bool endingFirst
Definition: writer.h:55
Definition: symbols.h:53
Definition of tokens types for bww lexer and parser.
bool lastOfPart
Definition: writer.h:76
Definition: writer.h:45
bool lastOfSystem
Definition: writer.h:75
StartStop
Definition: symbols.h:51
bool endingSecond
Definition: writer.h:56
MeasureBeginFlags()
Definition: writer.h:59
BeamType
Definition: writer.h:39
Definition: writer.h:41
MeasureEndFlags()
Definition: writer.h:78
The writer that generates the output.
Definition: writer.h:91
bool firstOfSystem
Definition: writer.h:57
QString instrumentName() const
Definition: writer.h:106