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.

1136 lines
32KB

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