aboutsummaryrefslogtreecommitdiff
path: root/simple-visualization/qmppianowidget.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'simple-visualization/qmppianowidget.hpp')
-rw-r--r--simple-visualization/qmppianowidget.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/simple-visualization/qmppianowidget.hpp b/simple-visualization/qmppianowidget.hpp
new file mode 100644
index 0000000..22af6ce
--- /dev/null
+++ b/simple-visualization/qmppianowidget.hpp
@@ -0,0 +1,25 @@
+#ifndef QMPPIANOWIDGET_HPP
+#define QMPPIANOWIDGET_HPP
+
+#include <QWidget>
+#include <bitset>
+
+class qmpPianoWidget : public QWidget
+{
+ Q_OBJECT
+ public:
+ explicit qmpPianoWidget(QWidget *parent = nullptr);
+ void setKeyState(int key,bool state);
+ void reset();
+ QSize minimumSizeHint()const override;
+
+ protected:
+ void paintEvent(QPaintEvent *event)override;
+
+ private:
+ bool keystates[128];
+ QRectF getKeyRect(int key);
+ void paintKey(QRectF keyrect,QColor keycolor);
+};
+
+#endif // QMPPIANOWIDGET_HPP