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.

1159 lines
32KB

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