Restored pattern editor functionality.
[epichord.git] / src / ui.cpp
blob96d3905ce8f45f7328a29a636b4316f2db4d5ba3
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_song_vscroll_i(fltk::Scrollbar* o, void*) {
55 int target = (int)o->value();
56 int dummy = ui->arranger->scrollx;
57 ui->arranger->scrollTo(dummy,target);
59 void UI::cb_song_vscroll(fltk::Scrollbar* o, void* v) {
60 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_song_vscroll_i(o,v);
63 inline void UI::cb_song_hscroll_i(fltk::ThumbWheel* o, void*) {
64 ui->arranger->scrollTo((int)o->value(),ui->arranger->scrolly);
66 void UI::cb_song_hscroll(fltk::ThumbWheel* o, void* v) {
67 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_song_hscroll_i(o,v);
70 inline void UI::cb_pattern_vscroll_i(fltk::Scrollbar* o, void*) {
71 int target = (int)o->value();
72 int dummy = ui->piano_roll->scrollx;
73 ui->piano_roll->scrollTo(dummy,target);
75 void UI::cb_pattern_vscroll(fltk::Scrollbar* o, void* v) {
76 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_pattern_vscroll_i(o,v);
79 inline void UI::cb_pattern_hscroll_i(fltk::ThumbWheel* o, void*) {
80 ui->piano_roll->scrollTo((int)o->value(),ui->piano_roll->scrolly);
82 void UI::cb_pattern_hscroll(fltk::ThumbWheel* o, void* v) {
83 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_pattern_hscroll_i(o,v);
86 inline void UI::cb_event_menu_button_i(fltk::Button* o, void*) {
87 if(o->state()==0){
88 ui->event_menu->hide();
89 ui->event_edit->show();
91 else{
92 ui->event_edit->hide();
93 ui->event_edit->recount_has();
94 ui->event_menu->show();
97 void UI::cb_event_menu_button(fltk::Button* o, void* v) {
98 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_event_menu_button_i(o,v);
101 inline void UI::cb_L_i(fltk::Button* o, void*) {
102 ui->event_edit->label_flag = o->state();
103 ui->event_edit->redraw();
105 void UI::cb_L(fltk::Button* o, void* v) {
106 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_L_i(o,v);
109 inline void UI::cb_C_i(fltk::Button*, void*) {
110 ui->event_edit->clear_events();
112 void UI::cb_C(fltk::Button* o, void* v) {
113 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_C_i(o,v);
116 inline void UI::cb_X_i(fltk::Button*, void*) {
117 ui->event_edit->clear_non_note_events();
119 void UI::cb_X(fltk::Button* o, void* v) {
120 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_X_i(o,v);
123 inline void UI::cb_Z_i(fltk::Button*, void*) {
124 ui->event_edit->clear_all_events();
126 void UI::cb_Z(fltk::Button* o, void* v) {
127 ((UI*)(o->parent()->parent()->parent()->parent()->parent()->user_data()))->cb_Z_i(o,v);
130 inline void UI::cb__i(fltk::Button*, void*) {
131 show_song_edit();
133 void UI::cb_(fltk::Button* o, void* v) {
134 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb__i(o,v);
137 inline void UI::cb_play_button_i(fltk::Button*, void*) {
138 press_play();
140 void UI::cb_play_button(fltk::Button* o, void* v) {
141 ((UI*)(o->parent()->parent()->user_data()))->cb_play_button_i(o,v);
144 inline void UI::cb_stop_button_i(fltk::Button*, void*) {
145 press_stop();
147 void UI::cb_stop_button(fltk::Button* o, void* v) {
148 ((UI*)(o->parent()->parent()->user_data()))->cb_stop_button_i(o,v);
151 inline void UI::cb_record_button_i(fltk::Button*, void*) {
152 toggle_backend_recording();
154 void UI::cb_record_button(fltk::Button* o, void* v) {
155 ((UI*)(o->parent()->parent()->user_data()))->cb_record_button_i(o,v);
158 inline void UI::cb_qbutton4_i(fltk::Button*, void*) {
159 set_quant(4);
161 void UI::cb_qbutton4(fltk::Button* o, void* v) {
162 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton4_i(o,v);
165 inline void UI::cb_qbutton8_i(fltk::Button*, void*) {
166 set_quant(8);
168 void UI::cb_qbutton8(fltk::Button* o, void* v) {
169 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton8_i(o,v);
172 inline void UI::cb_qbutton16_i(fltk::Button*, void*) {
173 set_quant(16);
175 void UI::cb_qbutton16(fltk::Button* o, void* v) {
176 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton16_i(o,v);
179 inline void UI::cb_qbutton32_i(fltk::Button*, void*) {
180 set_quant(32);
182 void UI::cb_qbutton32(fltk::Button* o, void* v) {
183 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton32_i(o,v);
186 inline void UI::cb_qbutton64_i(fltk::Button*, void*) {
187 set_quant(64);
189 void UI::cb_qbutton64(fltk::Button* o, void* v) {
190 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton64_i(o,v);
193 inline void UI::cb_qbutton128_i(fltk::Button*, void*) {
194 set_quant(128);
196 void UI::cb_qbutton128(fltk::Button* o, void* v) {
197 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton128_i(o,v);
200 inline void UI::cb_qbutton0_i(fltk::Button*, void*) {
201 set_quant(0);
203 void UI::cb_qbutton0(fltk::Button* o, void* v) {
204 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_qbutton0_i(o,v);
207 inline void UI::cb_tool_button_i(fltk::Button*, void*) {
208 toggle_tool();
210 void UI::cb_tool_button(fltk::Button* o, void* v) {
211 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_tool_button_i(o,v);
214 inline void UI::cb_color_toggle_i(fltk::Button* o, void*) {
215 arranger->color_flag = o->state();
217 void UI::cb_color_toggle(fltk::Button* o, void* v) {
218 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_color_toggle_i(o,v);
221 inline void UI::cb_loop_toggle_i(fltk::Button*, void*) {
222 toggle_loop();
224 void UI::cb_loop_toggle(fltk::Button* o, void* v) {
225 ((UI*)(o->parent()->parent()->user_data()))->cb_loop_toggle_i(o,v);
228 inline void UI::cb_config_button_i(fltk::Button* o, void*) {
229 if(o->state()){
230 ui->config_window->show();
232 else{
233 ui->config_window->hide();
236 void UI::cb_config_button(fltk::Button* o, void* v) {
237 ((UI*)(o->parent()->parent()->user_data()))->cb_config_button_i(o,v);
240 inline void UI::cb_scope_button_i(fltk::Button* o, void*) {
241 if(o->state()){
242 ui->scope_window->show();
244 else{
245 ui->scope_window->hide();
248 void UI::cb_scope_button(fltk::Button* o, void* v) {
249 ((UI*)(o->parent()->parent()->user_data()))->cb_scope_button_i(o,v);
252 inline void UI::cb_file_button_i(fltk::Button* o, void*) {
253 if(o->state()){
254 ui->action_window->show();
256 else{
257 ui->action_window->hide();
260 void UI::cb_file_button(fltk::Button* o, void* v) {
261 ((UI*)(o->parent()->parent()->user_data()))->cb_file_button_i(o,v);
264 inline void UI::cb_help_button_i(fltk::Button* o, void*) {
265 if(o->state()){
266 ui->help_window->show();
268 else{
269 ui->help_window->hide();
272 void UI::cb_help_button(fltk::Button* o, void* v) {
273 ((UI*)(o->parent()->parent()->user_data()))->cb_help_button_i(o,v);
276 inline void UI::cb_beats_per_measure_i(fltk::ValueInput* o, void*) {
277 if(o->value() > o->maximum())
278 o->value(o->maximum());
279 if(o->value() < o->minimum())
280 o->value(o->minimum());
281 set_beats_per_measure((int)o->value());
283 void UI::cb_beats_per_measure(fltk::ValueInput* o, void* v) {
284 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_beats_per_measure_i(o,v);
287 inline void UI::cb_measures_per_phrase_i(fltk::ValueInput* o, void*) {
288 if(o->value() > o->maximum())
289 o->value(o->maximum());
290 if(o->value() < o->minimum())
291 o->value(o->minimum());
292 set_measures_per_phrase((int)o->value());
294 void UI::cb_measures_per_phrase(fltk::ValueInput* o, void* v) {
295 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_measures_per_phrase_i(o,v);
298 inline void UI::cb_bpm_wheel_i(fltk::ThumbWheel* o, void*) {
299 set_bpm((int)o->value());
300 ui->bpm_output->value(o->value());
302 void UI::cb_bpm_wheel(fltk::ThumbWheel* o, void* v) {
303 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_bpm_wheel_i(o,v);
306 inline void UI::cb_measures_until_record_i(fltk::ValueInput* o, void*) {
307 if(o->value() > o->maximum())
308 o->value(o->maximum());
309 if(o->value() < o->minimum())
310 o->value(o->minimum());
311 set_measures_until_record((int)o->value());
313 void UI::cb_measures_until_record(fltk::ValueInput* o, void* v) {
314 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_measures_until_record_i(o,v);
317 inline void UI::cb_check_alwayscopy_i(fltk::CheckButton* o, void*) {
318 set_alwayscopy(o->value());
320 void UI::cb_check_alwayscopy(fltk::CheckButton* o, void* v) {
321 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_alwayscopy_i(o,v);
324 inline void UI::cb_check_autotrackname_i(fltk::CheckButton* o, void*) {
325 set_autotrackname(o->value());
327 void UI::cb_check_autotrackname(fltk::CheckButton* o, void* v) {
328 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_autotrackname_i(o,v);
331 inline void UI::cb_check_passthru_i(fltk::CheckButton* o, void*) {
332 set_passthru(o->value());
334 void UI::cb_check_passthru(fltk::CheckButton* o, void* v) {
335 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_passthru_i(o,v);
338 inline void UI::cb_check_playinsert_i(fltk::CheckButton* o, void*) {
339 set_playinsert(o->value());
341 void UI::cb_check_playinsert(fltk::CheckButton* o, void* v) {
342 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_playinsert_i(o,v);
345 inline void UI::cb_check_recordonchan_i(fltk::CheckButton* o, void*) {
346 set_recordonchan(o->value());
348 void UI::cb_check_recordonchan(fltk::CheckButton* o, void* v) {
349 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_recordonchan_i(o,v);
352 inline void UI::cb_check_playmove_i(fltk::CheckButton* o, void*) {
353 set_playmove(o->value());
355 void UI::cb_check_playmove(fltk::CheckButton* o, void* v) {
356 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_playmove_i(o,v);
359 inline void UI::cb_check_follow_i(fltk::CheckButton* o, void*) {
360 set_follow(o->value());
362 void UI::cb_check_follow(fltk::CheckButton* o, void* v) {
363 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_check_follow_i(o,v);
366 inline void UI::cb_default_velocity_i(fltk::ValueInput* o, void*) {
367 if(o->value() > o->maximum())
368 o->value(o->maximum());
369 if(o->value() < o->minimum())
370 o->value(o->minimum());
371 set_defaultvelocity((int)o->value());
373 void UI::cb_default_velocity(fltk::ValueInput* o, void* v) {
374 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_default_velocity_i(o,v);
377 inline void UI::cb_merge_i(fltk::Item*, void*) {
378 set_recordmode(0);
380 void UI::cb_merge(fltk::Item* o, void* v) {
381 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_merge_i(o,v);
384 inline void UI::cb_overwrite_i(fltk::Item*, void*) {
385 set_recordmode(1);
387 void UI::cb_overwrite(fltk::Item* o, void* v) {
388 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_overwrite_i(o,v);
391 inline void UI::cb_layer_i(fltk::Item*, void*) {
392 set_recordmode(2);
394 void UI::cb_layer(fltk::Item* o, void* v) {
395 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_layer_i(o,v);
398 inline void UI::cb_do_i(fltk::Item*, void*) {
399 set_robmode(0);
401 void UI::cb_do(fltk::Item* o, void* v) {
402 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_do_i(o,v);
405 inline void UI::cb_new_i(fltk::Item*, void*) {
406 set_robmode(1);
408 void UI::cb_new(fltk::Item* o, void* v) {
409 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_new_i(o,v);
412 inline void UI::cb_extend_i(fltk::Item*, void*) {
413 set_robmode(2);
415 void UI::cb_extend(fltk::Item* o, void* v) {
416 ((UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_extend_i(o,v);
419 inline void UI::cb_kg_l10_i(KeyGrabber*, void*) {
422 void UI::cb_kg_l10(KeyGrabber* o, void* v) {
423 ((UI*)(o->parent()->parent()->parent()->user_data()))->cb_kg_l10_i(o,v);
426 inline void UI::cb_new1_i(fltk::Button*, void*) {
427 reset_song();
429 void UI::cb_new1(fltk::Button* o, void* v) {
430 ((UI*)(o->parent()->user_data()))->cb_new1_i(o,v);
433 inline void UI::cb_save_i(fltk::Button*, void*) {
434 action_window->hide();
435 save();
437 void UI::cb_save(fltk::Button* o, void* v) {
438 ((UI*)(o->parent()->user_data()))->cb_save_i(o,v);
441 inline void UI::cb_save1_i(fltk::Button*, void*) {
442 action_window->hide();
443 save(fltk::file_chooser("save file",NULL,get_last_dir()));
445 void UI::cb_save1(fltk::Button* o, void* v) {
446 ((UI*)(o->parent()->user_data()))->cb_save1_i(o,v);
449 inline void UI::cb_load_i(fltk::Button*, void*) {
450 action_window->hide();
451 if(load(fltk::file_chooser("open file",NULL,get_last_dir()))<0){
452 reset_song();
455 void UI::cb_load(fltk::Button* o, void* v) {
456 ((UI*)(o->parent()->user_data()))->cb_load_i(o,v);
459 inline void UI::cb_import_i(fltk::Button*, void*) {
460 action_window->hide();
461 if(loadsmf(fltk::file_chooser("import file",NULL,get_last_dir()))<0){
462 reset_song();
465 void UI::cb_import(fltk::Button* o, void* v) {
466 ((UI*)(o->parent()->user_data()))->cb_import_i(o,v);
469 inline void UI::cb_export_i(fltk::Button*, void*) {
470 action_window->hide();
471 savesmf(fltk::file_chooser("export file",NULL,get_last_dir()));
473 void UI::cb_export(fltk::Button* o, void* v) {
474 ((UI*)(o->parent()->user_data()))->cb_export_i(o,v);
477 inline void UI::cb_on_i(fltk::Button* o, void*) {
478 if(o->state()){
479 turnonscope();
481 else{
482 turnoffscope();
485 void UI::cb_on(fltk::Button* o, void* v) {
486 ((UI*)(o->parent()->parent()->user_data()))->cb_on_i(o,v);
489 UI::UI() {
490 fltk::Window* w;
491 {fltk::Window* o = main_window = new fltk::Window(640, 480, "Epichord");
492 o->shortcut(0xff1b);
493 o->callback((fltk::Callback*)cb_main_window, (void*)(this));
494 o->begin();
495 {fltk::Group* o = new fltk::Group(0, 0, 640, 445);
496 o->begin();
497 {fltk::Group* o = song_edit = new fltk::Group(0, 0, 640, 445);
498 o->begin();
499 {fltk::Group* o = new fltk::Group(0, 0, 255, 445);
500 o->set_vertical();
501 o->box(fltk::FLAT_BOX);
502 o->begin();
503 {TrackInfo* o = track_info = new TrackInfo(0, 15, 255, 415, "track info");
504 o->set_vertical();
505 fltk::Group::current()->resizable(o);
507 {fltk::Button* o = new fltk::Button(0, 0, 255, 15, "@line");
508 o->callback((fltk::Callback*)cb_line);
510 o->end();
512 {fltk::Group* o = new fltk::Group(255, 0, 385, 15);
513 o->begin();
514 {Timeline* o = song_timeline = new Timeline(0, 0, 370, 15, "timeline");
515 fltk::Group::current()->resizable(o);
516 o->scale=16;
517 o->label_scale=4;
519 o->end();
521 {fltk::Group* o = song_scrollgroup = new fltk::Group(255, 15, 385, 430);
522 o->set_vertical();
523 o->begin();
524 {Arranger* o = arranger = new Arranger(0, 0, 370, 415, "arranger");
525 o->set_vertical();
526 o->box(fltk::FLAT_BOX);
527 fltk::Group::current()->resizable(o);
529 {fltk::Scrollbar* o = song_vscroll = new fltk::Scrollbar(370, 0, 15, 415);
530 o->set_vertical();
531 o->slider_size(60);
532 o->callback((fltk::Callback*)cb_song_vscroll);
534 {fltk::ThumbWheel* o = song_hscroll = new fltk::ThumbWheel(0, 415, 370, 15);
535 o->maximum(10000);
536 o->step(10);
537 o->callback((fltk::Callback*)cb_song_hscroll);
539 o->end();
540 fltk::Group::current()->resizable(o);
542 o->end();
544 {fltk::Group* o = pattern_edit = new fltk::Group(0, 0, 640, 445);
545 o->hide();
546 o->begin();
547 {fltk::Group* o = new fltk::Group(45, 0, 595, 445);
548 o->begin();
549 {fltk::Group* o = new fltk::Group(0, 0, 595, 15);
550 o->begin();
551 {Timeline* o = pattern_timeline = new Timeline(0, 0, 580, 15, "timeline");
552 o->box(fltk::FLAT_BOX);
553 fltk::Group::current()->resizable(o);
554 o->edit_flag = 1;
556 o->end();
558 {fltk::Group* o = pattern_scrollgroup = new fltk::Group(0, 15, 595, 355);
559 o->begin();
560 {PianoRoll* o = piano_roll = new PianoRoll(0, 0, 580, 340, "pianoroll");
561 o->box(fltk::FLAT_BOX);
562 fltk::Group::current()->resizable(o);
564 {fltk::Scrollbar* o = pattern_vscroll = new fltk::Scrollbar(580, 0, 15, 340);
565 o->set_vertical();
566 o->callback((fltk::Callback*)cb_pattern_vscroll);
568 {fltk::ThumbWheel* o = pattern_hscroll = new fltk::ThumbWheel(0, 340, 580, 15);
569 o->step(10);
570 o->callback((fltk::Callback*)cb_pattern_hscroll);
572 o->end();
573 fltk::Group::current()->resizable(o);
575 {fltk::Group* o = new fltk::Group(0, 370, 595, 75);
576 o->begin();
577 {EventEdit* o = event_edit = new EventEdit(0, 0, 580, 75, "event editor");
578 o->box(fltk::FLAT_BOX);
579 fltk::Group::current()->resizable(o);
581 {EventMenu* o = event_menu = new EventMenu(0, 0, 580, 75);
582 o->box(fltk::FLAT_BOX);
583 o->hide();
585 {fltk::Button* o = event_menu_button = new fltk::Button(580, 0, 15, 15, "E");
586 o->callback((fltk::Callback*)cb_event_menu_button);
587 o->tooltip("pick event type");
588 o->type(fltk::Button::TOGGLE);
590 {fltk::Button* o = new fltk::Button(580, 15, 15, 15, "L");
591 o->callback((fltk::Callback*)cb_L);
592 o->tooltip("toggle event value labels");
593 o->type(fltk::Button::TOGGLE);
595 {fltk::Button* o = new fltk::Button(580, 30, 15, 15, "C");
596 o->callback((fltk::Callback*)cb_C);
597 o->tooltip("clear these events");
599 {fltk::Button* o = new fltk::Button(580, 45, 15, 15, "X");
600 o->callback((fltk::Callback*)cb_X);
601 o->tooltip("clear all non note events in pattern");
603 {fltk::Button* o = new fltk::Button(580, 60, 15, 15, "Z");
604 o->labelcolor((fltk::Color)0xff000000);
605 o->callback((fltk::Callback*)cb_Z);
606 o->tooltip("clear everything");
608 o->end();
610 o->end();
611 fltk::Group::current()->resizable(o);
613 {fltk::Group* o = new fltk::Group(0, 0, 45, 445);
614 o->begin();
615 new fltk::Button(0, 0, 45, 15, "@line");
616 {fltk::Group* o = new fltk::Group(0, 15, 45, 340);
617 o->set_vertical();
618 o->begin();
619 {TrackSelect* o = track_select = new TrackSelect(0, 35, 45, 305, "track picker");
620 o->set_vertical();
622 {SampleView* o = sample_view = new SampleView(0, 35, 45, 305, "sample names");
623 o->set_vertical();
625 {Keyboard* o = keyboard = new Keyboard(0, 0, 45, 340, "keyboard");
626 o->set_vertical();
628 o->end();
629 fltk::Group::current()->resizable(o);
631 {fltk::Button* o = new fltk::Button(0, 370, 45, 75, "@<-");
632 o->set_vertical();
633 o->callback((fltk::Callback*)cb_);
635 o->end();
637 o->end();
639 o->end();
640 fltk::Group::current()->resizable(o);
642 {fltk::Group* o = new fltk::Group(0, 445, 640, 35);
643 o->box(fltk::UP_BOX);
644 o->begin();
645 {fltk::Button* o = play_button = new fltk::Button(5, 5, 25, 25, "@>");
646 o->labelcolor((fltk::Color)0x800000);
647 o->callback((fltk::Callback*)cb_play_button);
649 {fltk::Button* o = stop_button = new fltk::Button(35, 5, 25, 25, "@square");
650 o->labelcolor((fltk::Color)0x800000);
651 o->callback((fltk::Callback*)cb_stop_button);
653 {fltk::Button* o = record_button = new fltk::Button(65, 5, 25, 25, "@circle");
654 o->labelcolor((fltk::Color)0xff000000);
655 o->callback((fltk::Callback*)cb_record_button);
656 o->type(fltk::Button::TOGGLE);
658 {Metronome* o = metronome = new Metronome(95, 5, 25, 25, "0");
659 o->color((fltk::Color)56);
660 o->labelcolor((fltk::Color)0xffffff00);
662 {fltk::Group* o = new fltk::Group(125, 0, 20, 35);
663 o->set_vertical();
664 fltk::Group::current()->resizable(o);
666 {fltk::Group* o = pattern_buttons = new fltk::Group(145, 5, 310, 25);
667 o->hide();
668 o->begin();
669 {fltk::Button* o = qbutton4 = new fltk::Button(135, 0, 25, 25);
670 o->callback((fltk::Callback*)cb_qbutton4);
671 o->type(fltk::Button::TOGGLE);
673 {fltk::Button* o = qbutton8 = new fltk::Button(160, 0, 25, 25);
674 o->callback((fltk::Callback*)cb_qbutton8);
675 o->type(fltk::Button::TOGGLE);
677 {fltk::Button* o = qbutton16 = new fltk::Button(185, 0, 25, 25);
678 o->callback((fltk::Callback*)cb_qbutton16);
679 o->type(fltk::Button::TOGGLE);
680 o->state(1);
682 {fltk::Button* o = qbutton32 = new fltk::Button(210, 0, 25, 25);
683 o->callback((fltk::Callback*)cb_qbutton32);
684 o->type(fltk::Button::TOGGLE);
686 {fltk::Button* o = qbutton64 = new fltk::Button(235, 0, 25, 25);
687 o->callback((fltk::Callback*)cb_qbutton64);
688 o->type(fltk::Button::TOGGLE);
690 {fltk::Button* o = qbutton128 = new fltk::Button(260, 0, 25, 25);
691 o->callback((fltk::Callback*)cb_qbutton128);
692 o->type(fltk::Button::TOGGLE);
694 {fltk::Button* o = qbutton0 = new fltk::Button(285, 0, 25, 25);
695 o->callback((fltk::Callback*)cb_qbutton0);
696 o->type(fltk::Button::TOGGLE);
698 {fltk::Button* o = quant1_button = new fltk::Button(15, 0, 25, 25, "qua");
699 o->tooltip("quantize selected notes");
701 {fltk::Button* o = quant0_button = new fltk::Button(45, 0, 25, 25, "qu_");
702 o->tooltip("quantize length of selected notes");
704 {fltk::Button* o = tool_button = new fltk::Button(75, 0, 25, 25, "tool");
705 o->callback((fltk::Callback*)cb_tool_button);
707 o->end();
709 {fltk::Group* o = song_buttons = new fltk::Group(340, 5, 115, 25);
710 o->begin();
711 {fltk::Button* o = color_toggle = new fltk::Button(0, 0, 25, 25);
712 o->callback((fltk::Callback*)cb_color_toggle);
713 o->tooltip("color tool");
714 o->type(fltk::Button::TOGGLE);
716 {fltk::Button* o = unclone_button = new fltk::Button(30, 0, 25, 25, "dclo");
717 o->tooltip("unclone selected block");
719 {fltk::Button* o = join_button = new fltk::Button(60, 0, 25, 25, "join");
720 o->tooltip("join selected blocks");
722 {fltk::Button* o = split_button = new fltk::Button(90, 0, 25, 25, "split");
723 o->tooltip("split selected block");
725 o->end();
727 {fltk::Button* o = loop_toggle = new fltk::Button(490, 5, 25, 25);
728 o->callback((fltk::Callback*)cb_loop_toggle);
729 o->tooltip("toggle looping");
730 o->type(fltk::Button::TOGGLE);
732 {fltk::Button* o = config_button = new fltk::Button(520, 5, 25, 25, "conf");
733 o->callback((fltk::Callback*)cb_config_button);
734 o->tooltip("configuration");
735 o->type(fltk::Button::TOGGLE);
737 {fltk::Button* o = scope_button = new fltk::Button(550, 5, 25, 25);
738 o->callback((fltk::Callback*)cb_scope_button);
739 o->tooltip("scope");
740 o->type(fltk::Button::TOGGLE);
742 {fltk::Button* o = file_button = new fltk::Button(580, 5, 25, 25);
743 o->callback((fltk::Callback*)cb_file_button);
744 o->tooltip("disk");
745 o->type(fltk::Button::TOGGLE);
747 {fltk::Button* o = help_button = new fltk::Button(610, 5, 25, 25);
748 o->callback((fltk::Callback*)cb_help_button);
749 o->tooltip("help");
750 o->type(fltk::Button::TOGGLE);
752 o->end();
754 o->end();
755 o->size_range(640,455);
756 o->resize(640,455);
758 {fltk::Window* o = config_window = new fltk::Window(320, 285, "controls");
759 o->shortcut(0xff1b);
760 o->user_data((void*)(this));
761 o->begin();
762 {fltk::TabGroup* o = new fltk::TabGroup(0, 0, 320, 285);
763 o->begin();
764 {fltk::Group* o = new fltk::Group(145, 15, 170, 265, "options");
765 o->begin();
766 {fltk::ValueInput* o = beats_per_measure = new fltk::ValueInput(5, 5, 45, 20, "beats per measure");
767 o->minimum(1);
768 o->maximum(31);
769 o->step(1);
770 o->value(4);
771 o->callback((fltk::Callback*)cb_beats_per_measure);
773 {fltk::ValueInput* o = measures_per_phrase = new fltk::ValueInput(5, 30, 45, 20, "measures per phrase");
774 o->maximum(128);
775 o->step(1);
776 o->value(4);
777 o->callback((fltk::Callback*)cb_measures_per_phrase);
779 {fltk::ValueOutput* o = bpm_output = new fltk::ValueOutput(5, 55, 45, 20, "bpm");
780 o->minimum(1);
781 o->maximum(1000);
782 o->step(1);
783 o->value(120);
785 {fltk::ThumbWheel* o = bpm_wheel = new fltk::ThumbWheel(55, 55, 105, 20);
786 o->minimum(1);
787 o->maximum(1000);
788 o->step(1);
789 o->value(120);
790 o->callback((fltk::Callback*)cb_bpm_wheel);
791 o->align(fltk::ALIGN_LEFT);
793 {fltk::ValueInput* o = measures_until_record = new fltk::ValueInput(5, 80, 45, 20, "measures until record");
794 o->maximum(128);
795 o->step(1);
796 o->value(1);
797 o->callback((fltk::Callback*)cb_measures_until_record);
799 {fltk::CheckButton* o = check_alwayscopy = new fltk::CheckButton(5, 105, 25, 25, "always hard copy");
800 o->callback((fltk::Callback*)cb_check_alwayscopy);
801 o->align(fltk::ALIGN_LEFT);
802 o->tooltip("instead of making a linked clone when you copy a block in the song view.");
804 {fltk::CheckButton* o = check_autotrackname = new fltk::CheckButton(145, 105, 25, 25, "auto track name");
805 o->callback((fltk::Callback*)cb_check_autotrackname);
806 o->align(fltk::ALIGN_LEFT);
807 o->tooltip("Fill in GM instruments for track names when you change the program.");
809 {fltk::CheckButton* o = check_passthru = new fltk::CheckButton(5, 130, 25, 26, "record pass-thru");
810 o->set_flag(fltk::STATE);
811 o->callback((fltk::Callback*)cb_check_passthru);
812 o->align(fltk::ALIGN_LEFT);
813 o->tooltip("Echo midi input to midi output.");
815 {fltk::CheckButton* o = check_playinsert = new fltk::CheckButton(145, 130, 25, 26, "play note insertion");
816 o->set_flag(fltk::STATE);
817 o->callback((fltk::Callback*)cb_check_playinsert);
818 o->align(fltk::ALIGN_LEFT);
819 o->tooltip("Send midi note on when you create notes.");
821 {fltk::CheckButton* o = check_recordonchan = new fltk::CheckButton(5, 155, 25, 25, "record on channel");
822 o->callback((fltk::Callback*)cb_check_recordonchan);
823 o->align(fltk::ALIGN_LEFT);
824 o->tooltip("Record on first track that matches channel of midi input instead of selected \
825 track.");
827 {fltk::CheckButton* o = check_playmove = new fltk::CheckButton(145, 155, 25, 26, "play note move");
828 o->set_flag(fltk::STATE);
829 o->callback((fltk::Callback*)cb_check_playmove);
830 o->align(fltk::ALIGN_LEFT);
831 o->tooltip("Send midi note on when you move notes.");
833 {fltk::CheckButton* o = check_follow = new fltk::CheckButton(5, 179, 25, 26, "follow playback");
834 o->set_flag(fltk::STATE);
835 o->callback((fltk::Callback*)cb_check_follow);
836 o->align(fltk::ALIGN_LEFT);
837 o->tooltip("Auto scroll horizontally when play head leaves viewing area.");
839 {fltk::ValueInput* o = default_velocity = new fltk::ValueInput(120, 180, 45, 20, "default velocity");
840 o->maximum(127);
841 o->step(1);
842 o->value(96);
843 o->callback((fltk::Callback*)cb_default_velocity);
845 {fltk::Choice* o = menu_recordmode = new fltk::Choice(5, 210, 160, 25, "record mode");
846 o->begin();
847 {fltk::Item* o = new fltk::Item("merge");
848 o->callback((fltk::Callback*)cb_merge);
850 {fltk::Item* o = new fltk::Item("overwrite");
851 o->callback((fltk::Callback*)cb_overwrite);
853 {fltk::Item* o = new fltk::Item("layer");
854 o->callback((fltk::Callback*)cb_layer);
856 o->end();
858 {fltk::Choice* o = menu_rob = new fltk::Choice(5, 240, 160, 25, "record outside block");
859 o->begin();
860 {fltk::Item* o = new fltk::Item("do nothing");
861 o->callback((fltk::Callback*)cb_do);
863 {fltk::Item* o = new fltk::Item("new block");
864 o->callback((fltk::Callback*)cb_new);
866 {fltk::Item* o = new fltk::Item("extend block");
867 o->callback((fltk::Callback*)cb_extend);
869 o->end();
871 o->end();
873 {fltk::Group* o = new fltk::Group(0, 15, 320, 270, "keyboard");
874 o->hide();
875 o->begin();
876 {KeyGrabber* o = kg_l0 = new KeyGrabber(35, 5, 45, 15, "C0");
877 o->align(fltk::ALIGN_LEFT);
879 {KeyGrabber* o = kg_l1 = new KeyGrabber(35, 20, 45, 15, "C#0");
880 o->align(fltk::ALIGN_LEFT);
882 {KeyGrabber* o = kg_l2 = new KeyGrabber(35, 35, 45, 15, "D0");
883 o->align(fltk::ALIGN_LEFT);
885 {KeyGrabber* o = kg_l3 = new KeyGrabber(35, 50, 45, 15, "D#0");
886 o->align(fltk::ALIGN_LEFT);
888 {KeyGrabber* o = kg_l4 = new KeyGrabber(35, 65, 45, 15, "E0");
889 o->align(fltk::ALIGN_LEFT);
891 {KeyGrabber* o = kg_l5 = new KeyGrabber(35, 80, 45, 15, "F0");
892 o->align(fltk::ALIGN_LEFT);
894 {KeyGrabber* o = kg_l6 = new KeyGrabber(35, 95, 45, 15, "F#0");
895 o->align(fltk::ALIGN_LEFT);
897 {KeyGrabber* o = kg_l7 = new KeyGrabber(35, 110, 45, 15, "G0");
898 o->align(fltk::ALIGN_LEFT);
900 {KeyGrabber* o = kg_l8 = new KeyGrabber(35, 125, 45, 15, "G#0");
901 o->align(fltk::ALIGN_LEFT);
903 {KeyGrabber* o = kg_l9 = new KeyGrabber(35, 140, 45, 15, "A0");
904 o->align(fltk::ALIGN_LEFT);
906 {KeyGrabber* o = kg_l10 = new KeyGrabber(35, 155, 45, 15, "A#0");
907 o->callback((fltk::Callback*)cb_kg_l10);
908 o->align(fltk::ALIGN_LEFT);
910 {KeyGrabber* o = kg_l11 = new KeyGrabber(35, 170, 45, 15, "B0");
911 o->align(fltk::ALIGN_LEFT);
913 {KeyGrabber* o = kg_l12 = new KeyGrabber(35, 185, 45, 15, "C1");
914 o->align(fltk::ALIGN_LEFT);
916 {KeyGrabber* o = kg_l13 = new KeyGrabber(35, 200, 45, 15, "C#1");
917 o->align(fltk::ALIGN_LEFT);
919 {KeyGrabber* o = kg_l14 = new KeyGrabber(35, 215, 45, 15, "D1");
920 o->align(fltk::ALIGN_LEFT);
922 {KeyGrabber* o = kg_l15 = new KeyGrabber(35, 230, 45, 15, "D#1");
923 o->align(fltk::ALIGN_LEFT);
925 {KeyGrabber* o = kg_l16 = new KeyGrabber(35, 245, 45, 15, "E1");
926 o->align(fltk::ALIGN_LEFT);
928 {KeyGrabber* o = kg_u0 = new KeyGrabber(130, 5, 45, 15, "C1");
929 o->align(fltk::ALIGN_LEFT);
931 {KeyGrabber* o = kg_u1 = new KeyGrabber(130, 20, 45, 15, "C#1");
932 o->align(fltk::ALIGN_LEFT);
934 {KeyGrabber* o = kg_u2 = new KeyGrabber(130, 35, 45, 15, "D1");
935 o->align(fltk::ALIGN_LEFT);
937 {KeyGrabber* o = kg_u3 = new KeyGrabber(130, 50, 45, 15, "D#1");
938 o->align(fltk::ALIGN_LEFT);
940 {KeyGrabber* o = kg_u4 = new KeyGrabber(130, 65, 45, 15, "E1");
941 o->align(fltk::ALIGN_LEFT);
943 {KeyGrabber* o = kg_u5 = new KeyGrabber(130, 80, 45, 15, "F1");
944 o->align(fltk::ALIGN_LEFT);
946 {KeyGrabber* o = kg_u6 = new KeyGrabber(130, 95, 45, 15, "F#1");
947 o->align(fltk::ALIGN_LEFT);
949 {KeyGrabber* o = kg_u7 = new KeyGrabber(130, 110, 45, 15, "G1");
950 o->align(fltk::ALIGN_LEFT);
952 {KeyGrabber* o = kg_u8 = new KeyGrabber(130, 125, 45, 15, "G#1");
953 o->align(fltk::ALIGN_LEFT);
955 {KeyGrabber* o = kg_u9 = new KeyGrabber(130, 140, 45, 15, "A1");
956 o->align(fltk::ALIGN_LEFT);
958 {KeyGrabber* o = kg_u10 = new KeyGrabber(130, 155, 45, 15, "A#1");
959 o->align(fltk::ALIGN_LEFT);
961 {KeyGrabber* o = kg_u11 = new KeyGrabber(130, 170, 45, 15, "B1");
962 o->align(fltk::ALIGN_LEFT);
964 {KeyGrabber* o = kg_u12 = new KeyGrabber(130, 185, 45, 15, "C2");
965 o->align(fltk::ALIGN_LEFT);
967 {KeyGrabber* o = kg_u13 = new KeyGrabber(130, 200, 45, 15, "C#2");
968 o->align(fltk::ALIGN_LEFT);
970 {KeyGrabber* o = kg_u14 = new KeyGrabber(130, 215, 45, 15, "D2");
971 o->align(fltk::ALIGN_LEFT);
973 {KeyGrabber* o = kg_u15 = new KeyGrabber(130, 230, 45, 15, "D#2");
974 o->align(fltk::ALIGN_LEFT);
976 {KeyGrabber* o = kg_u16 = new KeyGrabber(130, 245, 45, 15, "E2");
977 o->align(fltk::ALIGN_LEFT);
979 {KeyGrabber* o = kg_u17 = new KeyGrabber(265, 5, 45, 15, "F2");
980 o->align(fltk::ALIGN_LEFT);
982 {KeyGrabber* o = kg_u18 = new KeyGrabber(265, 20, 45, 15, "F#2");
983 o->align(fltk::ALIGN_LEFT);
985 {KeyGrabber* o = kg_u19 = new KeyGrabber(265, 35, 45, 15, "G2");
986 o->align(fltk::ALIGN_LEFT);
988 {KeyGrabber* o = kg_u20 = new KeyGrabber(265, 50, 45, 15, "G#2");
989 o->align(fltk::ALIGN_LEFT);
991 {KeyGrabber* o = kg_zi = new KeyGrabber(265, 65, 45, 15, "zoom in");
992 o->align(fltk::ALIGN_LEFT);
994 {KeyGrabber* o = kg_zo = new KeyGrabber(265, 80, 45, 15, "zoom out");
995 o->align(fltk::ALIGN_LEFT);
997 {KeyGrabber* o = kg_ou = new KeyGrabber(265, 95, 45, 15, "octave up");
998 o->align(fltk::ALIGN_LEFT);
1000 {KeyGrabber* o = kg_od = new KeyGrabber(265, 110, 45, 15, "octave down");
1001 o->align(fltk::ALIGN_LEFT);
1003 o->end();
1005 {fltk::Group* o = new fltk::Group(0, 15, 320, 270, "colors");
1006 o->hide();
1007 o->begin();
1008 new fltk::Button(250, 245, 65, 20, "apply");
1009 {fltk::Choice* o = new fltk::Choice(55, 10, 100, 20, "presets");
1010 o->begin();
1011 new fltk::Item("windo");
1012 new fltk::Item("midnight");
1013 new fltk::Item("xterm");
1014 o->end();
1016 o->end();
1018 o->end();
1020 o->end();
1022 {fltk::Window* o = help_window = new fltk::Window(580, 370, "help");
1023 o->shortcut(0xff1b);
1024 o->user_data((void*)(this));
1025 o->begin();
1026 {fltk::TabGroup* o = new fltk::TabGroup(0, 0, 580, 370);
1027 o->begin();
1028 {fltk::Group* o = new fltk::Group(0, 25, 580, 345, "info");
1029 o->begin();
1030 title_text = new fltk::Input(55, 5, 520, 20, "Title");
1031 author_text = new fltk::Input(55, 30, 520, 20, "Author");
1032 {fltk::TextEditor* o = info_text = new fltk::TextEditor(5, 55, 570, 285);
1033 o->textfont(fltk::COURIER);
1034 fltk::Group::current()->resizable(o);
1036 o->end();
1037 fltk::Group::current()->resizable(o);
1039 {fltk::Group* o = new fltk::Group(0, 25, 580, 345, "controls");
1040 o->hide();
1041 o->begin();
1042 {fltk::TextDisplay* o = new fltk::TextDisplay(5, 5, 570, 335);
1043 o->textfont(fltk::COURIER);
1044 fltk::Group::current()->resizable(o);
1045 load_text(o,ROOT_DATA_DIR"doc/controls.txt");
1047 o->end();
1049 {fltk::Group* o = new fltk::Group(0, 25, 580, 345, "guide");
1050 o->hide();
1051 o->begin();
1052 {fltk::TextDisplay* o = new fltk::TextDisplay(5, 5, 570, 335);
1053 o->textfont(fltk::COURIER);
1054 fltk::Group::current()->resizable(o);
1055 load_text(o,ROOT_DATA_DIR"doc/guide.txt");
1057 o->end();
1059 {fltk::Group* o = new fltk::Group(0, 25, 580, 345, "license");
1060 o->hide();
1061 o->begin();
1062 {fltk::TextDisplay* o = new fltk::TextDisplay(5, 5, 570, 335);
1063 o->textfont(fltk::COURIER);
1064 fltk::Group::current()->resizable(o);
1065 load_text(o,ROOT_DATA_DIR"doc/license.txt");
1067 o->end();
1069 {fltk::Group* o = new fltk::Group(0, 25, 580, 345, "about");
1070 o->hide();
1071 o->begin();
1072 {fltk::TextDisplay* o = new fltk::TextDisplay(5, 5, 570, 335);
1073 o->textfont(fltk::COURIER);
1074 fltk::Group::current()->resizable(o);
1075 load_text(o,ROOT_DATA_DIR"doc/README");
1077 o->end();
1079 o->end();
1081 o->end();
1082 o->size_range(580,370);
1083 o->resizable(o);
1085 {fltk::Window* o = action_window = new fltk::Window(100, 130, "menu");
1086 o->shortcut(0xff1b);
1087 o->user_data((void*)(this));
1088 o->begin();
1089 {fltk::Button* o = new fltk::Button(5, 5, 90, 20, "new");
1090 o->callback((fltk::Callback*)cb_new1);
1092 {fltk::Button* o = new fltk::Button(5, 25, 90, 20, "save");
1093 o->callback((fltk::Callback*)cb_save);
1095 {fltk::Button* o = new fltk::Button(5, 45, 90, 20, "save as");
1096 o->callback((fltk::Callback*)cb_save1);
1098 {fltk::Button* o = new fltk::Button(5, 65, 90, 20, "load");
1099 o->callback((fltk::Callback*)cb_load);
1101 {fltk::Button* o = new fltk::Button(5, 85, 90, 20, "import");
1102 o->callback((fltk::Callback*)cb_import);
1104 {fltk::Button* o = new fltk::Button(5, 105, 90, 20, "export");
1105 o->callback((fltk::Callback*)cb_export);
1107 o->end();
1109 {fltk::Window* o = scope_window = new fltk::Window(425, 280, "scope");
1110 w = o;
1111 o->shortcut(0xff1b);
1112 o->user_data((void*)(this));
1113 o->begin();
1114 {fltk::TextDisplay* o = scope = new fltk::TextDisplay(5, 5, 415, 245);
1115 o->textfont(fltk::COURIER);
1116 o->color((fltk::Color)0x280000);
1117 o->textcolor((fltk::Color)0xff0000);
1118 o->wrap_mode(1);
1120 {fltk::Group* o = new fltk::Group(5, 255, 410, 20);
1121 o->begin();
1122 {fltk::Button* o = new fltk::Button(0, 0, 40, 20, "on");
1123 o->callback((fltk::Callback*)cb_on);
1124 o->type(fltk::Button::TOGGLE);
1126 {fltk::InvisibleBox* o = new fltk::InvisibleBox(45, 0, 95, 20);
1127 fltk::Group::current()->resizable(o);
1129 o->end();
1131 o->end();
1132 o->resizable(o);
1134 loop_toggle->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/loop.gif"));
1135 color_toggle->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/color.gif"));
1136 scope_button->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/conf.gif"));
1137 file_button->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/file.gif"));
1138 help_button->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/help.gif"));
1140 qbutton4->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q4.gif"));
1141 qbutton8->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q8.gif"));
1142 qbutton16->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q16.gif"));
1143 qbutton32->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q32.gif"));
1144 qbutton64->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q64.gif"));
1145 qbutton128->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q128.gif"));
1146 qbutton0->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q0.gif"));
1147 track_info->set_rec(0);
1148 start_monitor();
1149 main_window->show();