Assists music production by grouping standalone programs into sessions. Community version of "Non Session Manager".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1099 lines
30KB

  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0108
  3. header_name {.H}
  4. code_name {.C}
  5. comment {//
  6. // Copyright (C) 2008 Jonathan Moore Liles
  7. //
  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.
  12. //
  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.
  17. //
  18. // You should have received a copy of the GNU General Public License
  19. // along with this program; if not, write to the Free Software
  20. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. //
  22. } {in_source in_header
  23. }
  24. decl {const float STATUS_UPDATE_FREQ = 0.5f;} {}
  25. decl {\#include "Fl_Menu_Settings.H"} {}
  26. decl {\#include "Timeline.H"} {}
  27. decl {\#include "Transport.H"} {}
  28. decl {\#include "Loggable.H"} {}
  29. decl {\#include "Project.H"} {}
  30. decl {\#include "Clock.H"} {public
  31. }
  32. decl {\#include "Track.H" // for capture_format} {}
  33. decl {\#include "Waveform.H" // for options} {}
  34. decl {\#include "Audio_Region.H" // for options} {}
  35. decl {\#include "Control_Sequence.H" // for options} {}
  36. decl {\#include <FL/Fl_File_Chooser.H>} {}
  37. decl {\#include <Fl/Fl_Shared_Image.H>} {}
  38. decl {\#include <FL/Fl.H>} {}
  39. decl {\#include <FL/fl_ask.H>} {}
  40. decl {\#include "Engine/Engine.H"} {}
  41. decl {\#include "Engine/Audio_File.H" // for supported formats} {}
  42. decl {class About_Dialog;} {}
  43. decl {extern char project_display_name[256];} {global
  44. }
  45. decl {extern char *user_config_dir;} {global
  46. }
  47. class TLE {open
  48. } {
  49. decl {Fl_Color system_colors[3];} {}
  50. Function {save()} {} {
  51. code {const char options_filename[] = "options";
  52. // const char state_filename[] = "state";
  53. // save options
  54. char *path;
  55. asprintf( &path, "%s/%s", user_config_dir, options_filename );
  56. ((Fl_Menu_Settings*)menubar)->dump( menubar->find_item( "&Options" ), path );
  57. free( path );} {}
  58. }
  59. Function {quit()} {} {
  60. code {Project::close();
  61. save();
  62. while ( Fl::first_window() ) Fl::first_window()->hide();} {}
  63. }
  64. Function {open( const char *name )} {} {
  65. code {if ( ! name )
  66. return;
  67. int r = Project::open( name );
  68. if ( r < 0 )
  69. {
  70. const char *s = Project::errstr( r );
  71. fl_alert( "Could not open project \\"%s\\":\\n\\n\\t%s", name, s );
  72. }} {}
  73. }
  74. Function {save_timeline_settings()} {open
  75. } {
  76. code {if ( Project::open() )
  77. {
  78. // save project local options (Timeline menu)
  79. ((Fl_Menu_Settings*)menubar)->dump( menubar->find_item( "&Project/Se&ttings" ), "options" );
  80. char path[256];
  81. snprintf( path, sizeof( path ), "%s/%s", user_config_dir, ".default_project_settings" );
  82. ((Fl_Menu_Settings*)menubar)->load( menubar->find_item( "&Project/Se&ttings" ), path );
  83. }} {}
  84. }
  85. Function {load_timeline_settings()} {open
  86. } {
  87. code {if ( Project::open() )
  88. {
  89. ((Fl_Menu_Settings*)menubar)->load( menubar->find_item( "&Project/Se&ttings" ), "options" );
  90. }
  91. update_menu();
  92. project_name->redraw();} {}
  93. }
  94. Function {run()} {} {
  95. code {update_menu();
  96. main_window->show();
  97. Fl::lock();
  98. // Fl::run();} {}
  99. }
  100. Function {TLE()} {open
  101. } {
  102. code {Fl::visual( FL_DOUBLE | FL_RGB8 );
  103. make_window();
  104. Fl::visible_focus( 0 );
  105. Fl::get_system_colors();
  106. Fl::scheme( "plastic" );
  107. system_colors[ 0 ] = (Fl_Color)Fl::get_color( FL_BACKGROUND_COLOR );
  108. system_colors[ 1 ] = (Fl_Color)Fl::get_color( FL_FOREGROUND_COLOR );
  109. system_colors[ 2 ] = (Fl_Color)Fl::get_color( FL_BACKGROUND2_COLOR );
  110. Fl::add_timeout( STATUS_UPDATE_FREQ, update_cb, this );
  111. fl_message_icon()->box( FL_RSHADOW_BOX );
  112. fl_message_icon()->labelcolor( FL_BLACK );
  113. fl_message_icon()->color( FL_RED );
  114. fl_message_font( FL_HELVETICA, 18 );
  115. std::list <const char *> formats;
  116. Audio_File::all_supported_formats( formats );
  117. for ( std::list <const char *>::const_iterator f = formats.begin(); f != formats.end(); ++f )
  118. {
  119. // capture_format_menu->add( *f, FL_MENU_RADIO, 0, 0, 0 );
  120. //;
  121. char pat[256];
  122. snprintf( pat, sizeof( pat ), "&Project/Se&ttings/Capture Format/%s", *f );
  123. menubar->add( pat, 0, &TLE::capture_format_cb, this, FL_MENU_RADIO );
  124. }
  125. menubar->picked( menubar->find_item( "&Project/Se&ttings/Capture Format/Wav 24" ) );
  126. char *path;
  127. asprintf( &path, "%s/options", user_config_dir );
  128. ((Fl_Menu_Settings*)menubar)->load( menubar->find_item( "&Options" ), path );
  129. free( path );
  130. menubar->add( "&Timeline", 0, 0, const_cast< Fl_Menu_Item *>( timeline->menu->menu() ), FL_SUBMENU_POINTER );
  131. // save a copy of the project settings menu so that we can restore the defaults later
  132. {
  133. char path[512];
  134. snprintf( path, sizeof( path ), "%s/%s", user_config_dir, ".default_project_settings" );
  135. ((Fl_Menu_Settings*)menubar)->dump( menubar->find_item( "&Project/Se&ttings" ), path );
  136. }
  137. Loggable::progress_callback( &TLE::progress_cb, this );} {}
  138. }
  139. Function {make_window()} {open
  140. } {
  141. Fl_Window main_window {
  142. label Timeline
  143. callback {if ( Fl::event_key() != FL_Escape )
  144. o->hide();} open
  145. private xywh {133 113 1025 770} type Double resizable xclass Non_DAW visible
  146. } {
  147. Fl_Menu_Bar menubar {open
  148. private xywh {0 0 1024 25}
  149. } {
  150. Submenu {} {
  151. label {&Project} open
  152. xywh {0 0 74 25}
  153. } {
  154. MenuItem {} {
  155. label {&Info}
  156. callback {Project_Info_Dialog pi;
  157. pi.run();}
  158. xywh {0 0 40 25} deactivate
  159. }
  160. Submenu {} {
  161. label {Se&ttings} open
  162. xywh {20 20 74 25}
  163. } {
  164. MenuItem {} {
  165. label {&Follow Playhead}
  166. callback {Timeline::follow_playhead = menu_picked_value( o );}
  167. xywh {40 40 40 25} type Toggle value 1
  168. }
  169. MenuItem {} {
  170. label {&Center Playhead}
  171. callback {Timeline::center_playhead = menu_picked_value( o );}
  172. xywh {50 50 40 25} type Toggle value 1
  173. }
  174. Submenu {} {
  175. label {&Snap to} open
  176. xywh {20 20 74 25}
  177. } {
  178. MenuItem {} {
  179. label Bars
  180. callback {Timeline::snap_to = Timeline::Bars;}
  181. xywh {20 20 40 25} type Radio value 1
  182. }
  183. MenuItem {} {
  184. label Beats
  185. callback {Timeline::snap_to = Timeline::Beats;}
  186. xywh {30 30 40 25} type Radio
  187. }
  188. MenuItem {} {
  189. label Off
  190. callback {Timeline::snap_to = Timeline::None;}
  191. xywh {40 40 40 25} type Radio
  192. }
  193. }
  194. MenuItem {} {
  195. label {Magnetic snap}
  196. callback {Timeline::snap_magnetic = menu_picked_value( o );}
  197. xywh {30 30 40 25} type Toggle value 1
  198. }
  199. Submenu {} {
  200. label {Capture Format} open
  201. xywh {20 20 74 25}
  202. } {}
  203. }
  204. MenuItem {} {
  205. label {&New}
  206. callback {save_timeline_settings();
  207. new_project_chooser();
  208. load_timeline_settings();
  209. update_menu();
  210. main_window->redraw();}
  211. xywh {0 0 40 25}
  212. }
  213. MenuItem {} {
  214. label {&Open}
  215. callback {char *path;
  216. read_line( user_config_dir, "default_path", &path );
  217. const char *name = fl_dir_chooser( "Open Project", path, NULL );
  218. free( path );
  219. open( name );}
  220. xywh {10 10 40 25}
  221. }
  222. MenuItem {} {
  223. label {&Compact}
  224. callback {int n = fl_choice( "Compacting will replace the project history with a snapshot of the current state.\\nYou will not be able to use Undo to go back beyond this point.\\n\\nThis operation is irreversible!", NULL, "&Cancel", "Pr&ocede with compaction" );
  225. if ( n != 2 )
  226. return;
  227. Project::compact();}
  228. xywh {20 20 40 25}
  229. }
  230. Submenu {} {
  231. label {&Export} open
  232. xywh {0 0 74 25} deactivate
  233. } {
  234. MenuItem {} {
  235. label Project
  236. xywh {0 0 40 25}
  237. }
  238. MenuItem {} {
  239. label Range
  240. xywh {10 10 40 25}
  241. }
  242. }
  243. MenuItem {} {
  244. label {&Quit}
  245. callback {quit()}
  246. xywh {40 40 40 25} shortcut 0x40071
  247. }
  248. }
  249. Submenu {} {
  250. label {&Edit} open
  251. xywh {0 0 74 25}
  252. } {
  253. MenuItem {} {
  254. label Undo
  255. callback {Loggable::undo();}
  256. xywh {0 0 40 25} shortcut 0x4007a divider
  257. }
  258. MenuItem {} {
  259. label {Select None}
  260. callback {timeline->select_none();}
  261. xywh {10 10 40 25} shortcut 0x50061
  262. }
  263. MenuItem {} {
  264. label {Delete Selected}
  265. callback {timeline->delete_selected();}
  266. xywh {20 20 40 25} shortcut 0xffff
  267. }
  268. }
  269. Submenu {} {
  270. label Transport open
  271. xywh {0 0 74 25}
  272. } {
  273. MenuItem {} {
  274. label Start
  275. callback {transport->locate( 0 );}
  276. xywh {0 0 40 25} shortcut 0xff50
  277. }
  278. MenuItem {} {
  279. label End
  280. callback {transport->locate( timeline->length() );}
  281. xywh {10 10 40 25} shortcut 0xff57
  282. }
  283. MenuItem {} {
  284. label {Play/Stop}
  285. callback {transport->toggle();}
  286. xywh {20 20 40 25} shortcut 0x20
  287. }
  288. MenuItem {} {
  289. label Record
  290. callback {transport->toggle_record();}
  291. xywh {40 40 40 25} shortcut 0x10072
  292. }
  293. }
  294. MenuItem {} {
  295. label {&Timeline}
  296. xywh {0 0 40 25}
  297. }
  298. Submenu {} {
  299. label {&View} open
  300. xywh {0 0 74 25}
  301. } {
  302. Submenu {} {
  303. label {&Zoom} open
  304. xywh {0 0 74 25}
  305. } {
  306. MenuItem {} {
  307. label {&In}
  308. callback {timeline->zoom_in();}
  309. xywh {20 20 40 25} shortcut 0x2b
  310. }
  311. MenuItem {} {
  312. label {&Out}
  313. callback {timeline->zoom_out();}
  314. xywh {30 30 40 25} shortcut 0x5f
  315. }
  316. MenuItem {} {
  317. label {&Fit}
  318. callback {timeline->zoom_fit();}
  319. xywh {10 10 40 25} shortcut 0x3d divider
  320. }
  321. MenuItem {} {
  322. label {1 sec.}
  323. callback {timeline->zoom( 1 );}
  324. xywh {10 10 40 25} shortcut 0x31
  325. }
  326. MenuItem {} {
  327. label {1 min.}
  328. callback {timeline->zoom( 60 );}
  329. xywh {20 20 40 25} shortcut 0x32
  330. }
  331. MenuItem {} {
  332. label {1 hour.}
  333. callback {timeline->zoom( 60 * 60 );}
  334. xywh {30 30 40 25} shortcut 0x33
  335. }
  336. }
  337. }
  338. Submenu {} {
  339. label {&Options} open
  340. xywh {0 0 74 25} divider
  341. } {
  342. Submenu {} {
  343. label {&Display} open
  344. xywh {10 10 74 25}
  345. } {
  346. Submenu {} {
  347. label {&Timeline} open
  348. xywh {10 10 74 25}
  349. } {
  350. MenuItem {} {
  351. label {&Measure lines}
  352. callback {Timeline::draw_with_measure_lines = menu_picked_value( o );
  353. timeline->redraw();}
  354. xywh {10 10 40 25} type Toggle value 1
  355. }
  356. }
  357. Submenu {} {
  358. label {&Waveform} open
  359. xywh {10 10 74 25}
  360. } {
  361. MenuItem {} {
  362. label Fill
  363. callback {Waveform::fill = menu_picked_value( o );
  364. timeline->redraw();}
  365. xywh {20 20 40 25} type Toggle value 1
  366. }
  367. MenuItem {} {
  368. label Outline
  369. callback {Waveform::outline = menu_picked_value( o );
  370. timeline->redraw();}
  371. xywh {40 40 40 25} type Toggle value 1
  372. }
  373. MenuItem {} {
  374. label {Vary color}
  375. callback {Waveform::vary_color = menu_picked_value( o );
  376. timeline->redraw();}
  377. xywh {30 30 40 25} type Toggle value 1
  378. }
  379. }
  380. Submenu {} {
  381. label {&Region} open
  382. xywh {10 10 74 25}
  383. } {
  384. MenuItem {} {
  385. label {Filled fades}
  386. xywh {40 40 40 25} type Toggle value 1
  387. }
  388. MenuItem {} {
  389. label {Inherit track color}
  390. callback {Audio_Region::inherit_track_color = menu_picked_value( o );
  391. timeline->redraw();}
  392. xywh {50 50 40 25} type Toggle value 1
  393. }
  394. }
  395. Submenu {} {
  396. label {&Control Sequence} open
  397. xywh {10 10 74 25}
  398. } {
  399. MenuItem {} {
  400. label Polygon
  401. callback {Control_Sequence::draw_with_polygon = menu_picked_value( o );
  402. timeline->redraw();}
  403. xywh {30 30 40 25} type Toggle value 1
  404. }
  405. MenuItem {} {
  406. label Graded
  407. callback {Control_Sequence::draw_with_gradient = menu_picked_value( o );
  408. timeline->redraw();}
  409. xywh {40 40 40 25} type Toggle value 1
  410. }
  411. MenuItem {} {
  412. label Ruled
  413. callback {Control_Sequence::draw_with_grid = menu_picked_value( o );
  414. timeline->redraw();}
  415. xywh {50 50 40 25} type Toggle value 1
  416. }
  417. }
  418. Submenu {} {
  419. label {&Style} open
  420. xywh {10 10 74 25}
  421. } {
  422. MenuItem {} {
  423. label Default
  424. callback {Fl::scheme( "plastic" );}
  425. xywh {10 10 40 25} type Radio value 1
  426. }
  427. MenuItem {} {
  428. label Flat
  429. callback {Fl::scheme( "gtk+" );}
  430. xywh {20 20 40 25} type Radio
  431. }
  432. }
  433. Submenu {} {
  434. label {C&olors} open
  435. xywh {10 10 74 25}
  436. } {
  437. MenuItem {} {
  438. label System
  439. callback {//Fl::get_system_colors();
  440. unsigned char r, g, b;
  441. Fl::get_color( system_colors[ 0 ], r, g, b );
  442. Fl::background( r, g, b );
  443. Fl::get_color( system_colors[ 1 ], r, g, b );
  444. Fl::foreground( r, g, b );
  445. Fl::get_color( system_colors[ 2 ], r, g, b );
  446. Fl::background2( r, g, b );
  447. Fl::scheme( Fl::scheme() );}
  448. xywh {10 10 40 25} type Radio
  449. }
  450. MenuItem {} {
  451. label Dark
  452. callback {Fl::background2( 100, 100, 100 );
  453. Fl::background( 50, 50, 50 );
  454. Fl::foreground( 255, 255, 255 );
  455. Fl::scheme( Fl::scheme() );}
  456. xywh {20 20 40 25} type Radio value 1
  457. }
  458. MenuItem {} {
  459. label Light
  460. callback {Fl::background2( 192, 192, 192 );
  461. Fl::background( 220, 220, 220 );
  462. Fl::foreground( 0, 0, 0 );
  463. Fl::scheme( Fl::scheme() );}
  464. xywh {30 30 40 25} type Radio
  465. }
  466. }
  467. }
  468. }
  469. Submenu {} {
  470. label {&Help} open
  471. xywh {0 0 74 25}
  472. } {
  473. MenuItem {} {
  474. label {&Manual}
  475. callback {show_help_dialog( "MANUAL" );}
  476. xywh {10 10 40 25} divider
  477. }
  478. MenuItem {} {
  479. label {&About}
  480. callback {About_Dialog ab;
  481. ab.run();}
  482. xywh {0 0 40 25}
  483. }
  484. }
  485. }
  486. Fl_Group {} {open
  487. xywh {0 23 1025 51}
  488. } {
  489. Fl_Pack {} {open
  490. xywh {0 23 483 46} type HORIZONTAL
  491. code0 {o->spacing( 10 );}
  492. } {
  493. Fl_Box {} {
  494. label {<Transport>}
  495. xywh {5 23 189 46} color 30
  496. code0 {transport = o;}
  497. code1 {o->labeltype( FL_NO_LABEL );}
  498. class Transport
  499. }
  500. Fl_Pack clocks_pack {
  501. private xywh {195 23 288 46} type HORIZONTAL
  502. code0 {o->spacing( 2 );}
  503. } {
  504. Fl_Box {} {
  505. label PLAYHEAD
  506. private xywh {195 29 137 40} box BORDER_BOX color 40
  507. code0 {o->type( Clock::HMS );}
  508. code1 {o->run( &transport->frame );}
  509. class Clock
  510. }
  511. Fl_Box {} {
  512. label PLAYHEAD
  513. xywh {335 29 142 40} box BORDER_BOX color 40
  514. code0 {o->type( Clock::BBT );}
  515. code1 {o->run( &transport->frame );}
  516. class Clock
  517. }
  518. }
  519. }
  520. Fl_Box {} {
  521. label {<empty>} selected
  522. xywh {487 27 258 42} resizable
  523. code0 {o->labeltype( FL_NO_LABEL );}
  524. }
  525. Fl_Group {} {open
  526. xywh {745 26 280 44}
  527. } {
  528. Fl_Box {} {
  529. label {capture:}
  530. xywh {865 26 56 14} labelsize 10 align 24
  531. }
  532. Fl_Box {} {
  533. label {playback:}
  534. xywh {865 42 56 14} labelsize 10 align 24
  535. }
  536. Fl_Box {} {
  537. label {DSP:}
  538. xywh {865 56 56 14} labelsize 10 align 24
  539. }
  540. Fl_Progress capture_buffer_progress {
  541. label {50%}
  542. private xywh {921 26 104 14} labelsize 10
  543. }
  544. Fl_Progress cpu_load_progress {
  545. label {50%}
  546. private xywh {921 56 104 14} labelsize 9
  547. }
  548. Fl_Progress playback_buffer_progress {
  549. label {50%}
  550. private xywh {921 41 104 14} labelsize 10
  551. }
  552. Fl_Box {} {
  553. label {disk:}
  554. xywh {810 27 55 18} labelsize 10 align 16
  555. }
  556. Fl_Progress disk_usage_progress {
  557. label {50%}
  558. private xywh {810 43 55 26} labelsize 10
  559. }
  560. }
  561. Fl_Button solo_blinker {
  562. label SOLO
  563. xywh {750 30 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 74 selection_color 92 labelfont 2 labelcolor 39 deactivate
  564. code0 {\#include "FL/Fl_Blinker.H"}
  565. class Fl_Blinker
  566. }
  567. Fl_Button rec_blinker {
  568. label REC
  569. xywh {750 50 50 15} box ROUNDED_BOX down_box ROUNDED_BOX color 72 selection_color 88 labelfont 2 labelcolor 39 deactivate
  570. code0 {\#include "FL/Fl_Blinker.H"}
  571. class Fl_Blinker
  572. }
  573. }
  574. Fl_Progress progress {
  575. label {0%}
  576. private xywh {15 394 995 41} hide
  577. }
  578. Fl_Box {} {
  579. label {<Timeline>}
  580. xywh {0 72 1024 695} box FLAT_BOX color 47 labelsize 100 resizable
  581. code0 {timeline = o;}
  582. class Timeline
  583. }
  584. Fl_Box project_name {
  585. label {<project name>}
  586. private xywh {450 0 475 22} labeltype SHADOW_LABEL labelfont 2
  587. code0 {o->label( Project::name() );}
  588. }
  589. Fl_Value_Output xruns_output {
  590. label {xruns:}
  591. private xywh {980 2 44 20} maximum 40000 step 1
  592. }
  593. }
  594. }
  595. Function {menu_picked_value( const Fl_Menu_ *m )} {private return_type {static int}
  596. } {
  597. code {return m->menu()[ m->value() ].flags & FL_MENU_VALUE;} {}
  598. }
  599. Function {find_item( Fl_Menu_ *menu, const char *path )} {private return_type {static Fl_Menu_Item *}
  600. } {
  601. code {return const_cast<Fl_Menu_Item*>(menu->find_item( path ));} {}
  602. }
  603. decl {static void menubar_cb ( void *v )} {}
  604. decl {void menubar_cb ( void )} {}
  605. Function {update_menu()} {private
  606. } {
  607. code {Fl_Menu_Bar *m = menubar;
  608. if ( ! Project::open() )
  609. {
  610. find_item( m, "&Project/&Export" )->deactivate();
  611. find_item( m, "&Project/&Compact" )->deactivate();
  612. find_item( m, "&Project/&Info" )->deactivate();
  613. find_item( m, "&Project/Se&ttings" )->deactivate();
  614. find_item( m, "&Timeline" )->deactivate();
  615. timeline->deactivate();
  616. transport->deactivate();
  617. }
  618. else
  619. {
  620. find_item( m, "&Project/&Export" )->activate();
  621. find_item( m, "&Project/&Compact" )->activate();
  622. find_item( m, "&Project/&Info" )->activate();
  623. find_item( m, "&Project/Se&ttings" )->activate();
  624. find_item( m, "&Timeline" )->activate();
  625. timeline->activate();
  626. transport->activate();
  627. }
  628. m->redraw();
  629. project_name->redraw();} {}
  630. }
  631. Function {update_progress( Fl_Progress *p, char *s, float v )} {private return_type {static void}
  632. } {
  633. code {p->value( v );
  634. snprintf( s, 5, "%d%%", (int)v );
  635. p->label( s );} {}
  636. }
  637. Function {update_status()} {open private
  638. } {
  639. code {static char cbp[5], pbp[5], clp[5], dup[5];
  640. update_progress( capture_buffer_progress, cbp, timeline->total_input_buffer_percent() );
  641. update_progress( playback_buffer_progress, pbp, timeline->total_output_buffer_percent() );
  642. update_progress( cpu_load_progress, clp, engine->cpu_load() );
  643. update_progress( disk_usage_progress, dup, percent_used( "." ) );
  644. if ( timeline->total_capture_xruns() )
  645. capture_buffer_progress->selection_color( FL_RED );
  646. if ( timeline->total_playback_xruns() )
  647. playback_buffer_progress->selection_color( FL_RED );
  648. xruns_output->value( engine->xruns() );
  649. static bool zombie = false;
  650. if ( engine->zombified() && ! zombie )
  651. {
  652. zombie = true;
  653. fl_alert( "Disconnected from JACK!" );
  654. }
  655. solo_blinker->value( Track::soloing() );
  656. rec_blinker->value( transport->rolling && transport->rec_enabled() );} {}
  657. }
  658. Function {update_cb( void *v )} {open private return_type {static void}
  659. } {
  660. code {Fl::repeat_timeout( STATUS_UPDATE_FREQ, update_cb, v );
  661. ((TLE*)v)->update_status();} {}
  662. }
  663. Function {capture_format_cb( Fl_Widget *w, void *v )} {private return_type {static void}
  664. } {
  665. code {((TLE*)v)->capture_format_cb();} {}
  666. }
  667. Function {capture_format_cb()} {private return_type void
  668. } {
  669. code {Fl_Menu_ *o = menubar;
  670. Track::capture_format = o->menu()[ o->value() ].label();} {}
  671. }
  672. Function {progress_cb( int p, void *arg )} {private return_type {static void}
  673. } {
  674. code {((TLE*)arg)->progress_cb( p );} {}
  675. }
  676. Function {progress_cb( int p )} {private return_type void
  677. } {
  678. code {if ( ! progress->visible() )
  679. {
  680. timeline->hide();
  681. progress->show();
  682. }
  683. else if ( 0 == p )
  684. {
  685. timeline->show();
  686. progress->hide();
  687. }
  688. static char pat[10];
  689. update_progress( progress, pat, p );
  690. progress->redraw();
  691. Fl::check();} {}
  692. }
  693. Function {show_help_dialog( const char *file )} {open private return_type {static void}
  694. } {
  695. code {char pat[256];
  696. snprintf( pat, 256, "file://%s%s.html", DOCUMENT_PATH, file );
  697. open_url( pat );} {}
  698. }
  699. }
  700. class New_Project_Dialog {open
  701. } {
  702. Function {New_Project_Dialog()} {open
  703. } {
  704. code {make_window();} {}
  705. }
  706. Function {run()} {open return_type void
  707. } {
  708. code {_window->show();
  709. while ( _window->shown() )
  710. Fl::wait();} {}
  711. }
  712. Function {make_window()} {open
  713. } {
  714. Fl_Window _window {
  715. label {New Project} open
  716. xywh {615 414 550 195} type Double modal xclass Non_DAW visible
  717. } {
  718. Fl_File_Input _name {
  719. label {Named:}
  720. xywh {75 140 375 35}
  721. }
  722. Fl_Button {} {
  723. label Browse
  724. callback {_directory->value( fl_dir_chooser( "Directory for new project", NULL, 0 ) );}
  725. xywh {455 100 80 35}
  726. }
  727. Fl_Return_Button {} {
  728. label Create
  729. callback {if ( strlen( _directory->value() ) && strlen( _name->value() ) )
  730. {
  731. char pat[512];
  732. snprintf( pat, sizeof( pat ), "%s/%s", _directory->value(), _name->value() );
  733. if ( ! Project::create( pat, _template->text( _template->value() ) ) )
  734. fl_alert( "Error creating project!" );
  735. _window->hide();
  736. }}
  737. xywh {455 140 80 35}
  738. }
  739. Fl_File_Input _directory {
  740. label {Where:}
  741. callback {if ( ! fl_filename_isdir( o->value() ) )
  742. {
  743. fl_alert( "Must be a directory" );
  744. o->value( "" );
  745. return;
  746. }
  747. write_line( user_config_dir, "default_path", o->value() );}
  748. xywh {75 100 375 35}
  749. code0 {\#include <FL/filename.H>}
  750. code1 {char *v;}
  751. code2 {read_line( user_config_dir, "default_path", &v );}
  752. code3 {o->value( v );}
  753. }
  754. Fl_Box {} {
  755. label {New Project}
  756. xywh {15 8 520 33} box RSHADOW_BOX color 133 labelsize 20 labelcolor 32
  757. }
  758. Fl_Choice _template {
  759. label {Template:}
  760. private xywh {310 60 225 25} down_box BORDER_BOX
  761. } {
  762. MenuItem {} {
  763. label Default
  764. xywh {0 0 40 25}
  765. }
  766. }
  767. }
  768. }
  769. }
  770. Function {new_project_chooser()} {C return_type void
  771. } {
  772. code {New_Project_Dialog nsd;
  773. nsd.run();} {}
  774. }
  775. class Project_Info_Dialog {open
  776. } {
  777. Function {Project_Info_Dialog()} {open
  778. } {
  779. code {make_window();} {}
  780. }
  781. Function {run()} {open return_type void
  782. } {
  783. code {window->show();
  784. while ( window->shown() )
  785. Fl::wait();} {}
  786. }
  787. Function {make_window()} {open
  788. } {
  789. Fl_Window window {
  790. label {Project info}
  791. callback {o->hide();
  792. if ( logo_box->image() )
  793. {
  794. ((Fl_Shared_Image*)logo_box->image())->release();
  795. logo_box->image( NULL );
  796. }} open
  797. private xywh {649 226 520 740} type Double modal visible
  798. } {
  799. Fl_Value_Output {} {
  800. label {Sample Rate}
  801. xywh {40 80 90 25} labeltype SHADOW_LABEL align 1
  802. code0 {o->value( timeline->sample_rate() );}
  803. }
  804. Fl_Output {} {
  805. label {Size of Journal}
  806. xywh {180 80 100 25} box UP_BOX labeltype SHADOW_LABEL align 1
  807. code0 {static char pat[40];}
  808. code1 {snprintf( pat, sizeof( pat ), "%.1fK", size( "history" ) / (float)1024 );}
  809. code2 {o->value( pat );}
  810. code3 {\#include "util/file.h"}
  811. }
  812. Fl_Output {} {
  813. label {Created On}
  814. xywh {320 80 180 25} box UP_BOX labeltype SHADOW_LABEL align 1 textfont 11 textsize 12
  815. code0 {o->value( Project::created_on() );}
  816. }
  817. Fl_Output {} {
  818. label Length
  819. xywh {30 130 115 25} box BORDER_BOX color 47 align 1 textcolor 71
  820. code0 {char pat[40];}
  821. code1 {Clock::frame_to_HMS( pat, sizeof( pat ), timeline->length() );}
  822. code2 {o->value( pat );}
  823. }
  824. Fl_Value_Output {} {
  825. label Tracks
  826. xywh {200 130 55 25} align 1
  827. code0 {o->value( timeline->ntracks() );}
  828. }
  829. Fl_Box logo_box {
  830. label {<LOGO>}
  831. private xywh {51 180 418 235} box ROUNDED_BOX color 53 labelfont 1 labelsize 18 align 16
  832. code0 {o->image( Fl_Shared_Image::get( INSTALL_PREFIX "/share/pixmaps/non-daw/logo2.png" ) );}
  833. code1 {o->label( NULL );}
  834. }
  835. Fl_Text_Editor notes_field {
  836. label {Notes:}
  837. private xywh {20 445 480 245} color 47 selection_color 31 textsize 18 textcolor 92
  838. code0 {o->buffer( new Fl_Text_Buffer() );}
  839. code1 {o->buffer()->loadfile( "notes" );}
  840. }
  841. Fl_Button {} {
  842. label {&Save}
  843. callback {notes_field->buffer()->savefile( "notes" );
  844. window->do_callback();}
  845. xywh {425 700 74 25}
  846. }
  847. Fl_Box {} {
  848. label {Project Info}
  849. xywh {40 18 405 27} box RSHADOW_BOX color 95 labeltype SHADOW_LABEL labelsize 18
  850. }
  851. Fl_Box {} {
  852. label {Project Info}
  853. xywh {25 18 470 33} box RSHADOW_BOX color 133 labelsize 20 labelcolor 32
  854. }
  855. Fl_Button {} {
  856. label {&Discard}
  857. callback {window->do_callback();}
  858. xywh {330 700 74 25}
  859. }
  860. Fl_Output {} {
  861. label {Last Modified On}
  862. xywh {320 130 180 25} box UP_BOX labeltype SHADOW_LABEL align 1 textfont 11 textsize 12
  863. code0 {time_t t = modification_time( "history" );}
  864. code1 {static char s[40];}
  865. code2 {ctime_r( &t, s ); s[ strlen( s ) - 1 ] = 0;}
  866. code3 {o->value( s );}
  867. }
  868. }
  869. }
  870. }
  871. class About_Dialog {open
  872. } {
  873. Function {About_Dialog()} {open
  874. } {
  875. code {make_window();} {}
  876. }
  877. Function {run()} {return_type void
  878. } {
  879. code {window->show();
  880. while ( window->shown() )
  881. Fl::wait();
  882. delete window;} {}
  883. }
  884. Function {make_window()} {open private
  885. } {
  886. Fl_Window window {
  887. label About
  888. callback {o->hide();
  889. if ( logo_box->image() )
  890. {
  891. ((Fl_Shared_Image*)logo_box->image())->release();
  892. logo_box->image( NULL );
  893. }} open
  894. private xywh {349 201 495 655} type Double xclass {Non-DAW} visible
  895. } {
  896. Fl_Tabs {} {open
  897. xywh {0 264 497 392}
  898. } {
  899. Fl_Group {} {
  900. label Credits open
  901. xywh {2 293 492 362}
  902. } {
  903. Fl_Box {} {
  904. label {Non-DAW was written from scratch by
  905. Jonathan Moore Liles for his own use
  906. (see the manual).
  907. Nobody planned. Nobody helped.
  908. You can help now by donating time, money,
  909. and/or replacing the rest of Linux Audio
  910. with fast, light, reliable alternatives.}
  911. xywh {39 322 418 262} box ROUNDED_BOX color 46 labelsize 18
  912. }
  913. }
  914. Fl_Group {} {
  915. label License open
  916. xywh {2 288 492 311} hide
  917. } {
  918. Fl_Box {} {
  919. label {Copyright (C) 2008 Jonathan Moore Liles}
  920. xywh {43 302 410 37} labeltype SHADOW_LABEL labelfont 1 labelsize 18
  921. }
  922. Fl_Box {} {
  923. label {This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  924. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  925. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.}
  926. xywh {10 351 475 233} box ROUNDED_BOX color 46 labelfont 1 labelsize 12 labelcolor 53 align 144
  927. }
  928. }
  929. }
  930. Fl_Box logo_box {
  931. label VERSION
  932. private xywh {25 20 445 180} box ROUNDED_BOX color 48 labelfont 1 labelsize 18 align 16
  933. code0 {o->image( Fl_Shared_Image::get( INSTALL_PREFIX "/share/pixmaps/non-daw/logo.png" ) );}
  934. code1 {o->label( VERSION );}
  935. }
  936. Fl_Return_Button {} {
  937. label Rock
  938. callback {o->window()->do_callback();}
  939. xywh {400 614 76 30}
  940. }
  941. Fl_Button {} {
  942. label {http://non-daw.tuxfamily.org}
  943. callback {open_url( o->label() );}
  944. xywh {125 614 245 30} color 14 labeltype SHADOW_LABEL labelcolor 6
  945. }
  946. Fl_Box {} {
  947. label {The Non DAW (Digital Audio Workstation)}
  948. xywh {32 221 430 29} labeltype SHADOW_LABEL labelfont 3 labelsize 17
  949. }
  950. }
  951. }
  952. }
  953. Function {open_url( const char *url )} {open return_type void
  954. } {
  955. code {\#if ! ( FL_MAJOR_VERSION >= 1 && FL_MINOR_VERSION >= 1 && FL_PATCH_VERSION >= 8 )
  956. // FIXME: got a better idea?
  957. char cmd[256];
  958. snprintf( cmd, sizeof( cmd ), "x-www-browser '%s' &", url );
  959. system( cmd );
  960. \#else
  961. fl_open_uri( url );
  962. \#endif} {}
  963. }