-
Notifications
You must be signed in to change notification settings - Fork 0
/
melodyedit.h
33 lines (24 loc) · 1.08 KB
/
melodyedit.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
class Song;
struct Syllable;
class MelodyEditor:public Gtk::Widget {
public:
MelodyEditor(Song&);
protected:
void get_preferred_width_vfunc(int& minimum_width, int& natural_width) const override;
void get_preferred_height_for_width_vfunc(int width, int& minimum_height, int& natural_height) const override;
void get_preferred_height_vfunc(int& minimum_height, int& natural_height) const override;
void get_preferred_width_for_height_vfunc(int height, int& minimum_width, int& natural_width) const override;
void on_size_allocate(Gtk::Allocation& allocation) override;
void on_realize() override;
bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr) override;
bool on_motion_notify_event(GdkEventMotion* event) override;
bool on_button_press_event(GdkEventButton* event) override;
bool on_key_press_event(GdkEventKey* event) override;
private:
Glib::RefPtr<Gdk::Window> m_refGdkWindow;
Song& song;
Syllable* highlighted_syllable=nullptr;
int highlighted_note=-1;
int scalex=8;
int scaley=16;
};