Fixed problematic, wrong jack transport things.
[epichord.git] / src / pianoroll.h
blob7de40d9642957225df393bc5dc9bfebec02eecbb
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 trip_flag;
86 int zoom_n;
87 int zoom;
89 void get_event_color(mevent* e, fltk::Color* c1, fltk::Color* c2, fltk::Color* c3);
91 void unselect_all();
93 void apply_box();
94 void apply_delete();
95 void apply_move();
96 void apply_paste();
97 void apply_rresize();
98 void apply_lresize();
99 void apply_insert();
101 int over_lhandle(mevent* e);
102 int over_rhandle(mevent* e);
104 public:
106 int tick2xpix(int time);
107 int xpix2tick(int xpix);
108 int quantize(int tick);
110 seqpat* cur_seqpat;
111 track* cur_track;
114 PianoRoll(int x, int y, int w, int h, const char* label);
115 int handle(int event);
116 void draw();
118 void load(seqpat* s);
120 mevent* over_note();
123 void set_zoom(int z);
124 void set_qtick(int q){q_tick=q;}
125 void set_trip(int v){trip_flag=v;}
127 void update(int pos);
129 void layout();
131 int fakeh;
132 int scrollx;
133 int scrolly;
135 int fakehmin;
137 void scrollTo(int X, int Y);
140 #endif