MuseScore  3.4
Music composition and notation
stafftextbase.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2002-2011 Werner Schweer
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 __STAFFTEXTBASE_H__
14 #define __STAFFTEXTBASE_H__
15 
16 #include "text.h"
17 #include "part.h"
18 #include "staff.h"
19 
20 namespace Ms {
21 
22 //---------------------------------------------------------
23 // ChannelActions
24 //---------------------------------------------------------
25 
27  int channel;
28  QStringList midiActionNames;
29  };
30 
31 //---------------------------------------------------------
32 // StaffTextBase
33 //---------------------------------------------------------
34 
35 class StaffTextBase : public TextBase {
36  QString _channelNames[4];
37  QList<ChannelActions> _channelActions;
39  bool _setAeolusStops { false };
40  int aeolusStops[4] { 0, 0, 0, 0 };
41  bool _swing { false };
42  int _capo { 0 };
43 
44  public:
46 
47  virtual void write(XmlWriter& xml) const override;
48  virtual void read(XmlReader&) override;
49  virtual bool readProperties(XmlReader&) override;
50 
51  Segment* segment() const;
52  QString channelName(int voice) const { return _channelNames[voice]; }
53  void setChannelName(int v, const QString& s) { _channelNames[v] = s; }
54  void setSwingParameters(int unit, int ratio) { _swingParameters.swingUnit = unit; _swingParameters.swingRatio = ratio; }
55  const QList<ChannelActions>* channelActions() const { return &_channelActions; }
56  QList<ChannelActions>* channelActions() { return &_channelActions; }
57  const SwingParameters* swingParameters() const { return &_swingParameters; }
58  void clearAeolusStops();
59  void setAeolusStop(int group, int idx, bool val);
60  bool getAeolusStop(int group, int idx) const;
61  void setSetAeolusStops(bool val) { _setAeolusStops = val; }
62  void setSwing(bool checked) { _swing = checked; }
63  void setCapo(int fretId) { _capo = fretId; }
64  bool setAeolusStops() const { return _setAeolusStops; }
65  bool swing() const { return _swing; }
66  int capo() const { return _capo; }
67  };
68 
69 } // namespace Ms
70 #endif
int swingUnit
Definition: staff.h:53
int swingRatio
Definition: staff.h:54
QList< ChannelActions > _channelActions
Definition: stafftextbase.h:37
Definition: staff.h:52
Definition: xml.h:67
QFlags< ElementFlag > ElementFlags
Definition: element.h:101
bool swing() const
Definition: stafftextbase.h:65
bool setAeolusStops() const
Definition: stafftextbase.h:64
void setChannelName(int v, const QString &s)
Definition: stafftextbase.h:53
const QList< ChannelActions > * channelActions() const
Definition: stafftextbase.h:55
int channel
Definition: stafftextbase.h:27
Definition: stafftextbase.h:35
Definition: score.h:391
SwingParameters _swingParameters
Definition: stafftextbase.h:38
Tid
Enumerates the list of built-in text substyles.
Definition: types.h:371
QList< ChannelActions > * channelActions()
Definition: stafftextbase.h:56
Definition: stafftextbase.h:26
Definition: textbase.h:217
Definition: segment.h:50
const SwingParameters * swingParameters() const
Definition: stafftextbase.h:57
Definition: aeolus.cpp:26
Definition: xml.h:218
int capo() const
Definition: stafftextbase.h:66
void setCapo(int fretId)
Definition: stafftextbase.h:63
void setSwingParameters(int unit, int ratio)
Definition: stafftextbase.h:54
void setSetAeolusStops(bool val)
Definition: stafftextbase.h:61
QStringList midiActionNames
Definition: stafftextbase.h:28
void setSwing(bool checked)
Definition: stafftextbase.h:62
QString channelName(int voice) const
Definition: stafftextbase.h:52
Definition of class Staff.