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.

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