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.

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