~ubuntu-branches/ubuntu/utopic/musescore/utopic

« back to all changes in this revision

Viewing changes to mscore/bww2mxml/writer.h

  • Committer: Bazaar Package Importer
  • Author(s): Toby Smithe, Matthias Klose
  • Date: 2011-02-16 20:04:20 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110216200420-rlu5xdmcop6skghj
Tags: 1.0+dfsg-2
* Re-include Matthias Klose's armel qreal fixes (Closes: #597802)
  (I missed 0.9.6.3+dfsg-0ubuntu2...
   Apologies to Matthias and my sponsor, Tobias Quathamer!)

* debian/patches/12-debianise-about-box.dpatch:
  + Update "About" dialogue box to give copyright to 2011.

[ Matthias Klose ]
* More armel qreal fixes. LP: #642117.

Show diffs side-by-side

added added

removed removed

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