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.

990 lines
27KB

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