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
calculationprogressgroup.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright 2015 Haye Hinrichsen, Christoph Wick
3  *
4  * This file is part of Entropy Piano Tuner.
5  *
6  * Entropy Piano Tuner is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * Entropy Piano Tuner is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * Entropy Piano Tuner. If not, see http://www.gnu.org/licenses/.
18  *****************************************************************************/
19 
20 //=============================================================================
21 // Calculation progress group
22 //=============================================================================
23 
24 #ifndef CALCULATIONPROGRESSGROUP_H
25 #define CALCULATIONPROGRESSGROUP_H
26 
27 #include <QLabel>
28 #include <QProgressBar>
29 #include <QPushButton>
30 #include <QComboBox>
31 #include <QMap>
32 #include "../core/messages/messagelistener.h"
33 #include "../core/adapters/calculationadapter.h"
35 
37 
51 
53  public MessageListener,
54  public CalculationAdapter
55 {
56  Q_OBJECT
57 
58 public:
59  CalculationProgressGroup(Core *core, QWidget *parent = nullptr);
61 
62 private:
63  virtual void handleMessage(MessagePtr m) override final;
64 
65 private slots:
66  void updateTitle();
67  void onStartCalculation();
68  void onCancelCalculation();
69  void onResetCalculation();
70  void startCancelPressed();
71  void showAlgorithmInfo();
72 
73 private:
74 
76  QLabel *mStatusLabel;
77  QProgressBar *mCalculationProgressBar;
78  QPushButton *mStartCancelButton;
79 
81  std::shared_ptr<const AlgorithmInformation> mAlgorithmSelection;
82 };
83 
84 #endif // CALCULATIONPROGRESSGROUP_H
std::shared_ptr< const AlgorithmInformation > mAlgorithmSelection
Pointer to the algorithm selector.
std::shared_ptr< Message > MessagePtr
Global type of a shared message pointer.
Definition: message.h:98
void onStartCalculation()
Function called to start the calculation.
void updateTitle()
Function to update the title of the algorithm in use.
bool mCalculationInProgress
Flag: calculation is in progress.
Adapter for starting and stopping the calculation process.
QPushButton * mStartCancelButton
Pointer to the start and cancel button.
QProgressBar * mCalculationProgressBar
Pointer to the progress bar.
void showAlgorithmInfo()
Show information about the algorithm.
void onCancelCalculation()
Function called to cancel the calculation.
CalculationProgressGroup(Core *core, QWidget *parent=nullptr)
CalculationProgressGroup::CalculationProgressGroup.
Visible QGroupBox to handle the calculation.
void onResetCalculation()
Function called to reset the calculation.
QLabel * mStatusLabel
Pointer to the status label.
~CalculationProgressGroup()
Destructor without function.
CORE : Class managing the core.
Definition: core.h:45
void startCancelPressed()
Slot called when the start and stop button was pressed.
virtual void handleMessage(MessagePtr m) overridefinal
Message handling.