1 //=============================================================================
2 //  MuseScore
3 //  Linux Music Score Editor
4 //
5 //  Copyright (C) 2002-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 __MUSEDATA_H__
21 #define __MUSEDATA_H__
22 
23 #include "libmscore/fraction.h"
24 
25 namespace Ms {
26 
27 class Staff;
28 class Part;
29 class Score;
30 class ChordRest;
31 class Measure;
32 class Slur;
33 
34 //---------------------------------------------------------
35 //   MuseData
36 //    used importing Musedata files
37 //---------------------------------------------------------
38 
39 class MuseData {
40       int _division;
41       Fraction curTick;
42       QList<QStringList> parts;
43       Score* score;
44       ChordRest* chordRest;
45       int ntuplet;
46       Measure* measure;
47       int voice;
48       Slur* slur[4];
49 
50       void musicalAttribute(QString s, Part*);
51       void readPart(QStringList sl, Part*);
52       void readNote(Part*, const QString& s);
53       void readChord(Part*, const QString& s);
54       void readRest(Part*, const QString& s);
55       void readBackup(const QString& s);
56       Measure* createMeasure();
57       int countStaves(const QStringList& sl);
58       void openSlur(int idx, const Fraction& tick, Staff* staff, int voice);
59       void closeSlur(int idx, const Fraction& tick, Staff* staff, int voice);
60       QString diacritical(QString);
61 
62    public:
MuseData(Score * s)63       MuseData(Score* s) { score = s; }
64       bool read(const QString&);
65       void convert();
66       };
67 
68 
69 } // namespace Ms
70 #endif
71 
72