Restored pattern editor functionality.
[epichord.git] / src / pianoroll.h
blob282019e6844a3a33a75c9458196f3a46150da906
1 /*
2 Epichord - a midi sequencer
3 Copyright (C) 2008 Evan Rinehart
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to
18 The Free Software Foundation, Inc.
19 51 Franklin Street, Fifth Floor
20 Boston, MA 02110-1301, USA
23 #ifndef pianoroll_h
24 #define pianoroll_h
27 class PianoRoll : public fltk::Widget {
31 int wkeyh;
32 int bkeyh;
34 int last_note;
36 int insert_flag;
37 int insert_torig;
38 int insert_toffset;
39 int insert_note;
41 int move_flag;
42 int move_torig;
43 int move_toffset;
44 int move_norig;
45 int move_noffset;
46 int move_offset;
47 int move_qoffset;
49 int box_flag;
50 int box_x1;
51 int box_y1;
52 int box_x2;
53 int box_y2;
54 int box_t1;
55 int box_t2;
56 int box_n1;
57 int box_n2;
59 mevent* last_handle;
60 int rresize_flag;
61 int rresize_torig;
62 int rresize_toffset;
64 int lresize_flag;
65 int lresize_torig;
66 int lresize_toffset;
68 mevent* resize_e;
69 int resize_arrow;
70 int resize_redraw;
71 int resize_x;
72 int resize_y;
73 fltk::Color resize_arrow_color;
74 int resize_handle_width;
76 int q_tick;
78 int note2ypix(int note);
82 int delete_flag;
84 int zoom_n;
85 int zoom;
87 void get_event_color(mevent* e, fltk::Color* c1, fltk::Color* c2, fltk::Color* c3);
89 void unselect_all();
91 void apply_box();
92 void apply_delete();
93 void apply_move();
94 void apply_paste();
95 void apply_rresize();
96 void apply_lresize();
97 void apply_insert();
99 int over_lhandle(mevent* e);
100 int over_rhandle(mevent* e);
102 public:
104 int tick2xpix(int time);
105 int xpix2tick(int xpix);
106 int quantize(int tick);
108 seqpat* cur_seqpat;
109 track* cur_track;
112 PianoRoll(int x, int y, int w, int h, const char* label);
113 int handle(int event);
114 void draw();
116 void load(seqpat* s);
118 mevent* over_note();
121 void set_zoom(int z);
122 void set_qtick(int q){q_tick=q;}
124 void update(int pos);
127 int fakeh;
128 int scrollx;
129 int scrolly;
131 int fakehmin;
133 void scrollTo(int X, int Y);
136 #endif