Fixed division by zero when using extend block.
[epichord.git] / src / ui.fl
blobb3aaa77d058faa0f5368a51d3c552bf53d58b220
1 # data file for the FLTK User Interface Designer (FLUID)
2 version 2.1000 
3 images_dir header_name 
4 do_not_include_H_from_C 
5 header_name {.h} 
6 code_name {.cpp} 
7 gridx 5 
8 gridy 5 
9 snap 3
10 decl {/*
11    Epichord - a midi sequencer
12    Copyright (C) 2008  Evan Rinehart
14    This program is free software; you can redistribute it and/or
15    modify it under the terms of the GNU General Public License
16    as published by the Free Software Foundation; either version 2
17    of the License, or (at your option) any later version.
19    This program is distributed in the hope that it will be useful,
20    but WITHOUT ANY WARRANTY; without even the implied warranty of
21    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22    GNU General Public License for more details.
24    You should have received a copy of the GNU General Public License
25    along with this program; if not, write to
27    The Free Software Foundation, Inc.
28    51 Franklin Street, Fifth Floor
29    Boston, MA  02110-1301, USA
30 */} {} 
32 decl {\#include <stdlib.h>} {} 
34 decl {\#include <fltk/events.h>} {} 
36 decl {\#include <fltk/file_chooser.h>} {} 
38 decl {\#include "backend.h"} {} 
40 decl {\#include "util.h"} {} 
42 decl {\#include "uihelper.h"} {} 
44 decl {\#include "config.h"} {} 
46 decl {extern UI* ui;} {} 
48 class UI {open
49 } {
50   Function {UI()} {open
51   } {
52     {fltk::Window} main_window {
53       label Epichord
54       callback {config_window->hide();
55 help_window->hide();
56 action_window->hide();
57 scope_window->hide();
58 o->hide();
60 save_config();} open
61       xywh {31 41 640 480} resizable
62       extra_code {\#include <unistd.h>
63 \#include <stdio.h>
64 \#include "seq.h"
65 \#include "trackmodule.h"
66 o->size_range(640,455);
67 o->resize(640,455);} visible
68     } {
69       {fltk::Group} {} {open
70         xywh {0 0 640 445} resizable
71       } {
72         {fltk::Group} song_edit {open
73           xywh {0 0 640 445}
74         } {
75           {fltk::Group} {} {
76             xywh {0 0 255 445} box FLAT_BOX
77           } {
78             {fltk::Widget} track_info {
79               label {track info}
80               xywh {0 15 255 415} resizable
81               extra_code {\#include "trackinfo.h"}
82               class TrackInfo
83             }
84             {fltk::Button} {} {
85               label {@line}
86               callback {ui->track_info->toggle_controls();}
87               xywh {0 0 255 15}
88             }
89           }
90           {fltk::Group} {} {open
91             xywh {255 0 385 15}
92           } {
93             {fltk::Widget} song_timeline {
94               label timeline
95               xywh {0 0 370 15} resizable
96               extra_code {o->scale=16;
97 o->label_scale=4;}
98               class Timeline
99             }
100           }
101           {fltk::Group} song_scrollgroup {open
102             xywh {255 15 385 430} resizable
103           } {
104             {fltk::Widget} arranger {
105               label arranger
106               xywh {0 0 370 415} resizable box FLAT_BOX
107               extra_code {\#include "seq.h"
108 \#include "arranger.h"}
109               class Arranger
110             }
111             {fltk::Scrollbar} song_vscroll {
112               callback {int target = (int)o->value();
113 int dummy = ui->arranger->scrollx;
114 ui->arranger->scrollTo(dummy,target);}
115               xywh {370 0 15 415} slider_size 60
116             }
117             {fltk::ThumbWheel} song_hscroll {
118               callback {ui->arranger->scrollTo((int)o->value(),ui->arranger->scrolly);}
119               xywh {0 415 370 15} maximum 10000 step 10
120             }
121           }
122         }
123         {fltk::Group} pattern_edit {open
124           xywh {0 0 640 445} hide
125         } {
126           {fltk::Group} {} {open
127             xywh {45 0 595 445} resizable
128           } {
129             {fltk::Group} {} {
130               xywh {0 0 595 15}
131             } {
132               {fltk::Widget} pattern_timeline {
133                 label timeline
134                 xywh {0 0 580 15} resizable box FLAT_BOX
135                 extra_code {\#include "timeline.h"
136 o->edit_flag = 1;}
137                 class Timeline
138               }
139             }
140             {fltk::Group} pattern_scrollgroup {open
141               xywh {0 15 595 355} resizable
142             } {
143               {fltk::Widget} piano_roll {
144                 label pianoroll
145                 xywh {0 0 580 340} resizable box FLAT_BOX
146                 extra_code {\#include "pianoroll.h"}
147                 class PianoRoll
148               }
149               {fltk::Scrollbar} pattern_vscroll {
150                 callback {int target = (int)o->value();
151 int dummy = ui->piano_roll->scrollx;
152 ui->piano_roll->scrollTo(dummy,target);}
153                 xywh {580 0 15 340}
154               }
155               {fltk::ThumbWheel} pattern_hscroll {
156                 callback {ui->piano_roll->scrollTo((int)o->value(),ui->piano_roll->scrolly);} selected
157                 xywh {0 340 580 15} step 10
158               }
159             }
160             {fltk::Group} {} {
161               xywh {0 370 595 75}
162             } {
163               {fltk::Widget} event_edit {
164                 label {event editor}
165                 xywh {0 0 580 75} resizable box FLAT_BOX
166                 extra_code {\#include "eventedit.h"}
167                 class EventEdit
168               }
169               {fltk::Widget} event_menu {
170                 xywh {0 0 580 75} hide box FLAT_BOX
171                 extra_code {\#include "eventmenu.h"}
172                 class EventMenu
173               }
174               {fltk::Button} event_menu_button {
175                 label E
176                 callback {if(o->state()==0){
177   ui->event_menu->hide();
178   ui->event_edit->show();
180 else{
181   ui->event_edit->hide();
182   ui->event_edit->recount_has();
183   ui->event_menu->show();
185                 tooltip {pick event type}
186                 xywh {580 0 15 15}
187                 extra_code {o->type(fltk::Button::TOGGLE);}
188               }
189               {fltk::Button} {} {
190                 label L
191                 callback {ui->event_edit->label_flag = o->state();
192 ui->event_edit->redraw();}
193                 tooltip {toggle event value labels}
194                 xywh {580 15 15 15}
195                 extra_code {o->type(fltk::Button::TOGGLE);}
196               }
197               {fltk::Button} {} {
198                 label C
199                 callback {ui->event_edit->clear_events();}
200                 tooltip {clear these events}
201                 xywh {580 30 15 15}
202               }
203               {fltk::Button} {} {
204                 label X
205                 callback {ui->event_edit->clear_non_note_events();}
206                 tooltip {clear all non note events in pattern}
207                 xywh {580 45 15 15}
208               }
209               {fltk::Button} {} {
210                 label Z
211                 callback {ui->event_edit->clear_all_events();}
212                 tooltip {clear everything}
213                 xywh {580 60 15 15} labelcolor 0xff000000
214               }
215             }
216           }
217           {fltk::Group} {} {open
218             xywh {0 0 45 445} horizontal
219           } {
220             {fltk::Button} {} {
221               label {@line}
222               xywh {0 0 45 15}
223             }
224             {fltk::Group} {} {open
225               xywh {0 15 45 340} resizable
226             } {
227               {fltk::Widget} track_select {
228                 label {track picker}
229                 xywh {0 35 45 305}
230                 extra_code {\#include "trackselect.h"}
231                 class TrackSelect
232               }
233               {fltk::Widget} sample_view {
234                 label {sample names}
235                 xywh {0 35 45 305}
236                 extra_code {\#include "sampleview.h"}
237                 class SampleView
238               }
239               {fltk::Widget} keyboard {
240                 label keyboard
241                 xywh {0 0 45 340}
242                 extra_code {\#include "keyboard.h"}
243                 class Keyboard
244               }
245             }
246             {fltk::Button} {} {
247               label {@<-}
248               callback {show_song_edit();}
249               xywh {0 370 45 75}
250             }
251           }
252         }
253       }
254       {fltk::Group} {} {
255         xywh {0 445 640 35} box UP_BOX
256       } {
257         {fltk::Button} play_button {
258           label {@>}
259           callback {press_play();}
260           xywh {5 5 25 25} labelcolor 0x800000
261         }
262         {fltk::Button} stop_button {
263           label {@square}
264           callback {press_stop();}
265           xywh {35 5 25 25} labelcolor 0x800000
266         }
267         {fltk::Button} record_button {
268           label {@circle}
269           callback {toggle_backend_recording();}
270           xywh {65 5 25 25} labelcolor 0xff000000
271           extra_code {o->type(fltk::Button::TOGGLE);}
272         }
273         {fltk::Widget} metronome {
274           label 0
275           xywh {95 5 25 25} color 56 labelcolor 0xffffff00
276           extra_code {\#include <metronome.h>}
277           class Metronome
278         }
279         {fltk::Group} {} {open
280           xywh {125 0 20 35} resizable
281         } {}
282         {fltk::Group} pattern_buttons {
283           xywh {145 5 310 25} hide
284         } {
285           {fltk::Button} qbutton4 {
286             callback {set_quant(4);}
287             xywh {135 0 25 25}
288             extra_code {o->type(fltk::Button::TOGGLE);}
289           }
290           {fltk::Button} qbutton8 {
291             callback {set_quant(8);}
292             xywh {160 0 25 25}
293             extra_code {o->type(fltk::Button::TOGGLE);}
294           }
295           {fltk::Button} qbutton16 {
296             callback {set_quant(16);}
297             xywh {185 0 25 25}
298             extra_code {o->type(fltk::Button::TOGGLE);
299 o->state(1);}
300           }
301           {fltk::Button} qbutton32 {
302             callback {set_quant(32);}
303             xywh {210 0 25 25}
304             extra_code {o->type(fltk::Button::TOGGLE);}
305           }
306           {fltk::Button} qbutton64 {
307             callback {set_quant(64);}
308             xywh {235 0 25 25}
309             extra_code {o->type(fltk::Button::TOGGLE);}
310           }
311           {fltk::Button} qbutton128 {
312             callback {set_quant(128);}
313             xywh {260 0 25 25}
314             extra_code {o->type(fltk::Button::TOGGLE);}
315           }
316           {fltk::Button} qbutton0 {
317             callback {set_quant(0);}
318             xywh {285 0 25 25}
319             extra_code {o->type(fltk::Button::TOGGLE);}
320           }
321           {fltk::Button} quant1_button {
322             label qua
323             tooltip {quantize selected notes}
324             xywh {15 0 25 25}
325           }
326           {fltk::Button} quant0_button {
327             label qu_
328             tooltip {quantize length of selected notes}
329             xywh {45 0 25 25}
330           }
331           {fltk::Button} tool_button {
332             label tool
333             callback {toggle_tool();}
334             xywh {75 0 25 25}
335           }
336         }
337         {fltk::Group} song_buttons {
338           xywh {340 5 115 25}
339         } {
340           {fltk::Button} color_toggle {
341             callback {arranger->color_flag = o->state();}
342             tooltip {color tool}
343             xywh {0 0 25 25}
344             extra_code {o->type(fltk::Button::TOGGLE);}
345           }
346           {fltk::Button} unclone_button {
347             label dclo
348             tooltip {unclone selected block}
349             xywh {30 0 25 25}
350           }
351           {fltk::Button} join_button {
352             label join
353             tooltip {join selected blocks}
354             xywh {60 0 25 25}
355           }
356           {fltk::Button} split_button {
357             label split
358             tooltip {split selected block}
359             xywh {90 0 25 25}
360           }
361         }
362         {fltk::Button} loop_toggle {
363           callback {toggle_loop();}
364           tooltip {toggle looping}
365           xywh {490 5 25 25}
366           extra_code {o->type(fltk::Button::TOGGLE);}
367         }
368         {fltk::Button} config_button {
369           label conf
370           callback {if(o->state()){
371   ui->config_window->show();
373 else{
374   ui->config_window->hide();
376           tooltip configuration
377           xywh {520 5 25 25}
378           extra_code {o->type(fltk::Button::TOGGLE);}
379         }
380         {fltk::Button} scope_button {
381           callback {if(o->state()){
382   ui->scope_window->show();
384 else{
385   ui->scope_window->hide();
387           tooltip scope
388           xywh {550 5 25 25}
389           extra_code {o->type(fltk::Button::TOGGLE);}
390         }
391         {fltk::Button} file_button {
392           callback {if(o->state()){
393   ui->action_window->show();
395 else{
396   ui->action_window->hide();
398           tooltip disk
399           xywh {580 5 25 25}
400           extra_code {\#include "saveload.h"
401 o->type(fltk::Button::TOGGLE);}
402         }
403         {fltk::Button} help_button {
404           callback {if(o->state()){
405   ui->help_window->show();
407 else{
408   ui->help_window->hide();
410           tooltip help
411           xywh {610 5 25 25}
412           extra_code {o->type(fltk::Button::TOGGLE);}
413         }
414       }
415     }
416     {fltk::Window} config_window {
417       label controls
418       xywh {52 125 320 285} hide
419     } {
420       {fltk::TabGroup} {} {open
421         xywh {0 0 320 285}
422       } {
423         {fltk::Group} {} {
424           label options
425           xywh {145 15 170 265} horizontal
426         } {
427           {fltk::ValueInput} beats_per_measure {
428             label {beats per measure}
429             callback {if(o->value() > o->maximum())
430   o->value(o->maximum());
431 if(o->value() < o->minimum())
432   o->value(o->minimum());
433 set_beats_per_measure((int)o->value());}
434             xywh {5 5 45 20} minimum 1 maximum 31 step 1 value 4
435           }
436           {fltk::ValueInput} measures_per_phrase {
437             label {measures per phrase}
438             callback {if(o->value() > o->maximum())
439   o->value(o->maximum());
440 if(o->value() < o->minimum())
441   o->value(o->minimum());
442 set_measures_per_phrase((int)o->value());}
443             xywh {5 30 45 20} maximum 128 step 1 value 4
444           }
445           {fltk::ValueOutput} bpm_output {
446             label bpm
447             xywh {5 55 45 20} minimum 1 maximum 1000 step 1 value 120
448           }
449           {fltk::ThumbWheel} bpm_wheel {
450             callback {set_bpm((int)o->value());
451 ui->bpm_output->value(o->value());}
452             xywh {55 55 105 20} align 4 minimum 1 maximum 1000 step 1 value 120
453           }
454           {fltk::ValueInput} measures_until_record {
455             label {measures until record}
456             callback {if(o->value() > o->maximum())
457   o->value(o->maximum());
458 if(o->value() < o->minimum())
459   o->value(o->minimum());
460 set_measures_until_record((int)o->value());}
461             xywh {5 80 45 20} maximum 128 step 1 value 1
462           }
463           {fltk::CheckButton} check_alwayscopy {
464             label {always hard copy}
465             callback {set_alwayscopy(o->value());}
466             tooltip {instead of making a linked clone when you copy a block in the song view.}
467             xywh {5 105 25 25} align 4
468           }
469           {fltk::CheckButton} check_autotrackname {
470             label {auto track name}
471             callback {set_autotrackname(o->value());}
472             tooltip {Fill in GM instruments for track names when you change the program.}
473             xywh {145 105 25 25} align 4
474           }
475           {fltk::CheckButton} check_passthru {
476             label {record pass-thru}
477             callback {set_passthru(o->value());}
478             tooltip {Echo midi input to midi output.}
479             xywh {5 130 25 26} horizontal align 4 value 1
480           }
481           {fltk::CheckButton} check_playinsert {
482             label {play note insertion}
483             callback {set_playinsert(o->value());}
484             tooltip {Send midi note on when you create notes.}
485             xywh {145 130 25 26} horizontal align 4 value 1
486           }
487           {fltk::CheckButton} check_recordonchan {
488             label {record on channel}
489             callback {set_recordonchan(o->value());}
490             tooltip {Record on first track that matches channel of midi input instead of selected track.}
491             xywh {5 155 25 25} align 4
492           }
493           {fltk::CheckButton} check_playmove {
494             label {play note move}
495             callback {set_playmove(o->value());}
496             tooltip {Send midi note on when you move notes.}
497             xywh {145 155 25 26} horizontal align 4 value 1
498           }
499           {fltk::CheckButton} check_follow {
500             label {follow playback}
501             callback {set_follow(o->value());}
502             tooltip {Auto scroll horizontally when play head leaves viewing area.}
503             xywh {5 179 25 26} horizontal align 4 value 1
504           }
505           {fltk::ValueInput} default_velocity {
506             label {default velocity}
507             callback {if(o->value() > o->maximum())
508   o->value(o->maximum());
509 if(o->value() < o->minimum())
510   o->value(o->minimum());
511 set_defaultvelocity((int)o->value());}
512             xywh {120 180 45 20} maximum 127 step 1 value 96
513           }
514           {fltk::Choice} menu_recordmode {
515             label {record mode} open
516             xywh {5 210 160 25}
517           } {
518             {fltk::Item} {} {
519               label merge
520               callback {set_recordmode(0);}
521               }
522             {fltk::Item} {} {
523               label overwrite
524               callback {set_recordmode(1);}
525               }
526             {fltk::Item} {} {
527               label layer
528               callback {set_recordmode(2);}
529               }
530           }
531           {fltk::Choice} menu_rob {
532             label {record outside block} open
533             xywh {5 240 160 25}
534           } {
535             {fltk::Item} {} {
536               label {do nothing}
537               callback {set_robmode(0);}
538               }
539             {fltk::Item} {} {
540               label {new block}
541               callback {set_robmode(1);}
542               }
543             {fltk::Item} {} {
544               label {extend block}
545               callback {set_robmode(2);}
546               }
547           }
548         }
549         {fltk::Group} {} {
550           label keyboard
551           xywh {0 15 320 270} hide
552         } {
553           {fltk::Widget} kg_l0 {
554             label C0
555             xywh {35 5 45 15} align 4
556             class KeyGrabber
557           }
558           {fltk::Widget} kg_l1 {
559             label {C\#0}
560             xywh {35 20 45 15} align 4
561             class KeyGrabber
562           }
563           {fltk::Widget} kg_l2 {
564             label D0
565             xywh {35 35 45 15} align 4
566             class KeyGrabber
567           }
568           {fltk::Widget} kg_l3 {
569             label {D\#0}
570             xywh {35 50 45 15} align 4
571             class KeyGrabber
572           }
573           {fltk::Widget} kg_l4 {
574             label E0
575             xywh {35 65 45 15} align 4
576             class KeyGrabber
577           }
578           {fltk::Widget} kg_l5 {
579             label F0
580             xywh {35 80 45 15} align 4
581             class KeyGrabber
582           }
583           {fltk::Widget} kg_l6 {
584             label {F\#0}
585             xywh {35 95 45 15} align 4
586             class KeyGrabber
587           }
588           {fltk::Widget} kg_l7 {
589             label G0
590             xywh {35 110 45 15} align 4
591             class KeyGrabber
592           }
593           {fltk::Widget} kg_l8 {
594             label {G\#0}
595             xywh {35 125 45 15} align 4
596             class KeyGrabber
597           }
598           {fltk::Widget} kg_l9 {
599             label A0
600             xywh {35 140 45 15} align 4
601             class KeyGrabber
602           }
603           {fltk::Widget} kg_l10 {
604             label {A\#0}
605             callback {;}
606             xywh {35 155 45 15} align 4
607             class KeyGrabber
608           }
609           {fltk::Widget} kg_l11 {
610             label B0
611             xywh {35 170 45 15} align 4
612             class KeyGrabber
613           }
614           {fltk::Widget} kg_l12 {
615             label C1
616             xywh {35 185 45 15} align 4
617             class KeyGrabber
618           }
619           {fltk::Widget} kg_l13 {
620             label {C\#1}
621             xywh {35 200 45 15} align 4
622             class KeyGrabber
623           }
624           {fltk::Widget} kg_l14 {
625             label D1
626             xywh {35 215 45 15} align 4
627             class KeyGrabber
628           }
629           {fltk::Widget} kg_l15 {
630             label {D\#1}
631             xywh {35 230 45 15} align 4
632             class KeyGrabber
633           }
634           {fltk::Widget} kg_l16 {
635             label E1
636             xywh {35 245 45 15} align 4
637             class KeyGrabber
638           }
639           {fltk::Widget} kg_u0 {
640             label C1
641             xywh {130 5 45 15} align 4
642             class KeyGrabber
643           }
644           {fltk::Widget} kg_u1 {
645             label {C\#1}
646             xywh {130 20 45 15} align 4
647             class KeyGrabber
648           }
649           {fltk::Widget} kg_u2 {
650             label D1
651             xywh {130 35 45 15} align 4
652             class KeyGrabber
653           }
654           {fltk::Widget} kg_u3 {
655             label {D\#1}
656             xywh {130 50 45 15} align 4
657             class KeyGrabber
658           }
659           {fltk::Widget} kg_u4 {
660             label E1
661             xywh {130 65 45 15} align 4
662             class KeyGrabber
663           }
664           {fltk::Widget} kg_u5 {
665             label F1
666             xywh {130 80 45 15} align 4
667             class KeyGrabber
668           }
669           {fltk::Widget} kg_u6 {
670             label {F\#1}
671             xywh {130 95 45 15} align 4
672             class KeyGrabber
673           }
674           {fltk::Widget} kg_u7 {
675             label G1
676             xywh {130 110 45 15} align 4
677             class KeyGrabber
678           }
679           {fltk::Widget} kg_u8 {
680             label {G\#1}
681             xywh {130 125 45 15} align 4
682             class KeyGrabber
683           }
684           {fltk::Widget} kg_u9 {
685             label A1
686             xywh {130 140 45 15} align 4
687             class KeyGrabber
688           }
689           {fltk::Widget} kg_u10 {
690             label {A\#1}
691             xywh {130 155 45 15} align 4
692             class KeyGrabber
693           }
694           {fltk::Widget} kg_u11 {
695             label B1
696             xywh {130 170 45 15} align 4
697             class KeyGrabber
698           }
699           {fltk::Widget} kg_u12 {
700             label C2
701             xywh {130 185 45 15} align 4
702             class KeyGrabber
703           }
704           {fltk::Widget} kg_u13 {
705             label {C\#2}
706             xywh {130 200 45 15} align 4
707             class KeyGrabber
708           }
709           {fltk::Widget} kg_u14 {
710             label D2
711             xywh {130 215 45 15} align 4
712             class KeyGrabber
713           }
714           {fltk::Widget} kg_u15 {
715             label {D\#2}
716             xywh {130 230 45 15} align 4
717             class KeyGrabber
718           }
719           {fltk::Widget} kg_u16 {
720             label E2
721             xywh {130 245 45 15} align 4
722             class KeyGrabber
723           }
724           {fltk::Widget} kg_u17 {
725             label F2
726             xywh {265 5 45 15} align 4
727             class KeyGrabber
728           }
729           {fltk::Widget} kg_u18 {
730             label {F\#2}
731             xywh {265 20 45 15} align 4
732             class KeyGrabber
733           }
734           {fltk::Widget} kg_u19 {
735             label G2
736             xywh {265 35 45 15} align 4
737             class KeyGrabber
738           }
739           {fltk::Widget} kg_u20 {
740             label {G\#2}
741             xywh {265 50 45 15} align 4
742             class KeyGrabber
743           }
744           {fltk::Widget} kg_zi {
745             label {zoom in}
746             xywh {265 65 45 15} align 4
747             class KeyGrabber
748           }
749           {fltk::Widget} kg_zo {
750             label {zoom out}
751             xywh {265 80 45 15} align 4
752             class KeyGrabber
753           }
754           {fltk::Widget} kg_ou {
755             label {octave up}
756             xywh {265 95 45 15} align 4
757             class KeyGrabber
758           }
759           {fltk::Widget} kg_od {
760             label {octave down}
761             xywh {265 110 45 15} align 4
762             class KeyGrabber
763           }
764         }
765         {fltk::Group} {} {
766           label colors open
767           xywh {0 15 320 270} hide
768         } {
769           {fltk::Button} {} {
770             label apply
771             xywh {250 245 65 20}
772           }
773           {fltk::Choice} {} {
774             label presets open
775             xywh {55 10 100 20}
776           } {
777             {fltk::Item} {} {
778               label windo
779               }
780             {fltk::Item} {} {
781               label midnight
782               }
783             {fltk::Item} {} {
784               label xterm
785               }
786           }
787         }
788       }
789     }
790     {fltk::Window} help_window {
791       label help
792       xywh {519 345 580 370} hide resizable
793       extra_code {o->size_range(580,370);}
794     } {
795       {fltk::TabGroup} {} {open
796         xywh {0 0 580 370}
797       } {
798         {fltk::Group} {} {
799           label info open
800           xywh {0 25 580 345} resizable
801         } {
802           {fltk::Input} title_text {
803             label Title
804             xywh {55 5 520 20}
805           }
806           {fltk::Input} author_text {
807             label Author
808             xywh {55 30 520 20}
809           }
810           {fltk::TextEditor} info_text {
811             xywh {5 55 570 285} resizable textfont 4
812           }
813         }
814         {fltk::Group} {} {
815           label controls open
816           xywh {0 25 580 345} hide
817         } {
818           {fltk::TextDisplay} {} {
819             xywh {5 5 570 335} resizable textfont 4
820             extra_code {load_text(o,ROOT_DATA_DIR"doc/controls.txt");}
821           }
822         }
823         {fltk::Group} {} {
824           label guide open
825           xywh {0 25 580 345} hide
826         } {
827           {fltk::TextDisplay} {} {
828             xywh {5 5 570 335} resizable textfont 4
829             extra_code {load_text(o,ROOT_DATA_DIR"doc/guide.txt");}
830           }
831         }
832         {fltk::Group} {} {
833           label license open
834           xywh {0 25 580 345} hide
835         } {
836           {fltk::TextDisplay} {} {
837             xywh {5 5 570 335} resizable textfont 4
838             extra_code {load_text(o,ROOT_DATA_DIR"doc/license.txt");}
839           }
840         }
841         {fltk::Group} {} {
842           label about open
843           xywh {0 25 580 345} hide
844         } {
845           {fltk::TextDisplay} {} {
846             xywh {5 5 570 335} resizable textfont 4
847             extra_code {load_text(o,ROOT_DATA_DIR"doc/README");}
848           }
849         }
850       }
851     }
852     {fltk::Window} action_window {
853       label menu
854       xywh {286 302 100 130} horizontal hide
855     } {
856       {fltk::Button} {} {
857         label new
858         callback {reset_song();}
859         xywh {5 5 90 20}
860       }
861       {fltk::Button} {} {
862         label save
863         callback {action_window->hide();
864 save();}
865         xywh {5 25 90 20}
866       }
867       {fltk::Button} {} {
868         label {save as}
869         callback {action_window->hide();
870 save(fltk::file_chooser("save file",NULL,get_last_dir()));}
871         xywh {5 45 90 20}
872       }
873       {fltk::Button} {} {
874         label load
875         callback {action_window->hide();
876 if(load(fltk::file_chooser("open file",NULL,get_last_dir()))<0){
877   reset_song();
879         xywh {5 65 90 20}
880       }
881       {fltk::Button} {} {
882         label import
883         callback {action_window->hide();
884 if(loadsmf(fltk::file_chooser("import file",NULL,get_last_dir()))<0){
885   reset_song();
887         xywh {5 85 90 20}
888       }
889       {fltk::Button} {} {
890         label export
891         callback {action_window->hide();
892 savesmf(fltk::file_chooser("export file",NULL,get_last_dir()));}
893         xywh {5 105 90 20}
894       }
895     }
896     {fltk::Window} scope_window {
897       label scope
898       xywh {647 310 425 280} hide resizable
899     } {
900       {fltk::TextDisplay} scope {
901         xywh {5 5 415 245} textfont 4 color 0x280000 textcolor 0xff0000
902         extra_code {o->wrap_mode(1);}
903       }
904       {fltk::Group} {} {
905         xywh {5 255 410 20}
906       } {
907         {fltk::Button} {} {
908           label on
909           callback {if(o->state()){
910   turnonscope();
912 else{
913   turnoffscope();
915           xywh {0 0 40 20}
916           extra_code {o->type(fltk::Button::TOGGLE);}
917         }
918         {fltk::InvisibleBox} {} {
919           xywh {45 0 95 20} resizable
920         }
921       }
922     }
923     code {loop_toggle->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/loop.gif"));
924 color_toggle->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/color.gif"));
925 scope_button->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/conf.gif"));
926 file_button->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/file.gif"));
927 help_button->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/help.gif"));
929 qbutton4->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q4.gif"));
930 qbutton8->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q8.gif"));
931 qbutton16->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q16.gif"));
932 qbutton32->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q32.gif"));
933 qbutton64->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q64.gif"));
934 qbutton128->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q128.gif"));
935 qbutton0->image(fltk::SharedImage::get(ROOT_DATA_DIR"gfx/q0.gif"));} {}
936     code {track_info->set_rec(0);} {}
937     code {start_monitor();} {}
938     code {main_window->show();} {}
939   }