Entropy Piano Tuner
1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
|
Class for the Qt implementation of the tuning indicator. More...
#include <tuningindicatorview.h>
Public Member Functions | |
TuningIndicatorView (QWidget *parent) | |
Constructor to link AutoScaledToKeyboardGraphicsView with the TuningIndicatorDrawer. More... | |
virtual | ~TuningIndicatorView () |
Empty virtual destructor. More... | |
Public Member Functions inherited from StroboscopicViewAdapterForQt | |
StroboscopicViewAdapterForQt (QWidget *parent, DrawerBase *drawer, QRectF sceneRect) | |
Constructor with no stroboscope in the beginning. More... | |
~StroboscopicViewAdapterForQt () | |
Destructor, deleting the stroboscope if existent. More... | |
virtual void | drawStroboscope (const ComplexVector &data) overridefinal |
StroboscopicViewAdapterForQt::drawStroboscope. More... | |
void | clear () overridefinal |
Clear view of stroboscope and spectral indicator. More... | |
Public Member Functions inherited from GraphicsViewAdapterForQt | |
GraphicsViewAdapterForQt (QWidget *parent, DrawerBase *drawer, QRectF sceneRect) | |
Constructor. More... | |
~GraphicsViewAdapterForQt () | |
Destructor, removing all graphics items from the list. More... | |
void | setSceneRect (const QRectF &rect) |
Setter function for the scene rectangle. More... | |
QPointF | convertRelToAbs (const QPointF &p) const |
Converting from relative to absolute coordinates. More... | |
QSizeF | convertRelToAbs (const QSizeF &s) const |
Converting from relative to absolute coordinates. More... | |
QLineF | convertRelToAbsLine (qreal x1, qreal y1, qreal x2, qreal y2) const |
Converting of a line from relative to absolute coordinates. More... | |
QPointF | convertAbsToRel (const QPointF &p) const |
Converting from absolute to relative coordinates. More... | |
Public Member Functions inherited from GraphicsViewAdapter | |
GraphicsViewAdapter () | |
Empty constructor. More... | |
~GraphicsViewAdapter () | |
Destructor clearing the view. More... | |
GraphicItemsList & | getGraphicItems () |
Get the list of the graphic items. More... | |
const GraphicItemsList & | getGraphicItems () const |
Get a constant list of the graphic items. More... | |
GraphicsItem * | getGraphicItem (int keyIndex, RoleType role) |
Get a single graphics element specified by its index and its role. More... | |
GraphicsItem * | getGraphicItemByRole (RoleType role) |
Get the first of all graphics elements with a given role. More... | |
GraphicItemsList | getGraphicItems (int keyIndex) |
Get a list of graphic items that match with the keyIndex. More... | |
GraphicItemsList | getGraphicItemsByRole (RoleType role) |
Get a list of graphic items that match with the given role. More... | |
GraphicItemsList | getGraphicItems (int keyIndex, RoleType role) |
Get the list of all graphics elements of a given key and role. More... | |
Public Member Functions inherited from TuningIndicatorDrawer | |
TuningIndicatorDrawer (GraphicsViewAdapter *graphics) | |
~TuningIndicatorDrawer () | |
void | toggleSpectralAndStroboscopeMode () |
Toggle between spectral and stroboscopic operation mode. More... | |
Public Member Functions inherited from DrawerBase | |
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... | |
Private Member Functions | |
void | mousePressEvent (QMouseEvent *event) overridefinal |
Function called when the tuning indicator is clicked or touched. More... | |
void | mouseDoubleClickEvent (QMouseEvent *event) overridefinal |
Function called when the tuning indicator is double-clicked. More... | |
virtual QSize | sizeHint () const overridefinal |
Additional Inherited Members | |
Public Types inherited from GraphicsViewAdapter | |
enum | PenType { PEN_THIN_BLACK, PEN_MEDIUM_BLACK, PEN_THIN_VERY_LIGHT_GRAY, PEN_THIN_LIGHT_GRAY, PEN_THIN_DARK_GRAY, PEN_MEDIUM_LIGHT_GRAY, PEN_MEDIUM_DARK_GRAY, PEN_MEDIUM_GRAY, PEN_THIN_CYAN, PEN_MEDIUM_CYAN, PEN_MEDIUM_ORANGE, PEN_MEDIUM_MAGENTA, PEN_THIN_MAGENTA, PEN_THIN_RED, PEN_MEDIUM_RED, PEN_THIN_BLUE, PEN_THIN_TRANSPARENT, PEN_MEDIUM_DARK_GREEN } |
Available pen types for drawing. More... | |
enum | FillTypes { FILL_TRANSPARENT, FILL_LIGHT_GRAY, FILL_RED, FILL_ORANGE, FILL_GREEN, FILL_LIGHT_GREEN, FILL_BLUE } |
Available filling colors (e.g. to fill rectangles) More... | |
using | RoleType = GraphicsItem::RoleType |
using | ComplexVector = std::vector< std::complex< double >> |
Abstract function: Draw stroboscope. More... | |
Protected Member Functions inherited from GraphicsViewAdapterForQt | |
void | showEvent (QShowEvent *event) override |
Show the scene (reimplemented show event). More... | |
void | resizeEvent (QResizeEvent *event) override |
Resize the scene (reimplemented resize event). More... | |
virtual GraphicsItem * | drawLine (double x1, double y1, double x2, double y2, PenType pen) override |
Abstract function: Draw a line. More... | |
virtual GraphicsItem * | drawChart (const std::vector< Point > &points, PenType pen) override |
Abstract function: Draw a chart (polygon). More... | |
virtual GraphicsItem * | drawFilledRect (double x, double y, double w, double h, PenType pen, FillTypes fill) override |
Abstract function: Draw a filled rectangle. More... | |
Protected Member Functions inherited from TuningIndicatorDrawer | |
virtual void | draw () overridefinal |
Main drawing function. More... | |
virtual void | clear () overridefinal |
Clear the shared pointer to the FFT. More... | |
virtual void | handleMessage (MessagePtr m) override |
Message listener. More... | |
Protected Attributes inherited from GraphicsViewAdapterForQt | |
DrawerBase * | mDrawer |
The drawer of this GraphicsViewAdapterForQt. More... | |
QGraphicsScene | mScene |
The QGraphicsScene. More... | |
QRectF | mSceneRect |
The scene rect. More... | |
Protected Attributes inherited from DrawerBase | |
GraphicsViewAdapter * | mGraphics |
Pointer to the graphics view adapter. More... | |
Class for the Qt implementation of the tuning indicator.
It forwards the drawings of the TuningIndicatorDrawer to a AutoScaledToKeyboardGraphicsView.
Definition at line 38 of file tuningindicatorview.h.
TuningIndicatorView::TuningIndicatorView | ( | QWidget * | parent | ) |
Constructor to link AutoScaledToKeyboardGraphicsView with the TuningIndicatorDrawer.
parent | : The parent widget. |
Definition at line 41 of file tuningindicatorview.cpp.
|
inlinevirtual |
Empty virtual destructor.
Definition at line 43 of file tuningindicatorview.h.
|
finaloverrideprivate |
Function called when the tuning indicator is double-clicked.
For convenience this function toggles the mode like mousePressEvent in the case of a double click. Otherwise, klicking twice would only toggle once which is might me confusing.
event | : Mouse event that tells us which button has been pressed. |
Definition at line 85 of file tuningindicatorview.cpp.
|
finaloverrideprivate |
Function called when the tuning indicator is clicked or touched.
By clicking the tuning indicator the EPT toggles between the spectral and the stroboscopic mode. The modes can also be changed in the settings.
event | : Mouse event that tells us which button has been pressed. |
Definition at line 63 of file tuningindicatorview.cpp.
|
inlinefinaloverrideprivatevirtual |
Definition at line 48 of file tuningindicatorview.h.