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.

911 lines
25KB

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