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.

729 lines
19KB

  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0108
  3. header_name {.H}
  4. code_name {.C}
  5. decl {const float STATUS_UPDATE_FREQ = 0.5f;} {}
  6. decl {\#include "Fl_Menu_Settings.H"} {}
  7. decl {\#include "Timeline.H"} {}
  8. decl {\#include "Engine.H"} {}
  9. decl {\#include "Transport.H"} {}
  10. decl {\#include "Loggable.H"} {}
  11. decl {\#include "Session.H"} {}
  12. decl {\#include "Clock.H"} {public
  13. }
  14. decl {\#include "Track.H" // for capture_format} {}
  15. decl {\#include "Audio_File.H" // for supported formats} {}
  16. decl {\#include "Waveform.H" // for options} {}
  17. decl {\#include "Audio_Region.H" // for options} {}
  18. decl {\#include "Control_Sequence.H" // for options} {}
  19. decl {\#include <FL/fl_ask.H>} {}
  20. decl {\#include <FL/Fl_File_Chooser.H>} {}
  21. decl {\#include <FL/Fl.H>} {}
  22. decl {extern char session_display_name[256];} {global
  23. }
  24. decl {extern char *user_config_dir;} {global
  25. }
  26. class TLE {open
  27. } {
  28. decl {Fl_Color system_colors[3];} {public
  29. }
  30. decl {static void menubar_cb ( void *v )} {}
  31. decl {void menubar_cb ( void )} {}
  32. Function {menu_picked_value( const Fl_Menu_ *m )} {open return_type {static int}
  33. } {
  34. code {return m->menu()[ m->value() ].flags & FL_MENU_VALUE;} {}
  35. }
  36. Function {save()} {open
  37. } {
  38. code {const char options_filename[] = "options";
  39. // const char state_filename[] = "state";
  40. // save options
  41. char *path;
  42. asprintf( &path, "%s/%s", user_config_dir, options_filename );
  43. ((Fl_Menu_Settings*)menubar)->dump( menubar->find_item( "&Options" ), path );
  44. free( path );
  45. // save unjournaled state
  46. // Loggable::save_unjournaled( state_filename );} {}
  47. }
  48. Function {capture_format_cb( Fl_Widget *w, void *v )} {open private return_type {static void}
  49. } {
  50. code {((TLE*)v)->capture_format_cb();} {}
  51. }
  52. Function {capture_format_cb()} {open private return_type void
  53. } {
  54. code {Fl_Menu_ *o = menubar;
  55. Track::capture_format = o->menu()[ o->value() ].label();} {}
  56. }
  57. Function {TLE()} {open
  58. } {
  59. code {make_window();
  60. // Fl::visual( RGB8 );
  61. Fl::visible_focus( 0 );
  62. Fl::get_system_colors();
  63. Fl::scheme( "plastic" );
  64. system_colors[ 0 ] = (Fl_Color)Fl::get_color( FL_BACKGROUND_COLOR );
  65. system_colors[ 1 ] = (Fl_Color)Fl::get_color( FL_FOREGROUND_COLOR );
  66. system_colors[ 2 ] = (Fl_Color)Fl::get_color( FL_BACKGROUND2_COLOR );
  67. Fl::add_timeout( STATUS_UPDATE_FREQ, update_cb, this );
  68. std::list <const char *> formats;
  69. Audio_File::all_supported_formats( formats );
  70. for ( std::list <const char *>::const_iterator f = formats.begin(); f != formats.end(); ++f )
  71. {
  72. // capture_format_menu->add( *f, FL_MENU_RADIO, 0, 0, 0 );
  73. //;
  74. char pat[256];
  75. snprintf( pat, sizeof( pat ), "Timeline/Capture Format/%s", *f );
  76. menubar->add( pat, 0, &TLE::capture_format_cb, this, FL_MENU_RADIO );
  77. }
  78. char *path;
  79. asprintf( &path, "%s/options", user_config_dir );
  80. ((Fl_Menu_Settings*)menubar)->load( menubar->find_item( "&Options" ), path );
  81. free( path );} {}
  82. }
  83. Function {make_window()} {open
  84. } {
  85. Fl_Window main_window {
  86. label {Non-DAW - Timeline} open
  87. xywh {174 178 1020 765} type Double resizable xclass {Non-DAW} visible
  88. } {
  89. Fl_Menu_Bar menubar {open
  90. xywh {0 0 1024 25}
  91. } {
  92. Submenu {} {
  93. label {&Session} open
  94. xywh {0 0 74 25}
  95. } {
  96. MenuItem {} {
  97. label {&Info}
  98. xywh {0 0 40 25} deactivate
  99. }
  100. MenuItem {} {
  101. label {&New}
  102. callback {const char *name = new_session_chooser();
  103. if ( ! name )
  104. return;
  105. // Loggable::close();
  106. // timeline->reset();
  107. main_window->redraw();}
  108. xywh {0 0 40 25}
  109. }
  110. MenuItem {} {
  111. label {&Open}
  112. xywh {10 10 40 25} deactivate
  113. }
  114. MenuItem {} {
  115. label {&Compact}
  116. callback {int n = fl_choice( "Compacting will replace the session history with a snapshot of the current state.\\n You will not be able to use Undo to go back beyond this point.\\n This operation is irreversible!", NULL, "Abort", "Procede with compaction" );
  117. if ( n != 2 )
  118. return;
  119. Loggable::compact();}
  120. xywh {20 20 40 25}
  121. }
  122. Submenu {} {
  123. label Export open
  124. xywh {0 0 74 25} deactivate
  125. } {
  126. MenuItem {} {
  127. label Session
  128. xywh {0 0 40 25}
  129. }
  130. MenuItem {} {
  131. label Range
  132. xywh {10 10 40 25}
  133. }
  134. }
  135. MenuItem {} {
  136. label {&Quit}
  137. callback {save();
  138. printf( "dropped %d buffers\\n", engine->dropped() );
  139. exit( 0 );}
  140. xywh {40 40 40 25} shortcut 0x40071
  141. }
  142. }
  143. Submenu {} {
  144. label {&Edit} open
  145. xywh {0 0 74 25}
  146. } {
  147. MenuItem {} {
  148. label Undo
  149. callback {Loggable::undo();}
  150. xywh {0 0 40 25} shortcut 0x4007a divider
  151. }
  152. MenuItem {} {
  153. label {Select None}
  154. callback {timeline->select_none();}
  155. xywh {10 10 40 25} shortcut 0x50061
  156. }
  157. MenuItem {} {
  158. label {Delete Selected}
  159. callback {timeline->delete_selected();}
  160. xywh {20 20 40 25} shortcut 0xffff
  161. }
  162. }
  163. Submenu {} {
  164. label Transport open
  165. xywh {0 0 74 25}
  166. } {
  167. MenuItem {} {
  168. label Start
  169. callback {transport->locate( 0 );}
  170. xywh {0 0 40 25} shortcut 0xff50
  171. }
  172. MenuItem {} {
  173. label End
  174. callback {transport->locate( timeline->length() );}
  175. xywh {10 10 40 25} shortcut 0xff57
  176. }
  177. MenuItem {} {
  178. label {Play/Stop}
  179. callback {transport->toggle();}
  180. xywh {20 20 40 25} shortcut 0x20
  181. }
  182. MenuItem {} {
  183. label Record
  184. callback {transport->toggle_record();}
  185. xywh {40 40 40 25} shortcut 0x10072
  186. }
  187. }
  188. Submenu {} {
  189. label {&View} open
  190. xywh {0 0 74 25}
  191. } {
  192. Submenu {} {
  193. label {&Zoom} open
  194. xywh {0 0 74 25}
  195. } {
  196. MenuItem {} {
  197. label {&In}
  198. callback {timeline->zoom_in();}
  199. xywh {20 20 40 25}
  200. }
  201. MenuItem {} {
  202. label {&Out}
  203. callback {timeline->zoom_out();}
  204. xywh {30 30 40 25}
  205. }
  206. MenuItem {} {
  207. label {&Fit}
  208. callback {timeline->zoom_fit();}
  209. xywh {10 10 40 25} divider
  210. }
  211. MenuItem {} {
  212. label {1 sec.}
  213. callback {timeline->zoom( 1 );}
  214. xywh {10 10 40 25} shortcut 0x31
  215. }
  216. MenuItem {} {
  217. label {1 min.}
  218. callback {timeline->zoom( 60 );}
  219. xywh {20 20 40 25} shortcut 0x32
  220. }
  221. MenuItem {} {
  222. label {1 hour.}
  223. callback {timeline->zoom( 60 * 60 );}
  224. xywh {30 30 40 25} shortcut 0x33
  225. }
  226. }
  227. }
  228. Submenu timeline_menu {
  229. label {&Timeline}
  230. xywh {0 0 74 25}
  231. } {
  232. MenuItem {} {
  233. label {&Follow Playhead}
  234. callback {Timeline::follow_playhead = menu_picked_value( o );}
  235. xywh {20 20 40 25} type Toggle value 1
  236. }
  237. MenuItem {} {
  238. label {&Center Playhead}
  239. callback {Timeline::center_playhead = menu_picked_value( o );}
  240. xywh {30 30 40 25} type Toggle value 1
  241. }
  242. Submenu {} {
  243. label {&Snap to} open
  244. xywh {0 0 74 25}
  245. } {
  246. MenuItem {} {
  247. label Bars
  248. callback {Timeline::snap_to = Timeline::Bars;}
  249. xywh {0 0 40 25} type Radio value 1
  250. }
  251. MenuItem {} {
  252. label Beats
  253. callback {Timeline::snap_to = Timeline::Beats;}
  254. xywh {10 10 40 25} type Radio
  255. }
  256. MenuItem {} {
  257. label Off
  258. callback {Timeline::snap_to = Timeline::None;}
  259. xywh {20 20 40 25} type Radio
  260. }
  261. }
  262. MenuItem {} {
  263. label {Magnetic snap}
  264. callback {Timeline::snap_magnetic = menu_picked_value( o );}
  265. xywh {10 10 40 25} type Toggle value 1
  266. }
  267. Submenu {} {
  268. label {Capture Format} open
  269. xywh {0 0 74 25}
  270. } {}
  271. }
  272. Submenu {} {
  273. label {&Options} open
  274. xywh {0 0 74 25} divider
  275. } {
  276. Submenu {} {
  277. label {&Display} open
  278. xywh {0 0 74 25}
  279. } {
  280. Submenu {} {
  281. label {&Timeline} open
  282. xywh {0 0 74 25}
  283. } {
  284. MenuItem {} {
  285. label {&Measure lines}
  286. callback {Timeline::draw_with_measure_lines = menu_picked_value( o );
  287. timeline->redraw();}
  288. xywh {0 0 40 25} type Toggle value 1
  289. }
  290. }
  291. Submenu {} {
  292. label {&Waveforms} open
  293. xywh {0 0 74 25}
  294. } {
  295. MenuItem {} {
  296. label Fill
  297. callback {Waveform::fill = menu_picked_value( o );
  298. timeline->redraw();}
  299. xywh {10 10 40 25} type Toggle value 1
  300. }
  301. MenuItem {} {
  302. label Outline
  303. callback {Waveform::outline = menu_picked_value( o );
  304. timeline->redraw();}
  305. xywh {30 30 40 25} type Toggle value 1
  306. }
  307. MenuItem {} {
  308. label {Vary color}
  309. callback {Waveform::vary_color = menu_picked_value( o );
  310. timeline->redraw();}
  311. xywh {20 20 40 25} type Toggle value 1
  312. }
  313. }
  314. Submenu {} {
  315. label {&Audio_Region} open
  316. xywh {0 0 74 25}
  317. } {
  318. MenuItem {} {
  319. label {Filled fades}
  320. xywh {30 30 40 25} type Toggle value 1
  321. }
  322. MenuItem {} {
  323. label {Inherit track color}
  324. callback {Audio_Region::inherit_track_color = menu_picked_value( o );
  325. timeline->redraw();}
  326. xywh {40 40 40 25} type Toggle value 1
  327. }
  328. }
  329. Submenu {} {
  330. label {&Control Sequence} open
  331. xywh {0 0 74 25}
  332. } {
  333. MenuItem {} {
  334. label Polygon
  335. callback {Control_Sequence::draw_with_polygon = menu_picked_value( o );
  336. timeline->redraw();}
  337. xywh {20 20 40 25} type Toggle value 1
  338. }
  339. MenuItem {} {
  340. label Graded
  341. callback {Control_Sequence::draw_with_gradient = menu_picked_value( o );
  342. timeline->redraw();}
  343. xywh {30 30 40 25} type Toggle value 1
  344. }
  345. MenuItem {} {
  346. label Ruled
  347. callback {Control_Sequence::draw_with_grid = menu_picked_value( o );
  348. timeline->redraw();}
  349. xywh {40 40 40 25} type Toggle value 1
  350. }
  351. }
  352. Submenu {} {
  353. label {&Style} open
  354. xywh {0 0 74 25}
  355. } {
  356. MenuItem {} {
  357. label Default
  358. callback {Fl::scheme( "plastic" );}
  359. xywh {0 0 40 25} type Radio value 1
  360. }
  361. MenuItem {} {
  362. label Flat
  363. callback {Fl::scheme( "gtk+" );}
  364. xywh {10 10 40 25} type Radio
  365. }
  366. }
  367. Submenu {} {
  368. label {C&olors} open
  369. xywh {0 0 74 25}
  370. } {
  371. MenuItem {} {
  372. label System
  373. callback {//Fl::get_system_colors();
  374. unsigned char r, g, b;
  375. Fl::get_color( system_colors[ 0 ], r, g, b );
  376. Fl::background( r, g, b );
  377. Fl::get_color( system_colors[ 1 ], r, g, b );
  378. Fl::foreground( r, g, b );
  379. Fl::get_color( system_colors[ 2 ], r, g, b );
  380. Fl::background2( r, g, b );
  381. Fl::scheme( Fl::scheme() );}
  382. xywh {0 0 40 25} type Radio
  383. }
  384. MenuItem {} {
  385. label Dark
  386. callback {Fl::background2( 100, 100, 100 );
  387. Fl::background( 50, 50, 50 );
  388. Fl::foreground( 255, 255, 255 );
  389. Fl::scheme( Fl::scheme() );}
  390. xywh {10 10 40 25} type Radio value 1
  391. }
  392. MenuItem {} {
  393. label Light
  394. callback {Fl::background2( 192, 192, 192 );
  395. Fl::background( 220, 220, 220 );
  396. Fl::foreground( 0, 0, 0 );
  397. Fl::scheme( Fl::scheme() );}
  398. xywh {20 20 40 25} type Radio
  399. }
  400. }
  401. }
  402. }
  403. Submenu {} {
  404. label {&Help} open
  405. xywh {0 0 74 25}
  406. } {
  407. MenuItem {} {
  408. label {&About}
  409. callback {Fl_Window *win = make_about_dialog();
  410. win->show();
  411. while ( win->shown() )
  412. Fl::wait();
  413. delete win;}
  414. xywh {0 0 40 25}
  415. }
  416. }
  417. }
  418. Fl_Group {} {open
  419. xywh {0 23 1024 48}
  420. } {
  421. Fl_Pack {} {open
  422. xywh {0 23 473 46} type HORIZONTAL
  423. code0 {o->spacing( 10 );}
  424. } {
  425. Fl_Box {} {
  426. label {<Transport>}
  427. xywh {0 23 184 46} color 30
  428. code0 {transport = o;}
  429. code1 {o->labeltype( FL_NO_LABEL );}
  430. class Transport
  431. }
  432. Fl_Pack clocks_pack {open
  433. xywh {185 23 288 46} type HORIZONTAL
  434. code0 {o->spacing( 2 );}
  435. } {
  436. Fl_Box playhead_clock {
  437. label PLAYHEAD
  438. xywh {185 29 137 40} box BORDER_BOX color 40
  439. code0 {o->type( Clock::HMS );}
  440. code1 {o->run( &transport->frame );}
  441. class Clock
  442. }
  443. Fl_Box {} {
  444. label PLAYHEAD
  445. xywh {325 29 142 40} box BORDER_BOX color 40
  446. code0 {o->type( Clock::BBT );}
  447. code1 {o->run( &transport->frame );}
  448. class Clock
  449. }
  450. }
  451. }
  452. Fl_Box {} {
  453. label {<empty>}
  454. xywh {477 27 387 42} resizable
  455. code0 {o->labeltype( FL_NO_LABEL );}
  456. }
  457. Fl_Group {} {
  458. xywh {869 25 155 44}
  459. } {
  460. Fl_Box {} {
  461. label {capture:}
  462. xywh {869 25 56 14} labelsize 10 align 24
  463. }
  464. Fl_Box {} {
  465. label {playback:}
  466. xywh {869 41 56 14} labelsize 10 align 24
  467. }
  468. Fl_Box {} {
  469. label {DSP:}
  470. xywh {869 55 56 14} labelsize 10 align 24
  471. }
  472. Fl_Progress capture_buffer_progress {
  473. label {50%}
  474. xywh {925 25 99 14} labelsize 10
  475. }
  476. Fl_Progress cpu_load_progress {
  477. label {50%}
  478. xywh {925 55 99 14} labelsize 9
  479. }
  480. Fl_Progress playback_buffer_progress {
  481. label {50%}
  482. xywh {925 40 99 14} labelsize 10
  483. }
  484. }
  485. }
  486. Fl_Box {} {
  487. label {<Timeline>}
  488. xywh {0 72 1024 695} box FLAT_BOX color 47 labelsize 100 resizable
  489. code0 {timeline = o;}
  490. class Timeline
  491. }
  492. Fl_Box {} {
  493. label {<session name>}
  494. xywh {450 0 475 22} labeltype SHADOW_LABEL labelfont 2
  495. code0 {o->label( Session::name() );}
  496. }
  497. Fl_Value_Output xruns_output {
  498. label {xruns:}
  499. xywh {980 2 44 20} maximum 40000 step 1
  500. }
  501. }
  502. }
  503. Function {update_progress( Fl_Progress *p, char *s, float v )} {open private return_type {static void}
  504. } {
  505. code {p->value( v );
  506. snprintf( s, 5, "%d%%", (int)v );
  507. p->label( s );} {}
  508. }
  509. Function {update_status()} {open
  510. } {
  511. code {static char cbp[5], pbp[5], clp[5];
  512. update_progress( capture_buffer_progress, cbp, timeline->total_input_buffer_percent() );
  513. update_progress( playback_buffer_progress, pbp, timeline->total_output_buffer_percent() );
  514. update_progress( cpu_load_progress, clp, engine->cpu_load() );
  515. if ( timeline->total_capture_xruns() )
  516. capture_buffer_progress->selection_color( FL_RED );
  517. if ( timeline->total_playback_xruns() )
  518. playback_buffer_progress->selection_color( FL_RED );
  519. xruns_output->value( engine->xruns() );} {}
  520. }
  521. Function {update_cb( void *v )} {return_type {static void}
  522. } {
  523. code {Fl::repeat_timeout( STATUS_UPDATE_FREQ, update_cb, v );
  524. ((TLE*)v)->update_status();} {}
  525. }
  526. Function {make_about_dialog()} {open
  527. } {
  528. Fl_Window {} {
  529. label About open
  530. xywh {677 145 495 525} type Double visible
  531. } {
  532. Fl_Tabs {} {open
  533. xywh {-4 122 507 419}
  534. } {
  535. Fl_Group {} {
  536. label Credits open selected
  537. xywh {-4 147 507 394}
  538. } {
  539. Fl_Box {} {
  540. label {Non-DAW was written from scratch by
  541. Jonathan Moore Liles for his own use
  542. (see the manual).
  543. Nobody planned. Nobody helped.
  544. You can help now by donating time, money,
  545. and/or replacing the rest of Linux Audio
  546. with fast, light, reliable alternatives.}
  547. xywh {42 203 416 260} labelsize 17
  548. }
  549. }
  550. Fl_Group {} {
  551. label License open
  552. xywh {-1 157 504 384} hide
  553. } {
  554. Fl_Box {} {
  555. label {Copyright (C) 2008 Jonathan Moore Liles
  556. This software is released under version 3
  557. of the GNU General Public License (GPLv3).}
  558. xywh {45 213 403 83} labelsize 17
  559. }
  560. }
  561. }
  562. Fl_Box {} {
  563. label {the Non-DAW (Digital Audio Workstation)}
  564. image {../logo-small.png} xywh {-1 1 499 115} align 16
  565. }
  566. }
  567. }
  568. }
  569. class New_Session_Dialog {open
  570. } {
  571. Function {New_Session_Dialog()} {open
  572. } {
  573. code {make_window();} {}
  574. }
  575. Function {run()} {open return_type {const char *}
  576. } {
  577. code {_window->show();
  578. while ( _window->shown() )
  579. Fl::wait();} {}
  580. }
  581. Function {make_window()} {open
  582. } {
  583. Fl_Window _window {
  584. label {New Session} open
  585. xywh {576 340 550 195} type Double modal visible
  586. } {
  587. Fl_File_Input _name {
  588. label {Named:}
  589. xywh {75 140 375 35}
  590. }
  591. Fl_Button {} {
  592. label Browse
  593. callback {_directory->value( fl_dir_chooser( "Directory for new session", NULL, 0 ) );}
  594. xywh {455 100 80 35}
  595. }
  596. Fl_Return_Button {} {
  597. label Create
  598. callback {if ( strlen( _directory->value() ) && strlen( _name->value() ) )
  599. {
  600. char pat[512];
  601. snprintf( pat, sizeof( pat ), "%s/%s", _directory->value(), _name->value() );
  602. // if ( ! fl_filename_exists( pat ) )
  603. {
  604. if ( ! Session::create( pat, _template->text( _template->value() ) ) )
  605. fl_alert( "Error opening session!" );
  606. _window->hide();
  607. }
  608. // else
  609. // {
  610. // fl_alert( "A file already exists at that location. Choose a differnt name." );
  611. //
  612. // }
  613. }}
  614. xywh {455 140 80 35}
  615. }
  616. Fl_File_Input _directory {
  617. label {Where:}
  618. callback {if ( ! fl_filename_isdir( o->value() ) )
  619. {
  620. fl_alert( "Must be a directory" );
  621. o->value( "" );
  622. }}
  623. xywh {75 100 375 35}
  624. code0 {\#include <FL/filename.H>}
  625. }
  626. Fl_Box {} {
  627. label {New Session}
  628. xywh {15 8 520 33} box RSHADOW_BOX color 133 labelsize 20 labelcolor 32
  629. }
  630. Fl_Choice _template {
  631. label {Template:}
  632. private xywh {310 60 225 25} down_box BORDER_BOX
  633. } {
  634. MenuItem {} {
  635. label Default
  636. xywh {0 0 40 25}
  637. }
  638. }
  639. }
  640. }
  641. }
  642. Function {new_session_chooser()} {open C return_type {const char *}
  643. } {
  644. code {New_Session_Dialog nsd;
  645. return nsd.run();} {}
  646. }