diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-05-04 23:45:29 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-05-04 23:45:29 +0800 |
commit | 56eaa27d4daca9264dac2e822b1126cf6eb8cbf4 (patch) | |
tree | b4da915a530814cd6e1705e72b1bde5ad196d8d2 /visualization/qmpvirtualpiano3d.hpp | |
parent | 015a45c276caf34be3ce9175a1bcce644d736a0b (diff) | |
download | QMidiPlayer-56eaa27d4daca9264dac2e822b1126cf6eb8cbf4.tar.xz |
Piano keyboard: first steps.
Diffstat (limited to 'visualization/qmpvirtualpiano3d.hpp')
-rw-r--r-- | visualization/qmpvirtualpiano3d.hpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/visualization/qmpvirtualpiano3d.hpp b/visualization/qmpvirtualpiano3d.hpp new file mode 100644 index 0000000..5c30718 --- /dev/null +++ b/visualization/qmpvirtualpiano3d.hpp @@ -0,0 +1,29 @@ +#ifndef QMPVIRTUALPIANO3D_H +#define QMPVIRTUALPIANO3D_H +#include <smelt.hpp> +#include "extrasmeltutils.hpp" +#define WK_PREWIDTH 0.8 +#define WK_TALWIDTH 1.2 +#define WK_PRELEN 3.5 +#define WK_TALLEN 2.5 +#define WK_WING 0.1 +#define WK_HEIGHT 1.5 +#define BK_WIDTH 7*(WK_TALWIDTH-WK_PREWIDTH)/5 +#define BK_FWIDTH 7*(WK_TALWIDTH-WK_PREWIDTH)/5 +#define BK_PRELEN 3. +#define BK_HEIGHT 1.5 +#define BK_BOTTOM 0.5 +#define BK_DBOTTOM 1. +class qmpVirtualPiano3D +{ + private: + smEntity3D *wkcf,*wkeb,*wkd,*wkg,*wka,*bk; + void buildKeys(); + double traveld[128]; + public: + qmpVirtualPiano3D(); + ~qmpVirtualPiano3D(); + void render(smvec3d p); + void setKeyTravelDist(int k,double td); +}; +#endif // QMPVIRTUALPIANO3D_H |