Debian Codegraph @

src/tuner.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2016, Mike Walters <[email protected]>
3 *
4 * This file is part of inspectrum.
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU 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 #pragma once
21
22 #include <QMouseEvent>
23 #include <QObject>
24 #include <QPainter>
25 #include <QPoint>
26 #include "cursor.h"
27 #include "util.h"
28
29 class Tuner : public QObject
30 {
31 Q_OBJECT
32
33 public:
34 Tuner(int height, QObject * parent);
35 int centre();
36 int deviation();
37 bool mouseEvent(QEvent::Type, QMouseEvent *event);
38 void leaveEvent();
39 void paintFront(QPainter &painter, QRect &rect, range_t<size_t> sampleRange);
40 void setCentre(int centre);
41 void setDeviation(int dev);
42 void setHeight(int height);
43
44 public slots:
45 void cursorMoved();
46
47 signals:
48 void tunerMoved();
49
50 private:
51 void updateCursors();
52
53 Cursor *minCursor;
54 Cursor *cfCursor;
55 Cursor *maxCursor;
56 int _deviation;
57 int height;
58 };