1 /**************************************************************************** 2 ** Copyright (c) 2019, Adel Kara Slimane <adel.ks@zegrapher.com> 3 ** 4 ** This file is part of ZeGrapher's source code. 5 ** 6 ** ZeGrapher is free software: you may copy, redistribute and/or modify it 7 ** 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 ** This file is distributed in the hope that it will be useful, but 12 ** WITHOUT ANY WARRANTY; without even the implied warranty of 13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 ** General Public License for more details. 15 ** 16 ** You should have received a copy of the GNU General Public License 17 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 18 ** 19 ****************************************************************************/ 20 21 22 23 24 #ifndef PAREQCONTROLLER_H 25 #define PAREQCONTROLLER_H 26 27 #include <QObject> 28 #include "pareqwidget.h" 29 30 class ParEqController : public QObject 31 { 32 Q_OBJECT 33 public: 34 explicit ParEqController(QList<ParEqWidget*> *list); 35 36 signals: 37 void animationUpdate(); 38 39 public slots: 40 void setIncrPeriod(int msecs); 41 void setUpdateFreq(int Hz); 42 void newParEqAdded(); 43 44 protected slots: 45 void nextAnimationFrame(); 46 47 protected: 48 void updateRatioInParEq(); 49 50 int freq, period; 51 double ratio; 52 QTimer animationTimer; 53 QList<ParEqWidget*> *parEqs; 54 55 }; 56 57 #endif // PAREQCONTROLLER_H 58