Entropy Piano Tuner
1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
|
Abstract base class for drawing 2d graphics. More...
#include <drawerbase.h>
Public Member Functions | |
DrawerBase (GraphicsViewAdapter *graphics, double intervall=1.0/24.0) | |
Constructor of a drawer. More... | |
~DrawerBase () | |
void | redraw (bool force=false) |
Function to completely redraw the scene. More... | |
bool | requestRedraw (bool force=false) |
Check whether the content has to be redrawn. More... | |
Protected Member Functions | |
virtual void | draw ()=0 |
Abstract function : draw the content. More... | |
virtual void | clear () |
Clear the whole view. More... | |
Protected Attributes | |
GraphicsViewAdapter * | mGraphics |
Pointer to the graphics view adapter. More... | |
Private Types | |
using | system_time_point = std::chrono::time_point< std::chrono::high_resolution_clock > |
Private Attributes | |
system_time_point | mTimeLastDrawn |
Timeposition when last drawn. More... | |
double | mRedrawIntervalInSecs |
Update time. More... | |
Abstract base class for drawing 2d graphics.
A drawer is an object that draws 2d graphics by calling the methods of a GraphicsViewAdapter. A call of redraw() redraws the complete graphics.
Definition at line 40 of file drawerbase.h.
|
private |
Definition at line 56 of file drawerbase.h.
DrawerBase::DrawerBase | ( | GraphicsViewAdapter * | graphics, |
double | intervall = 1.0/24.0 |
||
) |
Constructor of a drawer.
graphics | : Pointer to the GraphicsViewAdapter |
intervall | : maximal update interval in seconds |
Definition at line 37 of file drawerbase.cpp.
|
inline |
Definition at line 44 of file drawerbase.h.
|
inlineprotectedvirtual |
Clear the whole view.
Reimplemented in FourierSpectrumGraphDrawer, and TuningIndicatorDrawer.
Definition at line 51 of file drawerbase.h.
|
protectedpure virtual |
Abstract function : draw the content.
Implemented in TuningCurveGraphDrawer, FourierSpectrumGraphDrawer, and TuningIndicatorDrawer.
void DrawerBase::redraw | ( | bool | force = false | ) |
Function to completely redraw the scene.
The function first clears the scene and then calls the abstract draw() method.
force | : true if redrawing is forced. |
Definition at line 57 of file drawerbase.cpp.
bool DrawerBase::requestRedraw | ( | bool | force = false | ) |
Check whether the content has to be redrawn.
If force is set to false the function returns true on redraw timeout. If force is set to true the function will always return true. If returning true the function will automatically reset the timer.
force | : Force redrawing |
Definition at line 81 of file drawerbase.cpp.
|
protected |
Pointer to the graphics view adapter.
Definition at line 53 of file drawerbase.h.
|
private |
Update time.
Definition at line 58 of file drawerbase.h.
|
private |
Timeposition when last drawn.
Definition at line 57 of file drawerbase.h.