-
Notifications
You must be signed in to change notification settings - Fork 0
/
Flw_Piano.h
58 lines (44 loc) · 1.18 KB
/
Flw_Piano.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright Jean Pierre Cimalando 2018.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#if !defined(FLW_PIANO_H)
#define FLW_PIANO_H
#include <FL/Fl_Group.H>
#include <memory>
#if __cplusplus < 201103L && !defined(override)
#define override
#endif
class Flw_Piano : public Fl_Group {
public:
Flw_Piano(int x, int y, int w, int h);
~Flw_Piano();
const Fl_Color *key_color() const;
void key_color(Fl_Color wh, Fl_Color bl);
const Fl_Boxtype *key_box() const;
void key_box(Fl_Boxtype wh, Fl_Boxtype bl);
unsigned key_count() const;
void key_count(unsigned nkeys);
int key_value(unsigned key) const;
void key_value(unsigned key, int value);
bool press_key(unsigned key);
bool release_key(unsigned key);
void draw() override;
public:
struct Impl;
private:
#if __cplusplus >= 201103L
const std::unique_ptr<Impl> P;
#else
const std::auto_ptr<Impl> P;
#endif
};
enum Piano_Event {
PIANO_PRESS,
PIANO_RELEASE,
};
namespace Piano {
Piano_Event event();
unsigned key();
}
#endif // !defined(FLW_PIANO_H)