Initial refactoring of the scroll stuff.
[epichord.git] / src / ui.cpp
blobd861696794a0f62354bc41c9127f234b424b8ffd
1 // generated by Fast Light User Interface Designer (fluid) version 2.1000
3 #include "ui.h"
4 /*
5 Epichord - a midi sequencer
6 Copyright (C) 2008 Evan Rinehart
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to
21 The Free Software Foundation, Inc.
22 51 Franklin Street, Fifth Floor
23 Boston, MA 02110-1301, USA
25 #include <stdlib.h>
26 #include <fltk/events.h>
27 #include <fltk/file_chooser.h>
28 #include "backend.h"
29 #include "util.h"
30 #include "uihelper.h"
31 #include "config.h"
32 extern UI* ui;
34 inline void UI::cb_main_window_i(fltk::Window* o, void*) {
35 config_window->hide();
36 help_window->hide();
37 action_window->hide();
38 scope_window->hide();
39 o->hide();
41 save_config();
43 void UI::cb_main_window(fltk::Window* o, void* v) {
44 ((UI*)(o->user_data()))->cb_main_window_i(o,v);
47 inline void UI::cb_line_i(fltk::Button*, void*) {
48 ui->track_info->toggle_controls();
50 void UI::cb_line(fltk::Button* o, void* v) {
51 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_line_i(o,v);
54 inline void UI::cb_event_menu_button_i(fltk::Button* o, void*) {
55 if(o->state()==0){
56 ui->event_menu->hide();
57 ui->event_edit->show();
59 else{
60 ui->event_edit->hide();
61 ui->event_edit->recount_has();
62 ui->event_menu->show();
65 void UI::cb_event_menu_button(fltk::Button* o, void* v) {
66 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_event_menu_button_i(o,v);
69 inline void UI::cb_L_i(fltk::Button* o, void*) {
70 ui->event_edit->label_flag = o->state();
71 ui->event_edit->redraw();
73 void UI::cb_L(fltk::Button* o, void* v) {
74 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_L_i(o,v);
77 inline void UI::cb_C_i(fltk::Button*, void*) {
78 ui->event_edit->clear_events();
80 void UI::cb_C(fltk::Button* o, void* v) {
81 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_C_i(o,v);
84 inline void UI::cb_X_i(fltk::Button*, void*) {
85 ui->event_edit->clear_non_note_events();
87 void UI::cb_X(fltk::Button* o, void* v) {
88 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_X_i(o,v);
91 inline void UI::cb_Z_i(fltk::Button*, void*) {
92 ui->event_edit->clear_all_events();
94 void UI::cb_Z(fltk::Button* o, void* v) {
95 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_Z_i(o,v);
98 inline void UI::cb__i(fltk::Button*, void*) {
99 show_song_edit();
101 void UI::cb_(fltk::Button* o, void* v) {
102 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb__i(o,v);
105 inline void UI::cb_play_button_i(fltk::Button*, void*) {
106 press_play();
108 void UI::cb_play_button(fltk::Button* o, void* v) {
109 ((UI*)(o->parent()->parent()->user_data()))->cb_play_button_i(o,v);
112 inline void UI::cb_stop_button_i(fltk::Button*, void*) {
113 press_stop();
115 void UI::cb_stop_button(fltk::Button* o, void* v) {
116 ((UI*)(o->parent()->parent()->user_data()))->cb_stop_button_i(o,v);
119 inline void UI::cb_record_button_i(fltk::Button*, void*) {
120 toggle_backend_recording();
122 void UI::cb_record_button(fltk::Button* o, void* v) {
123 ((UI*)(o->parent()->parent()->user_data()))->cb_record_button_i(o,v);
126 inline void UI::cb_qbutton4_i(fltk::Button*, void*) {
127 set_quant(4);
129 void UI::cb_qbutton4(fltk::Button* o, void* v) {
130 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton4_i(o,v);
133 inline void UI::cb_qbutton8_i(fltk::Button*, void*) {
134 set_quant(8);
136 void UI::cb_qbutton8(fltk::Button* o, void* v) {
137 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton8_i(o,v);
140 inline void UI::cb_qbutton16_i(fltk::Button*, void*) {
141 set_quant(16);
143 void UI::cb_qbutton16(fltk::Button* o, void* v) {
144 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton16_i(o,v);
147 inline void UI::cb_qbutton32_i(fltk::Button*, void*) {
148 set_quant(32);
150 void UI::cb_qbutton32(fltk::Button* o, void* v) {
151 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton32_i(o,v);
154 inline void UI::cb_qbutton64_i(fltk::Button*, void*) {
155 set_quant(64);
157 void UI::cb_qbutton64(fltk::Button* o, void* v) {
158 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton64_i(o,v);
161 inline void UI::cb_qbutton128_i(fltk::Button*, void*) {
162 set_quant(128);
164 void UI::cb_qbutton128(fltk::Button* o, void* v) {
165 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton128_i(o,v);
168 inline void UI::cb_qbutton0_i(fltk::Button*, void*) {
169 set_quant(0);
171 void UI::cb_qbutton0(fltk::Button* o, void* v) {
172 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton0_i(o,v);
175 inline void UI::cb_tool_button_i(fltk::Button*, void*) {
176 toggle_tool();
178 void UI::cb_tool_button(fltk::Button* o, void* v) {
179 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_tool_button_i(o,v);
182 inline void UI::cb_color_toggle_i(fltk::Button* o, void*) {
183 arranger->color_flag = o->state();
185 void UI::cb_color_toggle(fltk::Button* o, void* v) {
186 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_color_toggle_i(o,v);
189 inline void UI::cb_loop_toggle_i(fltk::Button*, void*) {
190 toggle_loop();
192 void UI::cb_loop_toggle(fltk::Button* o, void* v) {
193 ((UI*)(o->parent()->parent()->user_data()))->cb_loop_toggle_i(o,v);
196 inline void UI::cb_config_button_i(fltk::Button* o, void*) {
197 if(o->state()){
198 ui->config_window->show();
200 else{
201 ui->config_window->hide();
204 void UI::cb_config_button(fltk::Button* o, void* v) {
205 ((UI*)(o->parent()->parent()->user_data()))->cb_config_button_i(o,v);
208 inline void UI::cb_scope_button_i(fltk::Button* o, void*) {
209 if(o->state()){
210 ui->scope_window->show();
212 else{
213 ui->scope_window->hide();
216 void UI::cb_scope_button(fltk::Button* o, void* v) {
217 ((UI*)(o->parent()->parent()->user_data()))->cb_scope_button_i(o,v);
220 inline void UI::cb_file_button_i(fltk::Button* o, void*) {
221 if(o->state()){
222 ui->action_window->show();
224 else{
225 ui->action_window->hide();
228 void UI::cb_file_button(fltk::Button* o, void* v) {
229 ((UI*)(o->parent()->parent()->user_data()))->cb_file_button_i(o,v);
232 inline void UI::cb_help_button_i(fltk::Button* o, void*) {
233 if(o->state()){
234 ui->help_window->show();
236 else{
237 ui->help_window->hide();
240 void UI::cb_help_button(fltk::Button* o, void* v) {
241 ((UI*)(o->parent()->parent()->user_data()))->cb_help_button_i(o,v);
244 inline void UI::cb_beats_per_measure_i(fltk::ValueInput* o, void*) {
245 if(o->value() > o->maximum())
246 o->value(o->maximum());
247 if(o->value() < o->minimum())
248 o->value(o->minimum());
249 set_beats_per_measure((int)o->value());
251 void UI::cb_beats_per_measure(fltk::ValueInput* o, void* v) {
252 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_beats_per_measure_i(o,v);
255 inline void UI::cb_measures_per_phrase_i(fltk::ValueInput* o, void*) {
256 if(o->value() > o->maximum())
257 o->value(o->maximum());
258 if(o->value() < o->minimum())
259 o->value(o->minimum());
260 set_measures_per_phrase((int)o->value());
262 void UI::cb_measures_per_phrase(fltk::ValueInput* o, void* v) {
263 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_measures_per_phrase_i(o,v);
266 inline void UI::cb_bpm_wheel_i(fltk::ThumbWheel* o, void*) {
267 set_bpm((int)o->value());
268 ui->bpm_output->value(o->value());
270 void UI::cb_bpm_wheel(fltk::ThumbWheel* o, void* v) {
271 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_bpm_wheel_i(o,v);
274 inline void UI::cb_measures_until_record_i(fltk::ValueInput* o, void*) {
275 if(o->value() > o->maximum())
276 o->value(o->maximum());
277 if(o->value() < o->minimum())
278 o->value(o->minimum());
279 set_measures_until_record((int)o->value());
281 void UI::cb_measures_until_record(fltk::ValueInput* o, void* v) {
282 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_measures_until_record_i(o,v);
285 inline void UI::cb_check_alwayscopy_i(fltk::CheckButton* o, void*) {
286 set_alwayscopy(o->value());
288 void UI::cb_check_alwayscopy(fltk::CheckButton* o, void* v) {
289 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_alwayscopy_i(o,v);
292 inline void UI::cb_check_autotrackname_i(fltk::CheckButton* o, void*) {
293 set_autotrackname(o->value());
295 void UI::cb_check_autotrackname(fltk::CheckButton* o, void* v) {
296 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_autotrackname_i(o,v);
299 inline void UI::cb_check_passthru_i(fltk::CheckButton* o, void*) {
300 set_passthru(o->value());
302 void UI::cb_check_passthru(fltk::CheckButton* o, void* v) {
303 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_passthru_i(o,v);
306 inline void UI::cb_check_playinsert_i(fltk::CheckButton* o, void*) {
307 set_playinsert(o->value());
309 void UI::cb_check_playinsert(fltk::CheckButton* o, void* v) {
310 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_playinsert_i(o,v);
313 inline void UI::cb_check_recordonchan_i(fltk::CheckButton* o, void*) {
314 set_recordonchan(o->value());
316 void UI::cb_check_recordonchan(fltk::CheckButton* o, void* v) {
317 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_recordonchan_i(o,v);
320 inline void UI::cb_check_playmove_i(fltk::CheckButton* o, void*) {
321 set_playmove(o->value());
323 void UI::cb_check_playmove(fltk::CheckButton* o, void* v) {
324 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_playmove_i(o,v);
327 inline void UI::cb_check_follow_i(fltk::CheckButton* o, void*) {
328 set_follow(o->value());
330 void UI::cb_check_follow(fltk::CheckButton* o, void* v) {
331 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_follow_i(o,v);
334 inline void UI::cb_default_velocity_i(fltk::ValueInput* o, void*) {
335 if(o->value() > o->maximum())
336 o->value(o->maximum());
337 if(o->value() < o->minimum())
338 o->value(o->minimum());
339 set_defaultvelocity((int)o->value());
341 void UI::cb_default_velocity(fltk::ValueInput* o, void* v) {
342 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_default_velocity_i(o,v);
345 inline void UI::cb_merge_i(fltk::Item*, void*) {
346 set_recordmode(0);
348 void UI::cb_merge(fltk::Item* o, void* v) {
349 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_merge_i(o,v);
352 inline void UI::cb_overwrite_i(fltk::Item*, void*) {
353 set_recordmode(1);
355 void UI::cb_overwrite(fltk::Item* o, void* v) {
356 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_overwrite_i(o,v);
359 inline void UI::cb_layer_i(fltk::Item*, void*) {
360 set_recordmode(2);
362 void UI::cb_layer(fltk::Item* o, void* v) {
363 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_layer_i(o,v);
366 inline void UI::cb_do_i(fltk::Item*, void*) {
367 set_robmode(0);
369 void UI::cb_do(fltk::Item* o, void* v) {
370 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_do_i(o,v);
373 inline void UI::cb_new_i(fltk::Item*, void*) {
374 set_robmode(1);
376 void UI::cb_new(fltk::Item* o, void* v) {
377 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_new_i(o,v);
380 inline void UI::cb_extend_i(fltk::Item*, void*) {
381 set_robmode(2);
383 void UI::cb_extend(fltk::Item* o, void* v) {
384 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_extend_i(o,v);
387 inline void UI::cb_kg_l10_i(KeyGrabber*, void*) {
390 void UI::cb_kg_l10(KeyGrabber* o, void* v) {
391 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_kg_l10_i(o,v);
394 inline void UI::cb_new1_i(fltk::Button*, void*) {
395 reset_song();
397 void UI::cb_new1(fltk::Button* o, void* v) {
398 ((UI*)(o->parent()->user_data()))->cb_new1_i(o,v);
401 inline void UI::cb_save_i(fltk::Button*, void*) {
402 action_window->hide();
403 save();
405 void UI::cb_save(fltk::Button* o, void* v) {
406 ((UI*)(o->parent()->user_data()))->cb_save_i(o,v);
409 inline void UI::cb_save1_i(fltk::Button*, void*) {
410 action_window->hide();
411 save(fltk::file_chooser("save file",NULL,get_last_dir()));
413 void UI::cb_save1(fltk::Button* o, void* v) {
414 ((UI*)(o->parent()->user_data()))->cb_save1_i(o,v);
417 inline void UI::cb_load_i(fltk::Button*, void*) {
418 action_window->hide();
419 if(load(fltk::file_chooser("open file",NULL,get_last_dir()))<0){
420 reset_song();
423 void UI::cb_load(fltk::Button* o, void* v) {
424 ((UI*)(o->parent()->user_data()))->cb_load_i(o,v);
427 inline void UI::cb_import_i(fltk::Button*, void*) {
428 action_window->hide();
429 if(loadsmf(fltk::file_chooser("import file",NULL,get_last_dir()))<0){
430 reset_song();
433 void UI::cb_import(fltk::Button* o, void* v) {
434 ((UI*)(o->parent()->user_data()))->cb_import_i(o,v);
437 inline void UI::cb_export_i(fltk::Button*, void*) {
438 action_window->hide();
439 savesmf(fltk::file_chooser("export file",NULL,get_last_dir()));
441 void UI::cb_export(fltk::Button* o, void* v) {
442 ((UI*)(o->parent()->user_data()))->cb_export_i(o,v);
445 inline void UI::cb_on_i(fltk::Button* o, void*) {
446 if(o->state()){
447 turnonscope();
449 else{
450 turnoffscope();
453 void UI::cb_on(fltk::Button* o, void* v) {
454 ((UI*)(o->parent()->parent()->user_data()))->cb_on_i(o,v);
457 UI::UI() {
458 fltk::Window* w;
459 {fltk::Window* o = main_window = new fltk::Window(640, 480, "Epichord");
460 o->shortcut(0xff1b);
461 o->callback((fltk::Callback*)cb_main_window, (void*)(this));
462 o->begin();
463 {fltk::Group* o = new fltk::Group(0, 0, 640, 445);
464 o->begin();
465 {fltk::Group* o = song_edit = new fltk::Group(0, 0, 640, 445);
466 o->begin();
467 {fltk::Group* o = new fltk::Group(0, 0, 255, 445);
468 o->set_vertical();
469 o->box(fltk::FLAT_BOX);
470 o->begin();
471 {TrackInfo* o = track_info = new TrackInfo(0, 15, 255, 415, "track info");
472 o->set_vertical();
473 fltk::Group::current()->resizable(o);
475 {fltk::Button* o = new fltk::Button(0, 0, 255, 15, "@line");
476 o->callback((fltk::Callback*)cb_line);
478 o->end();
480 {fltk::Group* o = new fltk::Group(255, 0, 385, 15);
481 o->begin();
482 {Timeline* o = song_timeline = new Timeline(0, 0, 370, 15, "timeline");
483 fltk::Group::current()->resizable(o);
484 o->scale=16;
485 o->label_scale=4;
487 o->end();
489 {fltk::Group* o = song_scrollgroup = new fltk::Group(255, 15, 385, 430);
490 o->set_vertical();
491 o->begin();
492 {Arranger* o = arranger = new Arranger(0, 0, 370, 415, "arranger");
493 o->set_vertical();
494 o->box(fltk::FLAT_BOX);
495 fltk::Group::current()->resizable(o);
497 {fltk::Scrollbar* o = song_vscroll = new fltk::Scrollbar(370, 0, 15, 415);
498 o->set_vertical();
500 song_hscroll = new fltk::Scrollbar(0, 415, 370, 15);
501 o->end();
502 fltk::Group::current()->resizable(o);
504 o->end();
506 {fltk::Group* o = pattern_edit = new fltk::Group(0, 0, 640, 445);
507 o->hide();
508 o->begin();
509 {fltk::Group* o = new fltk::Group(45, 0, 595, 445);
510 o->begin();
511 {fltk::Group* o = new fltk::Group(0, 0, 595, 15);
512 o->begin();
513 {Timeline* o = pattern_timeline = new Timeline(0, 0, 580, 15, "timeline");
514 o->box(fltk::FLAT_BOX);
515 fltk::Group::current()->resizable(o);
516 o->edit_flag = 1;
518 o->end();
520 {fltk::ScrollGroup* o = pattern_scroll = new fltk::ScrollGroup(0, 15, 595, 355);
521 o->box(fltk::FLAT_BOX);
522 o->shortcut(0xff1b);
523 o->when(fltk::WHEN_CHANGED);
524 o->begin();
525 {PianoRoll* o = piano_roll = new PianoRoll(0, 0, 595, 355, "pianoroll");
526 o->box(fltk::FLAT_BOX);
527 fltk::Group::current()->resizable(o);
528 o->resize(960,900);
530 o->end();
531 o->type(fltk::ScrollGroup::BOTH_ALWAYS);
532 fltk::Group::current()->resizable(o);
534 {fltk::Group* o = new fltk::Group(0, 370, 595, 75);
535 o->begin();
536 {EventEdit* o = event_edit = new EventEdit(0, 0, 580, 75, "event editor");
537 o->box(fltk::FLAT_BOX);
538 fltk::Group::current()->resizable(o);
540 {EventMenu* o = event_menu = new EventMenu(0, 0, 580, 75);
541 o->box(fltk::FLAT_BOX);
542 o->hide();
544 {fltk::Button* o = event_menu_button = new fltk::Button(580, 0, 15, 15, "E");
545 o->callback((fltk::Callback*)cb_event_menu_button);
546 o->tooltip("pick event type");
547 o->type(fltk::Button::TOGGLE);
549 {fltk::Button* o = new fltk::Button(580, 15, 15, 15, "L");
550 o->callback((fltk::Callback*)cb_L);
551 o->tooltip("toggle event value labels");
552 o->type(fltk::Button::TOGGLE);
554 {fltk::Button* o = new fltk::Button(580, 30, 15, 15, "C");
555 o->callback((fltk::Callback*)cb_C);
556 o->tooltip("clear these events");
558 {fltk::Button* o = new fltk::Button(580, 45, 15, 15, "X");
559 o->callback((fltk::Callback*)cb_X);
560 o->tooltip("clear all non note events in pattern");
562 {fltk::Button* o = new fltk::Button(580, 60, 15, 15, "Z");
563 o->labelcolor((fltk::Color)0xff000000);
564 o->callback((fltk::Callback*)cb_Z);
565 o->tooltip("clear everything");
567 o->end();
569 o->end();
570 fltk::Group::current()->resizable(o);
572 {fltk::Group* o = new fltk::Group(0, 0, 45, 445);
573 o->begin();
574 new fltk::Button(0, 0, 45, 15, "@line");
575 {fltk::Group* o = new fltk::Group(0, 15, 45, 340);
576 o->set_vertical();
577 o->begin();
578 {TrackSelect* o = track_select = new TrackSelect(0, 35, 45, 305, "track picker");
579 o->set_vertical();
581 {SampleView* o = sample_view = new SampleView(0, 35, 45, 305, "sample names");
582 o->set_vertical();
584 {Keyboard* o = keyboard = new Keyboard(0, 0, 45, 340, "keyboard");
585 o->set_vertical();
587 o->end();
588 fltk::Group::current()->resizable(o);
590 {fltk::Button* o = new fltk::Button(0, 370, 45, 75, "@<-");
591 o->set_vertical();
592 o->callback((fltk::Callback*)cb_);
594 o->end();
596 o->end();
598 o->end();
599 fltk::Group::current()->resizable(o);
601 {fltk::Group* o = new fltk::Group(0, 445, 640, 35);
602 o->box(fltk::UP_BOX);
603 o->begin();
604 {fltk::Button* o = play_button = new fltk::Button(5, 5, 25, 25, "@>");
605 o->labelcolor((fltk::Color)0x800000);
606 o->callback((fltk::Callback*)cb_play_button);
608 {fltk::Button* o = stop_button = new fltk::Button(35, 5, 25, 25, "@square");
609 o->labelcolor((fltk::Color)0x800000);
610 o->callback((fltk::Callback*)cb_stop_button);
612 {fltk::Button* o = record_button = new fltk::Button(65, 5, 25, 25, "@circle");
613 o->labelcolor((fltk::Color)0xff000000);
614 o->callback((fltk::Callback*)cb_record_button);
615 o->type(fltk::Button::TOGGLE);
617 {Metronome* o = metronome = new Metronome(95, 5, 25, 25, "0");
618 o->color((fltk::Color)56);
619 o->labelcolor((fltk::Color)0xffffff00);
621 {fltk::Group* o = new fltk::Group(125, 0, 20, 35);
622 o->set_vertical();
623 fltk::Group::current()->resizable(o);
625 {fltk::Group* o = pattern_buttons = new fltk::Group(145, 5, 310, 25);
626 o->hide();
627 o->begin();
628 {fltk::Button* o = qbutton4 = new fltk::Button(135, 0, 25, 25);
629 o->callback((fltk::Callback*)cb_qbutton4);
630 o->type(fltk::Button::TOGGLE);
632 {fltk::Button* o = qbutton8 = new fltk::Button(160, 0, 25, 25);
633 o->callback((fltk::Callback*)cb_qbutton8);
634 o->type(fltk::Button::TOGGLE);
636 {fltk::Button* o = qbutton16 = new fltk::Button(185, 0, 25, 25);
637 o->callback((fltk::Callback*)cb_qbutton16);
638 o->type(fltk::Button::TOGGLE);
639 o->state(1);
641 {fltk::Button* o = qbutton32 = new fltk::Button(210, 0, 25, 25);
642 o->callback((fltk::Callback*)cb_qbutton32);
643 o->type(fltk::Button::TOGGLE);
645 {fltk::Button* o = qbutton64 = new fltk::Button(235, 0, 25, 25);
646 o->callback((fltk::Callback*)cb_qbutton64);
647 o->type(fltk::Button::TOGGLE);
649 {fltk::Button* o = qbutton128 = new fltk::Button(260, 0, 25, 25);
650 o->callback((fltk::Callback*)cb_qbutton128);
651 o->type(fltk::Button::TOGGLE);
653 {fltk::Button* o = qbutton0 = new fltk::Button(285, 0, 25, 25);
654 o->callback((fltk::Callback*)cb_qbutton0);
655 o->type(fltk::Button::TOGGLE);
657 {fltk::Button* o = quant1_button = new fltk::Button(15, 0, 25, 25, "qua");
658 o->tooltip("quantize selected notes");
660 {fltk::Button* o = quant0_button = new fltk::Button(45, 0, 25, 25, "qu_");
661 o->tooltip("quantize length of selected notes");
663 {fltk::Button* o = tool_button = new fltk::Button(75, 0, 25, 25, "tool");
664 o->callback((fltk::Callback*)cb_tool_button);
666 o->end();
668 {fltk::Group* o = song_buttons = new fltk::Group(340, 5, 115, 25);
669 o->begin();
670 {fltk::Button* o = color_toggle = new fltk::Button(0, 0, 25, 25);
671 o->callback((fltk::Callback*)cb_color_toggle);
672 o->tooltip("color tool");
673 o->type(fltk::Button::TOGGLE);
675 {fltk::Button* o = unclone_button = new fltk::Button(30, 0, 25, 25, "dclo");
676 o->tooltip("unclone selected block");
678 {fltk::Button* o = join_button = new fltk::Button(60, 0, 25, 25, "join");
679 o->tooltip("join selected blocks");
681 {fltk::Button* o = split_button = new fltk::Button(90, 0, 25, 25, "split");
682 o->tooltip("split selected block");
684 o->end();
686 {fltk::Button* o = loop_toggle = new fltk::Button(490, 5, 25, 25);
687 o->callback((fltk::Callback*)cb_loop_toggle);
688 o->tooltip("toggle looping");
689 o->type(fltk::Button::TOGGLE);
691 {fltk::Button* o = config_button = new fltk::Button(520, 5, 25, 25, "conf");
692 o->callback((fltk::Callback*)cb_config_button);
693 o->tooltip("configuration");
694 o->type(fltk::Button::TOGGLE);
696 {fltk::Button* o = scope_button = new fltk::Button(550, 5, 25, 25);
697 o->callback((fltk::Callback*)cb_scope_button);
698 o->tooltip("scope");
699 o->type(fltk::Button::TOGGLE);
701 {fltk::Button* o = file_button = new fltk::Button(580, 5, 25, 25);
702 o->callback((fltk::Callback*)cb_file_button);
703 o->tooltip("disk");
704 o->type(fltk::Button::TOGGLE);
706 {fltk::Button* o = help_button = new fltk::Button(610, 5, 25, 25);
707 o->callback((fltk::Callback*)cb_help_button);
708 o->tooltip("help");
709 o->type(fltk::Button::TOGGLE);
711 o->end();
713 o->end();
714 o->size_range(640,455);
715 o->resize(640,455);
717 {fltk::Window* o = config_window = new fltk::Window(320, 285, "controls");
718 o->shortcut(0xff1b);
719 o->user_data((void*)(this));
720 o->begin();
721 {fltk::TabGroup* o = new fltk::TabGroup(0, 0, 320, 285);
722 o->begin();
723 {fltk::Group* o = new fltk::Group(145, 15, 170, 265, "options");
724 o->begin();
725 {fltk::ValueInput* o = beats_per_measure = new fltk::ValueInput(5, 5, 45, 20, "beats per measure");
726 o->minimum(1);
727 o->maximum(31);
728 o->step(1);
729 o->value(4);
730 o->callback((fltk::Callback*)cb_beats_per_measure);
732 {fltk::ValueInput* o = measures_per_phrase = new fltk::ValueInput(5, 30, 45, 20, "measures per phrase");
733 o->maximum(128);
734 o->step(1);
735 o->value(4);
736 o->callback((fltk::Callback*)cb_measures_per_phrase);
738 {fltk::ValueOutput* o = bpm_output = new fltk::ValueOutput(5, 55, 45, 20, "bpm");
739 o->minimum(1);
740 o->maximum(1000);
741 o->step(1);
742 o->value(120);
744 {fltk::ThumbWheel* o = bpm_wheel = new fltk::ThumbWheel(55, 55, 105, 20);
745 o->minimum(1);
746 o->maximum(1000);
747 o->step(1);
748 o->value(120);
749 o->callback((fltk::Callback*)cb_bpm_wheel);
750 o->align(fltk::ALIGN_LEFT);
752 {fltk::ValueInput* o = measures_until_record = new fltk::ValueInput(5, 80, 45, 20, "measures until record");
753 o->maximum(128);
754 o->step(1);
755 o->value(1);
756 o->callback((fltk::Callback*)cb_measures_until_record);
758 {fltk::CheckButton* o = check_alwayscopy = new fltk::CheckButton(5, 105, 25, 25, "always hard copy");
759 o->callback((fltk::Callback*)cb_check_alwayscopy);
760 o->align(fltk::ALIGN_LEFT);
761 o->tooltip("instead of making a linked clone when you copy a block in the song view.");
763 {fltk::CheckButton* o = check_autotrackname = new fltk::CheckButton(145, 105, 25, 25, "auto track name");
764 o->callback((fltk::Callback*)cb_check_autotrackname);
765 o->align(fltk::ALIGN_LEFT);
766 o->tooltip("Fill in GM instruments for track names when you change the program.");
768 {fltk::CheckButton* o = check_passthru = new fltk::CheckButton(5, 130, 25, 26, "record pass-thru");
769 o->set_flag(fltk::STATE);
770 o->callback((fltk::Callback*)cb_check_passthru);
771 o->align(fltk::ALIGN_LEFT);
772 o->tooltip("Echo midi input to midi output.");
774 {fltk::CheckButton* o = check_playinsert = new fltk::CheckButton(145, 130, 25, 26, "play note insertion");
775 o->set_flag(fltk::STATE);
776 o->callback((fltk::Callback*)cb_check_playinsert);
777 o->align(fltk::ALIGN_LEFT);
778 o->tooltip("Send midi note on when you create notes.");
780 {fltk::CheckButton* o = check_recordonchan = new fltk::CheckButton(5, 155, 25, 25, "record on channel");
781 o->callback((fltk::Callback*)cb_check_recordonchan);
782 o->align(fltk::ALIGN_LEFT);
783 o->tooltip("Record on first track that matches channel of midi input instead of selected \
784 track.");
786 {fltk::CheckButton* o = check_playmove = new fltk::CheckButton(145, 155, 25, 26, "play note move");
787 o->set_flag(fltk::STATE);
788 o->callback((fltk::Callback*)cb_check_playmove);
789 o->align(fltk::ALIGN_LEFT);
790 o->tooltip("Send midi note on when you move notes.");
792 {fltk::CheckButton* o = check_follow = new fltk::CheckButton(5, 179, 25, 26, "follow playback");
793 o->set_flag(fltk::STATE);
794 o->callback((fltk::Callback*)cb_check_follow);
795 o->align(fltk::ALIGN_LEFT);
796 o->tooltip("Auto scroll horizontally when play head leaves viewing area.");
798 {fltk::ValueInput* o = default_velocity = new fltk::ValueInput(120, 180, 45, 20, "default velocity");
799 o->maximum(127);
800 o->step(1);
801 o->value(96);
802 o->callback((fltk::Callback*)cb_default_velocity);
804 {fltk::Choice* o = menu_recordmode = new fltk::Choice(5, 210, 160, 25, "record mode");
805 o->begin();
806 {fltk::Item* o = new fltk::Item("merge");
807 o->callback((fltk::Callback*)cb_merge);
809 {fltk::Item* o = new fltk::Item("overwrite");
810 o->callback((fltk::Callback*)cb_overwrite);
812 {fltk::Item* o = new fltk::Item("layer");
813 o->callback((fltk::Callback*)cb_layer);
815 o->end();
817 {fltk::Choice* o = menu_rob = new fltk::Choice(5, 240, 160, 25, "record outside block");
818 o->begin();
819 {fltk::Item* o = new fltk::Item("do nothing");
820 o->callback((fltk::Callback*)cb_do);
822 {fltk::Item* o = new fltk::Item("new block");
823 o->callback((fltk::Callback*)cb_new);
825 {fltk::Item* o = new fltk::Item("extend block");
826 o->callback((fltk::Callback*)cb_extend);
828 o->end();
830 o->end();
832 {fltk::Group* o = new fltk::Group(0, 15, 320, 270, "keyboard");
833 o->hide();
834 o->begin();
835 {KeyGrabber* o = kg_l0 = new KeyGrabber(35, 5, 45, 15, "C0");
836 o->align(fltk::ALIGN_LEFT);
838 {KeyGrabber* o = kg_l1 = new KeyGrabber(35, 20, 45, 15, "C#0");
839 o->align(fltk::ALIGN_LEFT);
841 {KeyGrabber* o = kg_l2 = new KeyGrabber(35, 35, 45, 15, "D0");
842 o->align(fltk::ALIGN_LEFT);
844 {KeyGrabber* o = kg_l3 = new KeyGrabber(35, 50, 45, 15, "D#0");
845 o->align(fltk::ALIGN_LEFT);
847 {KeyGrabber* o = kg_l4 = new KeyGrabber(35, 65, 45, 15, "E0");
848 o->align(fltk::ALIGN_LEFT);
850 {KeyGrabber* o = kg_l5 = new KeyGrabber(35, 80, 45, 15, "F0");
851 o->align(fltk::ALIGN_LEFT);
853 {KeyGrabber* o = kg_l6 = new KeyGrabber(35, 95, 45, 15, "F#0");
854 o->align(fltk::ALIGN_LEFT);
856 {KeyGrabber* o = kg_l7 = new KeyGrabber(35, 110, 45, 15, "G0");
857 o->align(fltk::ALIGN_LEFT);
859 {KeyGrabber* o = kg_l8 = new KeyGrabber(35, 125, 45, 15, "G#0");
860 o->align(fltk::ALIGN_LEFT);
862 {KeyGrabber* o = kg_l9 = new KeyGrabber(35, 140, 45, 15, "A0");
863 o->align(fltk::ALIGN_LEFT);
865 {KeyGrabber* o = kg_l10 = new KeyGrabber(35, 155, 45, 15, "A#0");
866 o->callback((fltk::Callback*)cb_kg_l10);
867 o->align(fltk::ALIGN_LEFT);
869 {KeyGrabber* o = kg_l11 = new KeyGrabber(35, 170, 45, 15, "B0");
870 o->align(fltk::ALIGN_LEFT);
872 {KeyGrabber* o = kg_l12 = new KeyGrabber(35, 185, 45, 15, "C1");
873 o->align(fltk::ALIGN_LEFT);
875 {KeyGrabber* o = kg_l13 = new KeyGrabber(35, 200, 45, 15, "C#1");
876 o->align(fltk::ALIGN_LEFT);
878 {KeyGrabber* o = kg_l14 = new KeyGrabber(35, 215, 45, 15, "D1");
879 o->align(fltk::ALIGN_LEFT);
881 {KeyGrabber* o = kg_l15 = new KeyGrabber(35, 230, 45, 15, "D#1");
882 o->align(fltk::ALIGN_LEFT);
884 {KeyGrabber* o = kg_l16 = new KeyGrabber(35, 245, 45, 15, "E1");
885 o->align(fltk::ALIGN_LEFT);
887 {KeyGrabber* o = kg_u0 = new KeyGrabber(130, 5, 45, 15, "C1");
888 o->align(fltk::ALIGN_LEFT);
890 {KeyGrabber* o = kg_u1 = new KeyGrabber(130, 20, 45, 15, "C#1");
891 o->align(fltk::ALIGN_LEFT);
893 {KeyGrabber* o = kg_u2 = new KeyGrabber(130, 35, 45, 15, "D1");
894 o->align(fltk::ALIGN_LEFT);
896 {KeyGrabber* o = kg_u3 = new KeyGrabber(130, 50, 45, 15, "D#1");
897 o->align(fltk::ALIGN_LEFT);
899 {KeyGrabber* o = kg_u4 = new KeyGrabber(130, 65, 45, 15, "E1");
900 o->align(fltk::ALIGN_LEFT);
902 {KeyGrabber* o = kg_u5 = new KeyGrabber(130, 80, 45, 15, "F1");
903 o->align(fltk::ALIGN_LEFT);
905 {KeyGrabber* o = kg_u6 = new KeyGrabber(130, 95, 45, 15, "F#1");
906 o->align(fltk::ALIGN_LEFT);
908 {KeyGrabber* o = kg_u7 = new KeyGrabber(130, 110, 45, 15, "G1");
909 o->align(fltk::ALIGN_LEFT);
911 {KeyGrabber* o = kg_u8 = new KeyGrabber(130, 125, 45, 15, "G#1");
912 o->align(fltk::ALIGN_LEFT);
914 {KeyGrabber* o = kg_u9 = new KeyGrabber(130, 140, 45, 15, "A1");
915 o->align(fltk::ALIGN_LEFT);
917 {KeyGrabber* o = kg_u10 = new KeyGrabber(130, 155, 45, 15, "A#1");
918 o->align(fltk::ALIGN_LEFT);
920 {KeyGrabber* o = kg_u11 = new KeyGrabber(130, 170, 45, 15, "B1");
921 o->align(fltk::ALIGN_LEFT);
923 {KeyGrabber* o = kg_u12 = new KeyGrabber(130, 185, 45, 15, "C2");
924 o->align(fltk::ALIGN_LEFT);
926 {KeyGrabber* o = kg_u13 = new KeyGrabber(130, 200, 45, 15, "C#2");
927 o->align(fltk::ALIGN_LEFT);
929 {KeyGrabber* o = kg_u14 = new KeyGrabber(130, 215, 45, 15, "D2");
930 o->align(fltk::ALIGN_LEFT);
932 {KeyGrabber* o = kg_u15 = new KeyGrabber(130, 230, 45, 15, "D#2");
933 o->align(fltk::ALIGN_LEFT);
935 {KeyGrabber* o = kg_u16 = new KeyGrabber(130, 245, 45, 15, "E2");
936 o->align(fltk::ALIGN_LEFT);
938 {KeyGrabber* o = kg_u17 = new KeyGrabber(265, 5, 45, 15, "F2");
939 o->align(fltk::ALIGN_LEFT);
941 {KeyGrabber* o = kg_u18 = new KeyGrabber(265, 20, 45, 15, "F#2");
942 o->align(fltk::ALIGN_LEFT);
944 {KeyGrabber* o = kg_u19 = new KeyGrabber(265, 35, 45, 15, "G2");
945 o->align(fltk::ALIGN_LEFT);
947 {KeyGrabber* o = kg_u20 = new KeyGrabber(265, 50, 45, 15, "G#2");
948 o->align(fltk::ALIGN_LEFT);
950 {KeyGrabber* o = kg_zi = new KeyGrabber(265, 65, 45, 15, "zoom in");
951 o->align(fltk::ALIGN_LEFT);
953 {KeyGrabber* o = kg_zo = new KeyGrabber(265, 80, 45, 15, "zoom out");
954 o->align(fltk::ALIGN_LEFT);
956 {KeyGrabber* o = kg_ou = new KeyGrabber(265, 95, 45, 15, "octave up");
957 o->align(fltk::ALIGN_LEFT);
959 {KeyGrabber* o = kg_od = new KeyGrabber(265, 110, 45, 15, "octave down");
960 o->align(fltk::ALIGN_LEFT);
962 o->end();
964 {fltk::Group* o = new fltk::Group(0, 15, 320, 270, "colors");
965 o->hide();
966 o->begin();
967 new fltk::Button(250, 245, 65, 20, "apply");
968 {fltk::Choice* o = new fltk::Choice(55, 10, 100, 20, "presets");
969 o->begin();
970 new fltk::Item("windo");
971 new fltk::Item("midnight");
972 new fltk::Item("xterm");
973 o->end();
975 o->end();
977 o->end();
979 o->end();
981 {fltk::Window* o = help_window = new fltk::Window(580, 370, "help");
982 o->shortcut(0xff1b);
983 o->user_data((void*)(this));
984 o->begin();
985 {fltk::TabGroup* o = new fltk::TabGroup(0, 0, 580, 370);
986 o->begin();
987 {fltk::Group* o = new fltk::Group(0, 25, 580, 345, "info");
988 o->begin();
989 title_text = new fltk::Input(55, 5, 520, 20, "Title");
990 author_text = new fltk::Input(55, 30, 520, 20, "Author");
991 {fltk::TextEditor* o = info_text = new fltk::TextEditor(5, 55, 570, 285);
992 o->textfont(fltk::COURIER);
993 fltk::Group::current()->resizable(o);
995 o->end();
996 fltk::Group::current()->resizable(o);
998 {fltk::Group* o = new fltk::Group(0, 25, 580, 345, "controls");
999 o->hide();
1000 o->begin();
1001 {fltk::TextDisplay* o = new fltk::TextDisplay(5, 5, 570, 335);
1002 o->textfont(fltk::COURIER);
1003 fltk::Group::current()->resizable(o);
1004 load_text(o,ROOT_DATA_DIR"doc/controls.txt");
1006 o->end();
1008 {fltk::Group* o = new fltk::Group(0, 25, 580, 345, "guide");
1009 o->hide();
1010 o->begin();
1011 {fltk::TextDisplay* o = new fltk::TextDisplay(5, 5, 570, 335);
1012 o->textfont(fltk::COURIER);
1013 fltk::Group::current()->resizable(o);
1014 load_text(o,ROOT_DATA_DIR"doc/guide.txt");
1016 o->end();
1018 {fltk::Group* o = new fltk::Group(0, 25, 580, 345, "license");
1019 o->hide();
1020 o->begin();
1021 {fltk::TextDisplay* o = new fltk::TextDisplay(5, 5, 570, 335);
1022 o->textfont(fltk::COURIER);
1023 fltk::Group::current()->resizable(o);
1024 load_text(o,ROOT_DATA_DIR"doc/license.txt");
1026 o->end();
1028 {fltk::Group* o = new fltk::Group(0, 25, 580, 345, "about");
1029 o->hide();
1030 o->begin();
1031 {fltk::TextDisplay* o = new fltk::TextDisplay(5, 5, 570, 335);
1032 o->textfont(fltk::COURIER);
1033 fltk::Group::current()->resizable(o);
1034 load_text(o,ROOT_DATA_DIR"doc/README");
1036 o->end();
1038 o->end();
1040 o->end();
1041 o->size_range(580,370);
1042 o->resizable(o);
1044 {fltk::Window* o = action_window = new fltk::Window(100, 130, "menu");
1045 o->shortcut(0xff1b);
1046 o->user_data((void*)(this));
1047 o->begin();
1048 {fltk::Button* o = new fltk::Button(5, 5, 90, 20, "new");
1049 o->callback((fltk::Callback*)cb_new1);
1051 {fltk::Button* o = new fltk::Button(5, 25, 90, 20, "save");
1052 o->callback((fltk::Callback*)cb_save);
1054 {fltk::Button* o = new fltk::Button(5, 45, 90, 20, "save as");
1055 o->callback((fltk::Callback*)cb_save1);
1057 {fltk::Button* o = new fltk::Button(5, 65, 90, 20, "load");
1058 o->callback((fltk::Callback*)cb_load);
1060 {fltk::Button* o = new fltk::Button(5, 85, 90, 20, "import");
1061 o->callback((fltk::Callback*)cb_import);
1063 {fltk::Button* o = new fltk::Button(5, 105, 90, 20, "export");
1064 o->callback((fltk::Callback*)cb_export);
1066 o->end();
1068 {fltk::Window* o = scope_window = new fltk::Window(425, 280, "scope");
1069 w = o;
1070 o->shortcut(0xff1b);
1071 o->user_data((void*)(this));
1072 o->begin();
1073 {fltk::TextDisplay* o = scope = new fltk::TextDisplay(5, 5, 415, 245);
1074 o->textfont(fltk::COURIER);
1075 o->color((fltk::Color)0x280000);
1076 o->textcolor((fltk::Color)0xff0000);
1077 o->wrap_mode(1);
1079 {fltk::Group* o = new fltk::Group(5, 255, 410, 20);
1080 o->begin();
1081 {fltk::Button* o = new fltk::Button(0, 0, 40, 20, "on");
1082 o->callback((fltk::Callback*)cb_on);
1083 o->type(fltk::Button::TOGGLE);
1085 {fltk::InvisibleBox* o = new fltk::InvisibleBox(45, 0, 95, 20);
1086 fltk::Group::current()->resizable(o);
1088 o->end();
1090 o->end();
1091 o->resizable(o);
1093 loop_toggle->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/loop.gif"));
1094 color_toggle->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/color.gif"));
1095 scope_button->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/conf.gif"));
1096 file_button->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/file.gif"));
1097 help_button->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/help.gif"));
1099 qbutton4->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q4.gif"));
1100 qbutton8->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q8.gif"));
1101 qbutton16->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q16.gif"));
1102 qbutton32->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q32.gif"));
1103 qbutton64->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q64.gif"));
1104 qbutton128->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q128.gif"));
1105 qbutton0->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q0.gif"));
1106 track_info->set_rec(0);
1107 start_monitor();
1108 main_window->show();