73class EXP guidoelement :
public smartable {
77 long add (Sguidoelement& elt);
78 long add (Sguidoparam& param);
79 long add (Sguidoparam param);
80 virtual void print (std::ostream& os)
const;
83 void setName (std::string name) { fName = name; }
84 std::string getName ()
const {
return fName; }
85 std::string getStart ()
const {
return fStartList; }
86 std::string getEnd ()
const {
return fEndList; }
87 std::string getSep ()
const {
return fSep; }
88 void setEnd (std::string end) { fEndList=end; }
89 std::vector<Sguidoelement>& elements() {
return fElements; }
90 const std::vector<Sguidoelement>& elements()
const {
return fElements; }
91 const std::vector<Sguidoparam>& parameters()
const {
return fParams; }
93 bool empty ()
const {
return fElements.empty(); }
94 virtual bool isSeq ()
const {
return false; }
95 virtual bool isChord ()
const {
return false; }
96 virtual bool isTag ()
const {
return false; }
97 virtual bool isNote ()
const {
return false; }
98 virtual bool isRangeTag()
const {
99 return fName.find(
"End") != std::string::npos || fName.find(
"Begin") != std::string::npos;
101 virtual bool isBeginTag()
const {
102 return fName.find(
"Begin") != std::string::npos;
104 virtual bool isEndTag()
const {
105 return fName.find(
"End") != std::string::npos;
108 int countNotes ()
const;
111 const bool getNext(Sguidoelement &i, Sguidoelement &next_e)
const {
112 std::vector<Sguidoelement>::const_iterator e = find(
fElements.begin(),
fElements.end(), i);
114 auto next = std::next(e);
123 const bool getPrev(Sguidoelement &i, Sguidoelement &next_e)
const {
124 std::vector<Sguidoelement>::const_reverse_iterator e = find(fElements.rbegin(), fElements.rend(), i);
125 if (e != fElements.rend()) {
126 auto next = std::next(e);
127 if (next != fElements.rend()) {
137 guidoelement(std::string name, std::string sep=
" ");
138 virtual ~guidoelement();
140 void printparams (std::ostream& os)
const;
164class EXP guidonoteduration {
166 guidonoteduration(
long num,
long denom,
long dots=0)
167 { set (num, denom, dots); }
168 virtual ~guidonoteduration() {}
170 void set (
long num,
long denom,
long dots=0)
171 { fNum=num; fDenom=denom; fDots=dots; }
172 guidonoteduration& operator= (
const guidonoteduration& dur)
173 { fNum=dur.fNum; fDenom=dur.fDenom; fDots=dur.fDots;
return *
this; }
174 bool operator!= (
const guidonoteduration& dur)
const
175 {
return (fNum!=dur.fNum) || (fDenom!=dur.fDenom) || (fDots!=dur.fDots); }
235class EXP guidonotestatus {
237 enum { kMaxInstances=128 };
239 static guidonotestatus* get(
unsigned short voice);
240 static void resetall();
241 static void freeall();
243 enum { defoctave=1, defnum=1, defdenom=4 };
245 void reset() { fOctave=defoctave; fDur.set(defnum, defdenom, 0); }
246 guidonotestatus& operator= (
const guidonoteduration& dur) { fDur = dur;
return *
this; }
254 guidonotestatus() : fOctave(defoctave), fDur(defnum, defdenom, 0) {}
256 static guidonotestatus * fInstances[kMaxInstances];