Entropy Piano Tuner
1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
|
Calculation-Manager. More...
#include <calculationmanager.h>
Public Member Functions | |
virtual | ~CalculationManager () |
void | start (const std::string &algorithmName, const Piano &piano) |
Start the calculation thread. By calling this function, the current piano is passed by reference and copied to the local mPiano member variable. More... | |
void | stop () |
Stop the calculation thread. More... | |
void | registerFactory (const std::string &name, AlgorithmFactoryBase *factory) |
const std::map< std::string, AlgorithmFactoryBase * > & | getAlgorithms () const |
AlgorithmFactoryDescription & | getAlgorithmDescription (const std::string &algorithmName) const |
std::shared_ptr< const AlgorithmInformation > | loadAlgorithmInformation (const std::string &algorithmName) const |
bool | hasAlgorithm (const std::string &id) const |
std::string | getDefaultAlgorithmId () const |
Static Public Member Functions | |
static CalculationManager & | getSingleton () |
Private Member Functions | |
CalculationManager () | |
Constructor, resets member variables. More... | |
Private Attributes | |
std::map< std::string, AlgorithmFactoryBase * > | mAlgorithms |
std::unique_ptr< Algorithm > | mCurrentAlgorithm |
Calculation-Manager.
This class coordinates the calculation process. The calculation process runs in an independent thread. By calling start, a local copy of the entire piano is instantated. The calculation process manipulates the local copy but it does not return it directly. Instead the whole communication with the tuner is realized in terms of messages. In particular, each change of the tuning curve is communicated by a message.
The calculation manager is a singleton class.
Definition at line 52 of file calculationmanager.h.
|
private |
Constructor, resets member variables.
Definition at line 46 of file calculationmanager.cpp.
|
virtual |
AlgorithmFactoryDescription & CalculationManager::getAlgorithmDescription | ( | const std::string & | algorithmName | ) | const |
|
inline |
Definition at line 67 of file calculationmanager.h.
std::string CalculationManager::getDefaultAlgorithmId | ( | ) | const |
|
static |
Definition at line 56 of file calculationmanager.cpp.
bool CalculationManager::hasAlgorithm | ( | const std::string & | id | ) | const |
Definition at line 134 of file calculationmanager.cpp.
std::shared_ptr< const AlgorithmInformation > CalculationManager::loadAlgorithmInformation | ( | const std::string & | algorithmName | ) | const |
void CalculationManager::registerFactory | ( | const std::string & | name, |
AlgorithmFactoryBase * | factory | ||
) |
Definition at line 102 of file calculationmanager.cpp.
void CalculationManager::start | ( | const std::string & | algorithmName, |
const Piano & | piano | ||
) |
Start the calculation thread. By calling this function, the current piano is passed by reference and copied to the local mPiano member variable.
piano | : Reference to the piano instance. |
Definition at line 71 of file calculationmanager.cpp.
void CalculationManager::stop | ( | ) |
Stop the calculation thread.
Definition at line 94 of file calculationmanager.cpp.
|
private |
Definition at line 74 of file calculationmanager.h.
|
private |
Definition at line 75 of file calculationmanager.h.