Initial refactoring of the scroll stuff.
[epichord.git] / src / arranger.h
blob653cd8189e747c517ddd0da8abc0fefd5f2b4a29
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 arranger_h
24 #define arranger_h
26 class Arranger : public fltk::Widget {
28 int maxt;
30 int fakeh;
31 int fakew;
33 int insert_flag;
34 int insert_torig;
35 int insert_toffset;
36 int insert_track;
37 int new_default_w;
39 int box_flag;
40 int box_x1;
41 int box_y1;
42 int box_x2;
43 int box_y2;
44 int box_t1;
45 int box_t2;
46 int box_k1;
47 int box_k2;
49 int move_flag;
50 int move_korig;
51 int move_torig;
52 int move_koffset;
53 int move_toffset;
54 int move_x;
55 int move_y;
56 int move_w;
57 int move_offset;
59 seqpat* 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;
69 int paste_flag;
70 int paste_t;
71 int paste_track;
74 seqpat* main_sel;
75 seqpat* delete_sel;
76 int sel_timer;
78 seqpat* over_seqpat();
79 int over_rhandle(seqpat* s, int X, int Y);
80 int over_lhandle(seqpat* s, int X, int Y);
82 int tick2xpix(int tick);
83 int xpix2tick(int xpix);
84 int quantize(int xpix);
86 int delete_flag;
88 float color_h;
89 float color_v;
90 pattern* color_sel;
91 int color_orig_x;
92 int color_orig_y;
93 float color_orig_h;
94 float color_orig_v;
96 void get_outline_color(seqpat* s, fltk::Color* c1, fltk::Color* c2, fltk::Color* c3, fltk::Color* cx);
98 void unselect_all();
100 void apply_box();
101 void apply_delete();
102 void apply_move();
103 void apply_paste();
104 void apply_rresize();
105 void apply_lresize();
106 void apply_insert();
108 int check_move_safety();
109 int check_insert_safety();
110 int check_resize_safety();
111 int check_paste_safety();
113 int scrollx;
114 int scrolly;
116 public:
118 int zoom;
119 int zoom_n;
121 int color_flag;
123 int q_tick;
125 Arranger(int x, int y, int w, int h, const char* label);
126 int handle(int event);
127 void draw();
129 void update(int pos);
131 //void layout();
133 void reset_handle(){last_handle==NULL;}
135 void scrollTo(int X, int Y);
139 #endif