Entropy Piano Tuner
1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
|
The Algorithm class is a basic abstract class for any algorithm. More...
#include <algorithm.h>
Public Member Functions | |
Algorithm (const Piano &piano, const AlgorithmFactoryDescription &desciption) | |
virtual | ~Algorithm () |
virtual void | workerFunction () overridefinal |
Virtual worker function, executed within the new thread. More... | |
Public Member Functions inherited from SimpleThreadHandler | |
SimpleThreadHandler () | |
Constructor. More... | |
virtual | ~SimpleThreadHandler () |
virtual destructor calls stop More... | |
virtual void | start () |
Start the thread. More... | |
virtual void | stop () |
Stop the thread. More... | |
Protected Types | |
using | Keys = Keyboard::Keys |
using | SpectrumType = Key::SpectrumType |
Protected Member Functions | |
virtual void | algorithmWorkerFunction ()=0 |
void | updateTuningCurve (int keynumber, double frequency) |
bool | terminateThread () |
void | showCalculationProgress (double fraction) |
Transmit the current percentage of progress to the messaging system. More... | |
void | showCalculationProgress (const Key &key, double start=0, double range=1) |
Transmit the current percentage of progress to the messaging system. More... | |
Protected Member Functions inherited from SimpleThreadHandler | |
virtual void | exceptionCaught (const EptException &e) |
EPT exception handling. More... | |
void | setCancelThread (bool b) |
Cancel-flag setter method, thread-safe. More... | |
bool | cancelThread () const |
Cancel-flag getter method, thread-safe. More... | |
void | msleep (double milliseconds) |
Sleep function for staying idle. More... | |
bool | isThreadRunning () const |
Flag to check if the thread is running. More... | |
Protected Attributes | |
const size_t | NumberOfBins = Key::NumberOfBins |
Piano | mPiano |
Copy of the piano. More... | |
const AlgorithmFactoryDescription & | mFactoryDescription |
Keyboard & | mKeyboard |
Reference to the keyboard. More... | |
Keys & | mKeys |
Reference to the keys. More... | |
const int | mNumberOfKeys |
The number of keys. More... | |
const int | mKeyNumberOfA4 |
Number of A4. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from SimpleThreadHandler | |
static void | setThreadName (std::string s) |
Specify the name of the thread. More... | |
The Algorithm class is a basic abstract class for any algorithm.
It creates a copy of the actual Piano in mPiano. The algorithm is allowed to change this data in any way.
Definition at line 38 of file algorithm.h.
|
protected |
Definition at line 58 of file algorithm.h.
|
protected |
Definition at line 59 of file algorithm.h.
Algorithm::Algorithm | ( | const Piano & | piano, |
const AlgorithmFactoryDescription & | desciption | ||
) |
Definition at line 27 of file algorithm.cpp.
|
virtual |
Definition at line 38 of file algorithm.cpp.
|
protectedpure virtual |
|
protected |
Transmit the current percentage of progress to the messaging system.
percentage | : value in [0,1], corresponding to 0% and 100% |
Definition at line 79 of file algorithm.cpp.
|
protected |
Transmit the current percentage of progress to the messaging system.
key | : reference to the key that is being processed, converted to a percentage. The progress value is reconstructed from the measured frequency. |
start | : The starting value of the progress value |
range | : The range of the progress value (start ... start+range) |
Definition at line 100 of file algorithm.cpp.
|
inlineprotected |
|
protected |
Definition at line 60 of file algorithm.cpp.
|
finaloverridevirtual |
Virtual worker function, executed within the new thread.
Overload this function with the code to be executed within the new thread. Make sure that it either returns by itself or when cancelThread() becomes true. This means that a typical implementation of the workerFunction() should contain a while(not cancelThread()) loop.
If you want the thread to stay idle call msleep.
Implements SimpleThreadHandler.
Definition at line 43 of file algorithm.cpp.
|
protected |
Definition at line 63 of file algorithm.h.
|
protected |
Reference to the keyboard.
Definition at line 66 of file algorithm.h.
|
protected |
Number of A4.
Definition at line 69 of file algorithm.h.
|
protected |
Reference to the keys.
Definition at line 67 of file algorithm.h.
|
protected |
The number of keys.
Definition at line 68 of file algorithm.h.
|
protected |
Copy of the piano.
Definition at line 62 of file algorithm.h.
|
protected |
Definition at line 60 of file algorithm.h.