|
Canorus
0.7
|
00001 00008 #ifndef DRAWABLEFUNCTIONMARKCONTEXT_H_ 00009 #define DRAWABLEFUNCTIONMARKCONTEXT_H_ 00010 00011 #include "drawable/drawablecontext.h" 00012 00013 class CAFunctionMarkContext; 00014 00015 class CADrawableFunctionMarkContext : public CADrawableContext { 00016 public: 00017 CADrawableFunctionMarkContext(CAFunctionMarkContext *c, double x, double y, int numberOfLines=2); 00018 ~CADrawableFunctionMarkContext(); 00019 00020 void draw(QPainter *p, const CADrawSettings s); 00021 CADrawableFunctionMarkContext *clone(); 00022 00023 void setNumberOfLines(int number) { _numberOfLines = number; } 00024 int numberOfLines() { return _numberOfLines; } 00025 00026 enum CAFunctionMarkLine { 00027 Upper, // used for function name in tonicization 00028 Middle, // used for general function names 00029 Lower // used for chord areas, ellipse sign etc. 00030 }; 00031 00032 double yPosLine(CAFunctionMarkLine part); // Returns the Y coordinate of the top of the given line 00033 void nextLine() { _currentLineIdx = ++_currentLineIdx % _numberOfLines; } 00034 int currentLineIdx() { return _currentLineIdx; } 00035 00036 private: 00037 int _numberOfLines; // Number of lines the context can consist. Usually, this number is 2. But when doing research on scores, this could be expanded 00038 int _currentLineIdx; 00039 }; 00040 00041 #endif /* DRAWABLEFUNCTIONMARKCONTEXT_H_ */
1.8.0