1 // generated by Fast Light User Interface Designer (fluid) version 2.1000
5 Epichord - a midi sequencer
6 Copyright (C) 2008 Evan Rinehart
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to
21 The Free Software Foundation, Inc.
22 51 Franklin Street, Fifth Floor
23 Boston, MA 02110-1301, USA
25 #include <fltk/events.h>
26 #include <fltk/file_chooser.h>
33 inline void UI::cb_main_window_i(fltk::Window
* o
, void*) {
34 config_window
->hide();
36 action_window
->hide();
39 void UI::cb_main_window(fltk::Window
* o
, void* v
) {
40 ((UI
*)(o
->user_data()))->cb_main_window_i(o
,v
);
43 inline void UI::cb__i(fltk::Button
*, void*) {
44 ui
->track_info
->toggle_controls();
46 void UI::cb_(fltk::Button
* o
, void* v
) {
47 ((UI
*)(o
->parent()->parent()->parent()->parent()->user_data()))->cb__i(o
,v
);
50 inline void UI::cb_1_i(fltk::Button
*, void*) {
51 ui
->pattern_edit
->hide();
52 ui
->song_edit
->activate();
53 ui
->song_edit
->show();
54 ui
->song_edit
->take_focus();
56 void UI::cb_1(fltk::Button
* o
, void* v
) {
57 ((UI
*)(o
->parent()->parent()->parent()->parent()->user_data()))->cb_1_i(o
,v
);
60 inline void UI::cb_play_button_i(fltk::Button
*, void*) {
63 void UI::cb_play_button(fltk::Button
* o
, void* v
) {
64 ((UI
*)(o
->parent()->parent()->user_data()))->cb_play_button_i(o
,v
);
67 inline void UI::cb_stop_button_i(fltk::Button
*, void*) {
70 void UI::cb_stop_button(fltk::Button
* o
, void* v
) {
71 ((UI
*)(o
->parent()->parent()->user_data()))->cb_stop_button_i(o
,v
);
74 inline void UI::cb_record_button_i(fltk::Button
*, void*) {
75 toggle_backend_recording();
77 void UI::cb_record_button(fltk::Button
* o
, void* v
) {
78 ((UI
*)(o
->parent()->parent()->user_data()))->cb_record_button_i(o
,v
);
81 inline void UI::cb_loop_toggle_i(fltk::Button
*, void*) {
84 void UI::cb_loop_toggle(fltk::Button
* o
, void* v
) {
85 ((UI
*)(o
->parent()->parent()->user_data()))->cb_loop_toggle_i(o
,v
);
88 inline void UI::cb_config_button_i(fltk::Button
*, void*) {
89 ui
->config_window
->show();
91 void UI::cb_config_button(fltk::Button
* o
, void* v
) {
92 ((UI
*)(o
->parent()->parent()->user_data()))->cb_config_button_i(o
,v
);
95 inline void UI::cb_file_button_i(fltk::Button
*, void*) {
96 //load(fltk::file_chooser("save file",NULL,"~"));
97 ui
->action_window
->show();
99 void UI::cb_file_button(fltk::Button
* o
, void* v
) {
100 ((UI
*)(o
->parent()->parent()->user_data()))->cb_file_button_i(o
,v
);
103 inline void UI::cb_help_button_i(fltk::Button
*, void*) {
106 void UI::cb_help_button(fltk::Button
* o
, void* v
) {
107 ((UI
*)(o
->parent()->parent()->user_data()))->cb_help_button_i(o
,v
);
110 inline void UI::cb_qbutton4_i(fltk::Button
*, void*) {
113 void UI::cb_qbutton4(fltk::Button
* o
, void* v
) {
114 ((UI
*)(o
->parent()->parent()->parent()->user_data()))->cb_qbutton4_i(o
,v
);
117 inline void UI::cb_qbutton8_i(fltk::Button
*, void*) {
120 void UI::cb_qbutton8(fltk::Button
* o
, void* v
) {
121 ((UI
*)(o
->parent()->parent()->parent()->user_data()))->cb_qbutton8_i(o
,v
);
124 inline void UI::cb_qbutton16_i(fltk::Button
*, void*) {
127 void UI::cb_qbutton16(fltk::Button
* o
, void* v
) {
128 ((UI
*)(o
->parent()->parent()->parent()->user_data()))->cb_qbutton16_i(o
,v
);
131 inline void UI::cb_qbutton32_i(fltk::Button
*, void*) {
134 void UI::cb_qbutton32(fltk::Button
* o
, void* v
) {
135 ((UI
*)(o
->parent()->parent()->parent()->user_data()))->cb_qbutton32_i(o
,v
);
138 inline void UI::cb_qbutton64_i(fltk::Button
*, void*) {
141 void UI::cb_qbutton64(fltk::Button
* o
, void* v
) {
142 ((UI
*)(o
->parent()->parent()->parent()->user_data()))->cb_qbutton64_i(o
,v
);
145 inline void UI::cb_qbutton128_i(fltk::Button
*, void*) {
148 void UI::cb_qbutton128(fltk::Button
* o
, void* v
) {
149 ((UI
*)(o
->parent()->parent()->parent()->user_data()))->cb_qbutton128_i(o
,v
);
152 inline void UI::cb_qbutton0_i(fltk::Button
*, void*) {
155 void UI::cb_qbutton0(fltk::Button
* o
, void* v
) {
156 ((UI
*)(o
->parent()->parent()->parent()->user_data()))->cb_qbutton0_i(o
,v
);
159 inline void UI::cb_bpm_wheel_i(fltk::ThumbWheel
* o
, void*) {
160 set_bpm((int)o
->value());
161 ui
->bpm_output
->value(o
->value());
163 void UI::cb_bpm_wheel(fltk::ThumbWheel
* o
, void* v
) {
164 ((UI
*)(o
->parent()->user_data()))->cb_bpm_wheel_i(o
,v
);
167 inline void UI::cb_new_i(fltk::Button
*, void*) {
170 track_info
->update();
171 action_window
->hide();
173 void UI::cb_new(fltk::Button
* o
, void* v
) {
174 ((UI
*)(o
->parent()->user_data()))->cb_new_i(o
,v
);
177 inline void UI::cb_save_i(fltk::Button
*, void*) {
178 action_window
->hide();
181 void UI::cb_save(fltk::Button
* o
, void* v
) {
182 ((UI
*)(o
->parent()->user_data()))->cb_save_i(o
,v
);
185 inline void UI::cb_save1_i(fltk::Button
*, void*) {
186 action_window
->hide();
187 save(fltk::file_chooser("save file",NULL
,get_last_dir()));
189 void UI::cb_save1(fltk::Button
* o
, void* v
) {
190 ((UI
*)(o
->parent()->user_data()))->cb_save1_i(o
,v
);
193 inline void UI::cb_load_i(fltk::Button
*, void*) {
194 action_window
->hide();
195 load(fltk::file_chooser("open file",NULL
,get_last_dir()));
197 void UI::cb_load(fltk::Button
* o
, void* v
) {
198 ((UI
*)(o
->parent()->user_data()))->cb_load_i(o
,v
);
201 inline void UI::cb_export_i(fltk::Button
*, void*) {
202 action_window
->hide();
203 savesmf(fltk::file_chooser("export file",NULL
,get_last_dir()));
205 void UI::cb_export(fltk::Button
* o
, void* v
) {
206 ((UI
*)(o
->parent()->user_data()))->cb_export_i(o
,v
);
211 {fltk::Window
* o
= main_window
= new fltk::Window(640, 480, "Epichord");
213 o
->callback((fltk::Callback
*)cb_main_window
, (void*)(this));
215 {fltk::Group
* o
= new fltk::Group(0, 0, 640, 445);
217 {fltk::Group
* o
= song_edit
= new fltk::Group(0, 0, 640, 445);
219 {fltk::Group
* o
= new fltk::Group(0, 0, 255, 445);
221 o
->box(fltk::FLAT_BOX
);
223 {TrackInfo
* o
= track_info
= new TrackInfo(0, 15, 255, 415, "track info");
225 fltk::Group::current()->resizable(o
);
227 {fltk::Button
* o
= new fltk::Button(0, 0, 255, 15, "@+");
228 o
->callback((fltk::Callback
*)cb_
);
232 {fltk::Group
* o
= new fltk::Group(255, 0, 385, 15);
234 {Timeline
* o
= song_timeline
= new Timeline(0, 0, 370, 15, "timeline");
235 fltk::Group::current()->resizable(o
);
241 {fltk::ScrollGroup
* o
= song_scroll
= new fltk::ScrollGroup(255, 15, 385, 430);
244 {Arranger
* o
= arranger
= new Arranger(0, 0, 245, 220, "arranger");
245 o
->box(fltk::FLAT_BOX
);
246 o
->resize(1000,1000);
249 o
->type(fltk::ScrollGroup::BOTH_ALWAYS
);
250 fltk::Group::current()->resizable(o
);
254 {fltk::Group
* o
= pattern_edit
= new fltk::Group(0, 0, 640, 445);
257 {fltk::Group
* o
= new fltk::Group(45, 0, 595, 445);
259 {fltk::Group
* o
= new fltk::Group(0, 0, 595, 15);
261 {Timeline
* o
= pattern_timeline
= new Timeline(0, 0, 580, 15, "timeline");
262 o
->box(fltk::FLAT_BOX
);
263 fltk::Group::current()->resizable(o
);
267 {fltk::ScrollGroup
* o
= pattern_scroll
= new fltk::ScrollGroup(0, 15, 595, 355);
268 o
->box(fltk::FLAT_BOX
);
270 o
->when(fltk::WHEN_CHANGED
);
272 {PianoRoll
* o
= piano_roll
= new PianoRoll(0, 0, 595, 355, "pianoroll");
273 o
->box(fltk::FLAT_BOX
);
274 fltk::Group::current()->resizable(o
);
278 o
->type(fltk::ScrollGroup::BOTH_ALWAYS
);
279 fltk::Group::current()->resizable(o
);
281 {fltk::Group
* o
= new fltk::Group(0, 370, 595, 75);
283 {EventEdit
* o
= event_edit
= new EventEdit(0, 0, 580, 75, "event editor");
284 o
->box(fltk::FLAT_BOX
);
285 fltk::Group::current()->resizable(o
);
287 {fltk::Button
* o
= new fltk::Button(580, 0, 15, 15, "E");
288 o
->tooltip("pick event type");
290 {fltk::Button
* o
= new fltk::Button(580, 15, 15, 15, "Q");
291 o
->tooltip("quantization resolution");
293 new fltk::Button(580, 30, 15, 15, "?");
294 new fltk::Button(580, 45, 15, 15, "?");
295 new fltk::Button(580, 60, 15, 15, "?");
299 fltk::Group::current()->resizable(o
);
301 {fltk::Group
* o
= new fltk::Group(0, 0, 45, 445);
303 new fltk::Button(0, 0, 45, 15, "@+");
304 {fltk::Group
* o
= new fltk::Group(0, 15, 45, 340);
307 {TrackSelect
* o
= track_select
= new TrackSelect(0, 35, 45, 305, "track picker");
310 {SampleView
* o
= sample_view
= new SampleView(0, 35, 45, 305, "sample names");
313 {Keyboard
* o
= keyboard
= new Keyboard(0, 0, 45, 340, "keyboard");
317 fltk::Group::current()->resizable(o
);
319 {fltk::Button
* o
= new fltk::Button(0, 370, 45, 75, "@<-");
321 o
->callback((fltk::Callback
*)cb_1
);
328 fltk::Group::current()->resizable(o
);
330 {fltk::Group
* o
= new fltk::Group(0, 445, 640, 35);
331 o
->box(fltk::UP_BOX
);
333 {fltk::Button
* o
= play_button
= new fltk::Button(5, 5, 25, 25, "@>");
334 o
->labelcolor((fltk::Color
)0x800000);
335 o
->callback((fltk::Callback
*)cb_play_button
);
337 {fltk::Button
* o
= stop_button
= new fltk::Button(35, 5, 25, 25, "@square");
338 o
->labelcolor((fltk::Color
)0x800000);
339 o
->callback((fltk::Callback
*)cb_stop_button
);
341 {fltk::Button
* o
= record_button
= new fltk::Button(65, 5, 25, 25, "@circle");
342 o
->labelcolor((fltk::Color
)0xff000000);
343 o
->callback((fltk::Callback
*)cb_record_button
);
344 o
->type(fltk::Button::TOGGLE
);
346 {fltk::Group
* o
= new fltk::Group(95, 0, 20, 35);
348 fltk::Group::current()->resizable(o
);
350 {fltk::Button
* o
= loop_toggle
= new fltk::Button(490, 5, 25, 25);
351 o
->callback((fltk::Callback
*)cb_loop_toggle
);
352 o
->tooltip("toggle looping");
353 o
->type(fltk::Button::TOGGLE
);
355 {fltk::Button
* o
= keyboard_toggle
= new fltk::Button(520, 5, 25, 25);
356 o
->tooltip("toggle keyboard");
357 o
->type(fltk::Button::TOGGLE
);
359 {fltk::Button
* o
= config_button
= new fltk::Button(550, 5, 25, 25);
360 o
->callback((fltk::Callback
*)cb_config_button
);
361 o
->tooltip("config");
363 {fltk::Button
* o
= file_button
= new fltk::Button(580, 5, 25, 25);
364 o
->callback((fltk::Callback
*)cb_file_button
);
366 {fltk::Button
* o
= help_button
= new fltk::Button(610, 5, 25, 25);
367 o
->callback((fltk::Callback
*)cb_help_button
);
370 {fltk::Group
* o
= new fltk::Group(310, 5, 175, 25);
372 {fltk::Button
* o
= qbutton4
= new fltk::Button(0, 0, 25, 25);
373 o
->callback((fltk::Callback
*)cb_qbutton4
);
374 o
->type(fltk::Button::TOGGLE
);
376 {fltk::Button
* o
= qbutton8
= new fltk::Button(25, 0, 25, 25);
377 o
->callback((fltk::Callback
*)cb_qbutton8
);
378 o
->type(fltk::Button::TOGGLE
);
380 {fltk::Button
* o
= qbutton16
= new fltk::Button(50, 0, 25, 25);
381 o
->callback((fltk::Callback
*)cb_qbutton16
);
382 o
->type(fltk::Button::TOGGLE
);
385 {fltk::Button
* o
= qbutton32
= new fltk::Button(75, 0, 25, 25);
386 o
->callback((fltk::Callback
*)cb_qbutton32
);
387 o
->type(fltk::Button::TOGGLE
);
389 {fltk::Button
* o
= qbutton64
= new fltk::Button(100, 0, 25, 25);
390 o
->callback((fltk::Callback
*)cb_qbutton64
);
391 o
->type(fltk::Button::TOGGLE
);
393 {fltk::Button
* o
= qbutton128
= new fltk::Button(125, 0, 25, 25);
394 o
->callback((fltk::Callback
*)cb_qbutton128
);
395 o
->type(fltk::Button::TOGGLE
);
397 {fltk::Button
* o
= qbutton0
= new fltk::Button(150, 0, 25, 25);
398 o
->callback((fltk::Callback
*)cb_qbutton0
);
399 o
->type(fltk::Button::TOGGLE
);
406 o
->size_range(640,455);
409 {fltk::Window
* o
= config_window
= new fltk::Window(315, 260, "config");
411 o
->user_data((void*)(this));
413 {fltk::ValueInput
* o
= new fltk::ValueInput(145, 10, 45, 20, "beats per measure");
419 {fltk::ValueInput
* o
= new fltk::ValueInput(145, 35, 45, 20, "measures per phrase");
424 {fltk::ValueOutput
* o
= bpm_output
= new fltk::ValueOutput(145, 60, 45, 20, "bpm");
430 {fltk::ThumbWheel
* o
= bpm_wheel
= new fltk::ThumbWheel(195, 60, 105, 20);
435 o
->callback((fltk::Callback
*)cb_bpm_wheel
);
436 o
->align(fltk::ALIGN_LEFT
);
438 {fltk::ValueInput
* o
= new fltk::ValueInput(145, 85, 45, 20, "metronome lead-in");
443 {fltk::CheckButton
* o
= new fltk::CheckButton(145, 110, 25, 25, "always hard copy");
444 o
->align(fltk::ALIGN_LEFT
);
446 {fltk::CheckButton
* o
= new fltk::CheckButton(285, 110, 25, 25, "auto track name");
447 o
->align(fltk::ALIGN_LEFT
);
449 {fltk::CheckButton
* o
= new fltk::CheckButton(145, 135, 25, 26, "record pass-thru");
450 o
->set_flag(fltk::STATE
);
451 o
->align(fltk::ALIGN_LEFT
);
453 {fltk::CheckButton
* o
= new fltk::CheckButton(285, 135, 25, 26, "play note insertion");
454 o
->set_flag(fltk::STATE
);
455 o
->align(fltk::ALIGN_LEFT
);
457 {fltk::CheckButton
* o
= new fltk::CheckButton(145, 160, 25, 26, "follow playback");
458 o
->set_flag(fltk::STATE
);
459 o
->align(fltk::ALIGN_LEFT
);
461 {fltk::CheckButton
* o
= new fltk::CheckButton(285, 160, 25, 26, "play note selection");
462 o
->set_flag(fltk::STATE
);
463 o
->align(fltk::ALIGN_LEFT
);
465 {fltk::CheckButton
* o
= new fltk::CheckButton(285, 185, 25, 25, "quantize note off");
466 o
->set_flag(fltk::STATE
);
467 o
->align(fltk::ALIGN_LEFT
);
469 {fltk::Choice
* o
= new fltk::Choice(145, 215, 160, 25, "record mode");
471 new fltk::Item("merge");
472 new fltk::Item("overwrite");
473 new fltk::Item("layer");
479 {fltk::Window
* o
= help_window
= new fltk::Window(580, 370, "help");
481 o
->user_data((void*)(this));
483 {fltk::TabGroup
* o
= new fltk::TabGroup(0, 0, 580, 370);
485 {fltk::Group
* o
= new fltk::Group(0, 25, 580, 345, "info");
487 title_text
= new fltk::Input(55, 5, 520, 20, "Title");
488 author_text
= new fltk::Input(55, 30, 520, 20, "Author");
489 {fltk::TextEditor
* o
= info_text
= new fltk::TextEditor(5, 55, 570, 285);
490 o
->textfont(fltk::COURIER
);
491 fltk::Group::current()->resizable(o
);
494 fltk::Group::current()->resizable(o
);
496 {fltk::Group
* o
= new fltk::Group(0, 25, 580, 345, "controls");
499 {fltk::TextDisplay
* o
= new fltk::TextDisplay(5, 5, 570, 335);
500 o
->textfont(fltk::COURIER
);
501 fltk::Group::current()->resizable(o
);
502 load_text(o
,ROOT_DATA_DIR
"doc/controls.txt");
506 {fltk::Group
* o
= new fltk::Group(0, 25, 580, 345, "guide");
509 {fltk::TextDisplay
* o
= new fltk::TextDisplay(5, 5, 570, 335);
510 o
->textfont(fltk::COURIER
);
511 fltk::Group::current()->resizable(o
);
512 load_text(o
,ROOT_DATA_DIR
"doc/guide.txt");
516 {fltk::Group
* o
= new fltk::Group(0, 25, 580, 345, "license");
519 {fltk::TextDisplay
* o
= new fltk::TextDisplay(5, 5, 570, 335);
520 o
->textfont(fltk::COURIER
);
521 fltk::Group::current()->resizable(o
);
522 load_text(o
,ROOT_DATA_DIR
"doc/license.txt");
526 {fltk::Group
* o
= new fltk::Group(0, 25, 580, 345, "about");
529 {fltk::TextDisplay
* o
= new fltk::TextDisplay(5, 5, 570, 335);
530 o
->textfont(fltk::COURIER
);
531 fltk::Group::current()->resizable(o
);
532 load_text(o
,ROOT_DATA_DIR
"doc/README");
539 o
->size_range(555,370);
542 {fltk::Window
* o
= action_window
= new fltk::Window(100, 130, "menu");
544 o
->user_data((void*)(this));
546 {fltk::Button
* o
= new fltk::Button(5, 5, 90, 20, "new");
547 o
->callback((fltk::Callback
*)cb_new
);
549 {fltk::Button
* o
= new fltk::Button(5, 25, 90, 20, "save");
550 o
->callback((fltk::Callback
*)cb_save
);
552 {fltk::Button
* o
= new fltk::Button(5, 45, 90, 20, "save as");
553 o
->callback((fltk::Callback
*)cb_save1
);
555 {fltk::Button
* o
= new fltk::Button(5, 65, 90, 20, "load");
556 o
->callback((fltk::Callback
*)cb_load
);
558 new fltk::Button(5, 85, 90, 20, "import");
559 {fltk::Button
* o
= new fltk::Button(5, 105, 90, 20, "export");
560 o
->callback((fltk::Callback
*)cb_export
);
565 {fltk::Window
* o
= key_config
= new fltk::Window(650, 370, "key layout");
568 o
->user_data((void*)(this));
570 {fltk::Widget
* o
= new fltk::Widget(45, 105, 25, 25, "C1");
571 o
->align(fltk::ALIGN_BOTTOM
);
573 {fltk::Widget
* o
= new fltk::Widget(615, 15, 25, 25, "octave up");
574 o
->align(fltk::ALIGN_LEFT
);
576 {fltk::Widget
* o
= new fltk::Widget(615, 75, 25, 25, "zoom in");
577 o
->align(fltk::ALIGN_LEFT
);
579 {fltk::Widget
* o
= new fltk::Widget(615, 105, 25, 25, "zoom out");
580 o
->align(fltk::ALIGN_LEFT
);
584 loop_toggle
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/loop.gif"));
585 keyboard_toggle
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/keys.gif"));
586 config_button
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/conf.gif"));
587 file_button
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/file.gif"));
588 help_button
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/help.gif"));
590 qbutton4
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/q4.gif"));
591 qbutton8
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/q8.gif"));
592 qbutton16
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/q16.gif"));
593 qbutton32
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/q32.gif"));
594 qbutton64
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/q64.gif"));
595 qbutton128
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/q128.gif"));
596 qbutton0
->image(fltk::SharedImage::get(ROOT_DATA_DIR
"gfx/q0.gif"));