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.

1153 lines
32KB

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