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.

1133 lines
33KB

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