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
PianoManager Class Reference

The PianoManager class. More...

#include <pianomanager.h>

+ Inheritance diagram for PianoManager:
+ Collaboration diagram for PianoManager:

Public Member Functions

 PianoManager ()
 Constructor, resets member variables. More...
 
 ~PianoManager ()
 
PianogetPiano ()
 
const PianogetPiano () const
 
void resetPitches ()
 Reset all recorded keys and send a message to redraw all elements. More...
 
- Public Member Functions inherited from MessageListener
 MessageListener (bool defaultActivation=true)
 
virtual ~MessageListener ()
 
bool isMessageListenerActive () const
 
void activateMessageListener ()
 
void deactivateMessageListener ()
 

Protected Member Functions

void handleMessage (MessagePtr m) overridefinal
 Message listener and dispatcher. More...
 

Private Member Functions

void handleNewKey (int keynumber, std::shared_ptr< Key > keyptr)
 Handle the event that a key has been successfully indentified. More...
 
int findNextKey (int keynumber)
 Find the next key to be recorded. More...
 

Private Attributes

Piano mPiano
 Instance of the piano. More...
 
int mSelectedKey
 Local copy of the selected key. More...
 
bool mForcedRecording
 Flag for forced recording. More...
 
OperationMode mOperationMode
 Local copy of the operation mode. More...
 

Detailed Description

The PianoManager class.

This class holds the instance of the Piano and manages the recording process.

Definition at line 39 of file pianomanager.h.

Constructor & Destructor Documentation

PianoManager::PianoManager ( )

Constructor, resets member variables.

Definition at line 47 of file pianomanager.cpp.

PianoManager::~PianoManager ( )
inline

Definition at line 43 of file pianomanager.h.

Member Function Documentation

int PianoManager::findNextKey ( int  keynumber)
private

Find the next key to be recorded.

Once a key has been recorded successfully, this function determines who ist next.

Parameters
keynumber: Number of the current key.
Returns
Number of the next key to be recorded.

Definition at line 225 of file pianomanager.cpp.

+ Here is the call graph for this function:

Piano& PianoManager::getPiano ( )
inline

Definition at line 45 of file pianomanager.h.

const Piano& PianoManager::getPiano ( ) const
inline

Definition at line 46 of file pianomanager.h.

void PianoManager::handleMessage ( MessagePtr  m)
finaloverrideprotectedvirtual

Message listener and dispatcher.

Parameters
m: Pointer to the message.

Implements MessageListener.

Definition at line 101 of file pianomanager.cpp.

+ Here is the call graph for this function:

void PianoManager::handleNewKey ( int  keynumber,
std::shared_ptr< Key keyptr 
)
private

Handle the event that a key has been successfully indentified.

This function decides whether to accept or reject a keystroke identified by the FFTAnalyzer and then sets the key in the mPiano.

Parameters
keynumber: Number of the key that was recognized.
keyptr: Shared pointer to the key object.

Definition at line 177 of file pianomanager.cpp.

+ Here is the call graph for this function:

void PianoManager::resetPitches ( )

Reset all recorded keys and send a message to redraw all elements.

This function is called by selecting the menu entry "Reset recording". Its action depends on the operation mode: In the idle and recording mode all key-related data is cancelled. In the calculation the tuning curve is set to zero (ET). In the tuning mode the measured tuning levels are cancelled.

Definition at line 69 of file pianomanager.cpp.

+ Here is the call graph for this function:

Member Data Documentation

bool PianoManager::mForcedRecording
private

Flag for forced recording.

Definition at line 59 of file pianomanager.h.

OperationMode PianoManager::mOperationMode
private

Local copy of the operation mode.

Definition at line 60 of file pianomanager.h.

Piano PianoManager::mPiano
private

Instance of the piano.

Definition at line 57 of file pianomanager.h.

int PianoManager::mSelectedKey
private

Local copy of the selected key.

Definition at line 58 of file pianomanager.h.


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