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.

1111 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 {133 113 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 23 1025 51}
  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. }
  583. Fl_Progress progress {
  584. label {0%}
  585. private xywh {15 394 995 41} hide
  586. }
  587. Fl_Box {} {
  588. label {<Timeline>}
  589. xywh {0 72 1024 695} box FLAT_BOX color 47 labelsize 100 resizable
  590. code0 {timeline = o;}
  591. class Timeline
  592. }
  593. Fl_Box project_name {
  594. label {<project name>}
  595. private xywh {450 0 475 22} labeltype SHADOW_LABEL labelfont 2
  596. code0 {o->label( Project::name() );}
  597. }
  598. Fl_Value_Output xruns_output {
  599. label {xruns:}
  600. private xywh {980 2 44 20} maximum 40000 step 1
  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. xruns_output->value( engine->xruns() );
  658. static bool zombie = false;
  659. if ( engine->zombified() && ! zombie )
  660. {
  661. zombie = true;
  662. fl_alert( "Disconnected from JACK!" );
  663. }
  664. solo_blinker->value( Track::soloing() );
  665. rec_blinker->value( transport->rolling && transport->rec_enabled() );
  666. lash_blinker->value( lash->enabled() );} {}
  667. }
  668. Function {update_cb( void *v )} {open private return_type {static void}
  669. } {
  670. code {Fl::repeat_timeout( STATUS_UPDATE_FREQ, update_cb, v );
  671. ((TLE*)v)->update_status();} {}
  672. }
  673. Function {capture_format_cb( Fl_Widget *w, void *v )} {private return_type {static void}
  674. } {
  675. code {((TLE*)v)->capture_format_cb();} {}
  676. }
  677. Function {capture_format_cb()} {private return_type void
  678. } {
  679. code {Fl_Menu_ *o = menubar;
  680. Track::capture_format = o->menu()[ o->value() ].label();} {}
  681. }
  682. Function {progress_cb( int p, void *arg )} {private return_type {static void}
  683. } {
  684. code {((TLE*)arg)->progress_cb( p );} {}
  685. }
  686. Function {progress_cb( int p )} {private return_type void
  687. } {
  688. code {if ( ! progress->visible() )
  689. {
  690. timeline->hide();
  691. progress->show();
  692. }
  693. else if ( 0 == p )
  694. {
  695. timeline->show();
  696. progress->hide();
  697. }
  698. static char pat[10];
  699. update_progress( progress, pat, p );
  700. progress->redraw();
  701. Fl::check();} {}
  702. }
  703. Function {show_help_dialog( const char *file )} {open private return_type {static void}
  704. } {
  705. code {char pat[256];
  706. snprintf( pat, 256, "file://%s%s.html", DOCUMENT_PATH, file );
  707. open_url( pat );} {}
  708. }
  709. }
  710. class New_Project_Dialog {open
  711. } {
  712. Function {New_Project_Dialog()} {open
  713. } {
  714. code {make_window();} {}
  715. }
  716. Function {run()} {open return_type void
  717. } {
  718. code {_window->show();
  719. while ( _window->shown() )
  720. Fl::wait();} {}
  721. }
  722. Function {make_window()} {open
  723. } {
  724. Fl_Window _window {
  725. label {New Project} open
  726. xywh {615 414 550 195} type Double modal xclass Non_DAW visible
  727. } {
  728. Fl_File_Input _name {
  729. label {Named:}
  730. xywh {75 140 375 35}
  731. }
  732. Fl_Button {} {
  733. label Browse
  734. callback {_directory->value( fl_dir_chooser( "Directory for new project", NULL, 0 ) );}
  735. xywh {455 100 80 35}
  736. }
  737. Fl_Return_Button {} {
  738. label Create
  739. callback {if ( strlen( _directory->value() ) && strlen( _name->value() ) )
  740. {
  741. char pat[512];
  742. snprintf( pat, sizeof( pat ), "%s/%s", _directory->value(), _name->value() );
  743. if ( ! Project::create( pat, _template->text( _template->value() ) ) )
  744. fl_alert( "Error creating project!" );
  745. _window->hide();
  746. }}
  747. xywh {455 140 80 35}
  748. }
  749. Fl_File_Input _directory {
  750. label {Where:}
  751. callback {if ( ! fl_filename_isdir( o->value() ) )
  752. {
  753. fl_alert( "Must be a directory" );
  754. o->value( "" );
  755. return;
  756. }
  757. write_line( user_config_dir, "default_path", o->value() );}
  758. xywh {75 100 375 35}
  759. code0 {\#include <FL/filename.H>}
  760. code1 {char *v;}
  761. code2 {read_line( user_config_dir, "default_path", &v );}
  762. code3 {o->value( v );}
  763. }
  764. Fl_Box {} {
  765. label {New Project}
  766. xywh {15 8 520 33} box RSHADOW_BOX color 133 labelsize 20 labelcolor 32
  767. }
  768. Fl_Choice _template {
  769. label {Template:}
  770. private xywh {310 60 225 25} down_box BORDER_BOX
  771. } {
  772. MenuItem {} {
  773. label Default
  774. xywh {0 0 40 25}
  775. }
  776. }
  777. }
  778. }
  779. }
  780. Function {new_project_chooser()} {C return_type void
  781. } {
  782. code {New_Project_Dialog nsd;
  783. nsd.run();} {}
  784. }
  785. class Project_Info_Dialog {open
  786. } {
  787. Function {Project_Info_Dialog()} {open
  788. } {
  789. code {make_window();} {}
  790. }
  791. Function {run()} {open return_type void
  792. } {
  793. code {window->show();
  794. while ( window->shown() )
  795. Fl::wait();} {}
  796. }
  797. Function {make_window()} {open
  798. } {
  799. Fl_Window window {
  800. label {Project info}
  801. callback {o->hide();
  802. if ( logo_box->image() )
  803. {
  804. ((Fl_Shared_Image*)logo_box->image())->release();
  805. logo_box->image( NULL );
  806. }} open
  807. private xywh {649 226 520 740} type Double modal visible
  808. } {
  809. Fl_Value_Output {} {
  810. label {Sample Rate}
  811. xywh {40 80 90 25} labeltype SHADOW_LABEL align 1
  812. code0 {o->value( timeline->sample_rate() );}
  813. }
  814. Fl_Output {} {
  815. label {Size of Journal}
  816. xywh {180 80 100 25} box UP_BOX labeltype SHADOW_LABEL align 1
  817. code0 {static char pat[40];}
  818. code1 {snprintf( pat, sizeof( pat ), "%.1fK", size( "history" ) / (float)1024 );}
  819. code2 {o->value( pat );}
  820. code3 {\#include "util/file.h"}
  821. }
  822. Fl_Output {} {
  823. label {Created On}
  824. xywh {320 80 180 25} box UP_BOX labeltype SHADOW_LABEL align 1 textfont 11 textsize 12
  825. code0 {o->value( Project::created_on() );}
  826. }
  827. Fl_Output {} {
  828. label Length
  829. xywh {30 130 115 25} box BORDER_BOX color 47 align 1 textcolor 71
  830. code0 {char pat[40];}
  831. code1 {Clock::frame_to_HMS( pat, sizeof( pat ), timeline->length() );}
  832. code2 {o->value( pat );}
  833. }
  834. Fl_Value_Output {} {
  835. label Tracks
  836. xywh {200 130 55 25} align 1
  837. code0 {o->value( timeline->ntracks() );}
  838. }
  839. Fl_Box logo_box {
  840. label {<LOGO>}
  841. private xywh {51 180 418 235} box ROUNDED_BOX color 53 labelfont 1 labelsize 18 align 16
  842. code0 {o->image( Fl_Shared_Image::get( INSTALL_PREFIX "/share/pixmaps/non-daw/logo2.png" ) );}
  843. code1 {o->label( NULL );}
  844. }
  845. Fl_Text_Editor notes_field {
  846. label {Notes:}
  847. private xywh {20 445 480 245} color 47 selection_color 31 textsize 18 textcolor 92
  848. code0 {o->buffer( new Fl_Text_Buffer() );}
  849. code1 {o->buffer()->loadfile( "notes" );}
  850. }
  851. Fl_Button {} {
  852. label {&Save}
  853. callback {notes_field->buffer()->savefile( "notes" );
  854. window->do_callback();}
  855. xywh {425 700 74 25}
  856. }
  857. Fl_Box {} {
  858. label {Project Info}
  859. xywh {40 18 405 27} box RSHADOW_BOX color 95 labeltype SHADOW_LABEL labelsize 18
  860. }
  861. Fl_Box {} {
  862. label {Project Info}
  863. xywh {25 18 470 33} box RSHADOW_BOX color 133 labelsize 20 labelcolor 32
  864. }
  865. Fl_Button {} {
  866. label {&Discard}
  867. callback {window->do_callback();}
  868. xywh {330 700 74 25}
  869. }
  870. Fl_Output {} {
  871. label {Last Modified On}
  872. xywh {320 130 180 25} box UP_BOX labeltype SHADOW_LABEL align 1 textfont 11 textsize 12
  873. code0 {time_t t = modification_time( "history" );}
  874. code1 {static char s[40];}
  875. code2 {ctime_r( &t, s ); s[ strlen( s ) - 1 ] = 0;}
  876. code3 {o->value( s );}
  877. }
  878. }
  879. }
  880. }
  881. class About_Dialog {open
  882. } {
  883. Function {About_Dialog()} {open
  884. } {
  885. code {make_window();} {}
  886. }
  887. Function {run()} {return_type void
  888. } {
  889. code {window->show();
  890. while ( window->shown() )
  891. Fl::wait();
  892. delete window;} {}
  893. }
  894. Function {make_window()} {open private
  895. } {
  896. Fl_Window window {
  897. label About
  898. callback {o->hide();
  899. if ( logo_box->image() )
  900. {
  901. ((Fl_Shared_Image*)logo_box->image())->release();
  902. logo_box->image( NULL );
  903. }} open
  904. private xywh {349 201 495 655} type Double xclass {Non-DAW} visible
  905. } {
  906. Fl_Tabs {} {open
  907. xywh {0 264 497 392}
  908. } {
  909. Fl_Group {} {
  910. label Credits open
  911. xywh {2 293 492 362}
  912. } {
  913. Fl_Box {} {
  914. label {Non-DAW was written from scratch by
  915. Jonathan Moore Liles for his own use
  916. (see the manual).
  917. Nobody planned. Nobody helped.
  918. You can help now by donating time, money,
  919. and/or replacing the rest of Linux Audio
  920. with fast, light, reliable alternatives.}
  921. xywh {39 322 418 262} box ROUNDED_BOX color 46 labelsize 18
  922. }
  923. }
  924. Fl_Group {} {
  925. label License open
  926. xywh {2 288 492 311} hide
  927. } {
  928. Fl_Box {} {
  929. label {Copyright (C) 2008 Jonathan Moore Liles}
  930. xywh {43 302 410 37} labeltype SHADOW_LABEL labelfont 1 labelsize 18
  931. }
  932. Fl_Box {} {
  933. 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.
  934. 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.
  935. 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.}
  936. xywh {10 351 475 233} box ROUNDED_BOX color 46 labelfont 1 labelsize 12 labelcolor 53 align 144
  937. }
  938. }
  939. }
  940. Fl_Box logo_box {
  941. label VERSION
  942. private xywh {25 20 445 180} box ROUNDED_BOX color 48 labelfont 1 labelsize 18 align 16
  943. code0 {o->image( Fl_Shared_Image::get( INSTALL_PREFIX "/share/pixmaps/non-daw/logo.png" ) );}
  944. code1 {o->label( VERSION );}
  945. }
  946. Fl_Return_Button {} {
  947. label Rock
  948. callback {o->window()->do_callback();}
  949. xywh {400 614 76 30}
  950. }
  951. Fl_Button {} {
  952. label {http://non-daw.tuxfamily.org}
  953. callback {open_url( o->label() );}
  954. xywh {125 614 245 30} color 14 labeltype SHADOW_LABEL labelcolor 6
  955. }
  956. Fl_Box {} {
  957. label {The Non DAW (Digital Audio Workstation)}
  958. xywh {32 221 430 29} labeltype SHADOW_LABEL labelfont 3 labelsize 17
  959. }
  960. }
  961. }
  962. }
  963. Function {open_url( const char *url )} {open return_type void
  964. } {
  965. code {\#if ! ( FL_MAJOR_VERSION >= 1 && FL_MINOR_VERSION >= 1 && FL_PATCH_VERSION >= 8 )
  966. // FIXME: got a better idea?
  967. char cmd[256];
  968. snprintf( cmd, sizeof( cmd ), "x-www-browser '%s' &", url );
  969. system( cmd );
  970. \#else
  971. fl_open_uri( url );
  972. \#endif} {}
  973. }