Non reinvents the DAW. Powerful enough to form a complete studio, fast and light enough to run on low-end hardware like the eeePC or Raspberry Pi, and so reliable that it can be used live https://non.tuxfamily.org/
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.

1083 lines
32KB

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