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.

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