Updated TODO.
[epichord.git] / src / pianoroll.h
blobb6737f10890517fd86963d11ecd1d9138203f6f6
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 {
29 int xp_last;
30 int yp_last;
32 int wkeyh;
33 int bkeyh;
35 int last_note;
37 int insert_flag;
38 int insert_torig;
39 int insert_toffset;
40 int insert_note;
42 int move_flag;
43 int move_torig;
44 int move_toffset;
45 int move_norig;
46 int move_noffset;
47 int move_offset;
48 int move_qoffset;
50 int box_flag;
51 int box_x1;
52 int box_y1;
53 int box_x2;
54 int box_y2;
55 int box_t1;
56 int box_t2;
57 int box_n1;
58 int box_n2;
60 mevent* last_handle;
61 int rresize_flag;
62 int rresize_torig;
63 int rresize_toffset;
65 int lresize_flag;
66 int lresize_torig;
67 int lresize_toffset;
69 mevent* resize_e;
70 int resize_arrow;
71 int resize_redraw;
72 int resize_x;
73 int resize_y;
74 fltk::Color resize_arrow_color;
75 int resize_handle_width;
77 int q_tick;
79 int note2ypix(int note);
83 int delete_flag;
85 int zoom_n;
86 int zoom;
88 void get_event_color(mevent* e, fltk::Color* c1, fltk::Color* c2, fltk::Color* c3);
90 void unselect_all();
92 void apply_box();
93 void apply_delete();
94 void apply_move();
95 void apply_paste();
96 void apply_rresize();
97 void apply_lresize();
98 void apply_insert();
100 int over_lhandle(mevent* e, int X, int Y);
101 int over_rhandle(mevent* e, int X, int Y);
103 public:
105 int tick2xpix(int time);
106 int xpix2tick(int xpix);
107 int quantize(int tick);
109 seqpat* cur_seqpat;
110 track* cur_track;
113 PianoRoll(int x, int y, int w, int h, const char* label);
114 int handle(int event);
115 void draw();
116 void layout();
118 void load(seqpat* s);
120 mevent* over_note();
123 void set_zoom(int z);
124 void set_qtick(int q){q_tick=q;}
126 void update(int pos);
129 #endif