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