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.

745 lines
20KB

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