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.

1061 lines
31KB

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