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.

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