24 #ifndef TUNINGCURVEGRAPHADAPTER_H
25 #define TUNINGCURVEGRAPHADAPTER_H
27 #include "../system/prerequisites.h"
29 #include "../piano/piano.h"
30 #include "../messages/messagelistener.h"
87 virtual void draw() final;
118 #endif // TUNINGCURVEGRAPHADAPTER_H
int mKeyNumberOfA4
Index of A4 (reference key)
std::shared_ptr< Message > MessagePtr
Global type of a shared message pointer.
std::uint32_t RoleType
Type of a user role that can be set in a GraphicsItem (bitwise flag).
OperationMode
Operation mode of the tuner.
Marker indicating overpull.
~TuningCurveGraphDrawer()
Empty destructor.
int mNumberOfKeys
Total number of keys (88)
Union of all global markers.
double getMarkerPosition(int keyindex, RoleType role)
Compute the position of a marker.
static const PenType fcmarkers
Pen type for computed frequency markers.
GraphicsItem::RoleType RoleType
OperationMode mOperationMode
Current operation mode.
virtual void draw() final
Main drawing function.
TuningCurveGraphDrawer(GraphicsViewAdapter *graphics)
Constructor, calls the DrawerBase constructor and resets variables.
Union of all key-specific markers.
static const PenType bmarkers
Pen type for inharmonicity markers.
const Piano * mPiano
Pointer to the actual piano.
FillTypes
Available filling colors (e.g. to fill rectangles)
static const FillType allowdAreaFill
Filling for the allowed tuning area.
static const PenType gridcolor
Pen type for background grid pentype.
static const PenType middleline
Pen type for bold middle line of grid.
static const PenType fgmarkers
Pen type for recorded frequency in background.
Inharmonicity marker (shown upside down)
static const PenType opmarkers
Pen type for tuned frequency markers.
static const PenType frmarkers
Pen type for recorded frequency markers.
PenType
Available pen types for drawing.
Marker indicating recorded frequency.
Abstract base class for implementations rendering graphics.
ItemRoles
The ItemRoles used in the TuningCurveGraphDrawer.
double convertCentsToY(double cents)
Convert cents to y-coordinate between 0 and 1.
static const PenType ftmarkers
Pen type for tuned frequency markers.
virtual void handleMessage(MessagePtr m) override
Message listener and dispatcher.
double mConcertPitch
Chosen concert pitch in Hz.
static const int rangeInCents
Constant, defining the visible range above and below the equal temperament level in cents...
void updateMarkerPosition(int keyindex, RoleType role)
void manuallyEditTuningCurveByClick(double relX, double relY)
Manually edit tuning curve by mouse click.
OperationMode getOperationMode() const
Marker indicating computed frequency.
void drawMarkers(int8_t key)
Draw the tuning markers in the tuning curve panel.
void drawGrid()
Draw the background grid in the tuning curve panel.
Marker indicating tuned frequency.
static const PenType centlines
Pen type for thin grid indicating cents.
Class for drawing various tuning curves.
Abstract base class for drawing 2d graphics.
PenType getMarkerPenType(RoleType role)
Get the pen type of a marker with a given role.