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.

996 lines
28KB

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