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.

1031 lines
29KB

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