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