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.

1115 lines
31KB

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