Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TuningIndicatorDrawer Class Reference

Drawer for the tuning indicator. More...

#include <tuningindicatordrawer.h>

+ Inheritance diagram for TuningIndicatorDrawer:
+ Collaboration diagram for TuningIndicatorDrawer:

Public Member Functions

 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...
 
- Public Member Functions inherited from MessageListener
 MessageListener (bool defaultActivation=true)
 
virtual ~MessageListener ()
 
bool isMessageListenerActive () const
 
void activateMessageListener ()
 
void deactivateMessageListener ()
 

Protected Member Functions

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...
 

Private Types

using ComplexVector = std::vector< std::complex< double >>
 

Private Attributes

const PianomPiano
 Pointer to the piano. More...
 
int mNumberOfKeys
 Total number of keys. More...
 
int mSelectedKey
 Number of selected key, -1 if none. More...
 
int mRecognizedKey
 Number of recognized key, -1 if none. More...
 
OperationMode mOperationMode
 Current operation mode of the EPT. More...
 
FFTDataPointer mFFTData
 Pointer to the Fourier transform data. More...
 
FrequencyDetectionResult mFrequencyDetectionResult
 Copy of frequency detection result. More...
 
ComplexVector mDataVector
 Data vector holding complex phases for stroboscope. More...
 

Additional Inherited Members

- Protected Attributes inherited from DrawerBase
GraphicsViewAdaptermGraphics
 Pointer to the graphics view adapter. More...
 

Detailed Description

Drawer for the tuning indicator.

This class draws the content of the tuning indicator in the tuning mode. It is completely driven by messages. There are two operation modes depending on the settings: (a) the spectral mode, where a zoomed part of the spectrum is displayed which has to be brought to the center, and (b) the stroboscopic mode, where a stroboscopic interference pattern is shown in rainbow colors.

See also
Stroboscope
TuningIndicatorView

Definition at line 44 of file tuningindicatordrawer.h.

Member Typedef Documentation

using TuningIndicatorDrawer::ComplexVector = std::vector<std::complex<double>>
private

Definition at line 67 of file tuningindicatordrawer.h.

Constructor & Destructor Documentation

TuningIndicatorDrawer::TuningIndicatorDrawer ( GraphicsViewAdapter graphics)

Definition at line 37 of file tuningindicatordrawer.cpp.

TuningIndicatorDrawer::~TuningIndicatorDrawer ( )
inline

Definition at line 48 of file tuningindicatordrawer.h.

Member Function Documentation

void TuningIndicatorDrawer::clear ( )
finaloverrideprotectedvirtual

Clear the shared pointer to the FFT.

Reimplemented from DrawerBase.

Definition at line 157 of file tuningindicatordrawer.cpp.

+ Here is the call graph for this function:

void TuningIndicatorDrawer::draw ( )
finaloverrideprotectedvirtual

Main drawing function.

This is the main drawing function for the tuning indicator. In the stroboscopic mode the complex phases of the partials are simply fowarded to the function drawStroboscope of the GraphicsViewAdapter. This means that the drawing of the stroboscope is done by the implementation for the sake of fast response. In the spectral mode the drawing is carried out by the present function.

Implements DrawerBase.

Definition at line 180 of file tuningindicatordrawer.cpp.

+ Here is the call graph for this function:

void TuningIndicatorDrawer::handleMessage ( MessagePtr  m)
overrideprotectedvirtual

Message listener.

The message listener handles the incoming messages and takes the corresponding action.

Parameters
m: Pointer to the incoming message

Implements MessageListener.

Definition at line 61 of file tuningindicatordrawer.cpp.

+ Here is the call graph for this function:

void TuningIndicatorDrawer::toggleSpectralAndStroboscopeMode ( )

Toggle between spectral and stroboscopic operation mode.

Definition at line 140 of file tuningindicatordrawer.cpp.

+ Here is the call graph for this function:

Member Data Documentation

ComplexVector TuningIndicatorDrawer::mDataVector
private

Data vector holding complex phases for stroboscope.

Definition at line 68 of file tuningindicatordrawer.h.

FFTDataPointer TuningIndicatorDrawer::mFFTData
private

Pointer to the Fourier transform data.

Definition at line 64 of file tuningindicatordrawer.h.

FrequencyDetectionResult TuningIndicatorDrawer::mFrequencyDetectionResult
private

Copy of frequency detection result.

Definition at line 65 of file tuningindicatordrawer.h.

int TuningIndicatorDrawer::mNumberOfKeys
private

Total number of keys.

Definition at line 59 of file tuningindicatordrawer.h.

OperationMode TuningIndicatorDrawer::mOperationMode
private

Current operation mode of the EPT.

Definition at line 62 of file tuningindicatordrawer.h.

const Piano* TuningIndicatorDrawer::mPiano
private

Pointer to the piano.

Definition at line 58 of file tuningindicatordrawer.h.

int TuningIndicatorDrawer::mRecognizedKey
private

Number of recognized key, -1 if none.

Definition at line 61 of file tuningindicatordrawer.h.

int TuningIndicatorDrawer::mSelectedKey
private

Number of selected key, -1 if none.

Definition at line 60 of file tuningindicatordrawer.h.


The documentation for this class was generated from the following files: