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.

871 lines
24KB

  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 );} {selected
  113. }
  114. }
  115. Function {make_window()} {open
  116. } {
  117. Fl_Window main_window {
  118. label Timeline open
  119. xywh {225 89 1020 765} 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 1024 48}
  475. } {
  476. Fl_Pack {} {open
  477. xywh {0 23 473 46} type HORIZONTAL
  478. code0 {o->spacing( 10 );}
  479. } {
  480. Fl_Box {} {
  481. label {<Transport>}
  482. xywh {0 23 184 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 {185 23 288 46} type HORIZONTAL
  489. code0 {o->spacing( 2 );}
  490. } {
  491. Fl_Box playhead_clock {
  492. label PLAYHEAD
  493. xywh {185 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 {325 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 {477 27 387 42} resizable
  510. code0 {o->labeltype( FL_NO_LABEL );}
  511. }
  512. Fl_Group {} {
  513. xywh {869 25 155 44}
  514. } {
  515. Fl_Box {} {
  516. label {capture:}
  517. xywh {869 25 56 14} labelsize 10 align 24
  518. }
  519. Fl_Box {} {
  520. label {playback:}
  521. xywh {869 41 56 14} labelsize 10 align 24
  522. }
  523. Fl_Box {} {
  524. label {DSP:}
  525. xywh {869 55 56 14} labelsize 10 align 24
  526. }
  527. Fl_Progress capture_buffer_progress {
  528. label {50%}
  529. xywh {925 25 99 14} labelsize 10
  530. }
  531. Fl_Progress cpu_load_progress {
  532. label {50%}
  533. xywh {925 55 99 14} labelsize 9
  534. }
  535. Fl_Progress playback_buffer_progress {
  536. label {50%}
  537. xywh {925 40 99 14} labelsize 10
  538. }
  539. }
  540. }
  541. Fl_Box {} {
  542. label {<Timeline>}
  543. xywh {0 72 1024 695} box FLAT_BOX color 47 labelsize 100 resizable
  544. code0 {timeline = o;}
  545. class Timeline
  546. }
  547. Fl_Box project_name {
  548. label {<project name>}
  549. xywh {450 0 475 22} labeltype SHADOW_LABEL labelfont 2
  550. code0 {o->label( Project::name() );}
  551. }
  552. Fl_Value_Output xruns_output {
  553. label {xruns:}
  554. xywh {980 2 44 20} maximum 40000 step 1
  555. }
  556. }
  557. }
  558. Function {find_item( Fl_Menu_ *menu, const char *path )} {open return_type {static Fl_Menu_Item *}
  559. } {
  560. code {return const_cast<Fl_Menu_Item*>(menu->find_item( path ));} {}
  561. }
  562. Function {update_menu()} {open
  563. } {
  564. code {Fl_Menu_Bar *m = menubar;
  565. if ( ! Project::open() )
  566. {
  567. find_item( m, "&Project/&Export" )->deactivate();
  568. find_item( m, "&Project/&Compact" )->deactivate();
  569. find_item( m, "&Project/&Info" )->deactivate();
  570. find_item( m, "&Options/&Project/&Timeline" )->deactivate();
  571. find_item( m, "&Timeline" )->deactivate();
  572. timeline->deactivate();
  573. transport->deactivate();
  574. }
  575. else
  576. {
  577. find_item( m, "&Project/&Export" )->activate();
  578. find_item( m, "&Project/&Compact" )->activate();
  579. find_item( m, "&Project/&Info" )->activate();
  580. find_item( m, "&Options/&Project/&Timeline" )->activate();
  581. find_item( m, "&Timeline" )->activate();
  582. timeline->activate();
  583. transport->activate();
  584. }
  585. m->redraw();
  586. project_name->redraw();} {}
  587. }
  588. Function {update_progress( Fl_Progress *p, char *s, float v )} {open private return_type {static void}
  589. } {
  590. code {p->value( v );
  591. snprintf( s, 5, "%d%%", (int)v );
  592. p->label( s );} {}
  593. }
  594. Function {update_status()} {open
  595. } {
  596. code {static char cbp[5], pbp[5], clp[5];
  597. update_progress( capture_buffer_progress, cbp, timeline->total_input_buffer_percent() );
  598. update_progress( playback_buffer_progress, pbp, timeline->total_output_buffer_percent() );
  599. update_progress( cpu_load_progress, clp, engine->cpu_load() );
  600. if ( timeline->total_capture_xruns() )
  601. capture_buffer_progress->selection_color( FL_RED );
  602. if ( timeline->total_playback_xruns() )
  603. playback_buffer_progress->selection_color( FL_RED );
  604. xruns_output->value( engine->xruns() );} {}
  605. }
  606. Function {update_cb( void *v )} {return_type {static void}
  607. } {
  608. code {Fl::repeat_timeout( STATUS_UPDATE_FREQ, update_cb, v );
  609. ((TLE*)v)->update_status();} {}
  610. }
  611. Function {make_about_dialog()} {open
  612. } {
  613. Fl_Window about_dialog_window {
  614. label About open
  615. private xywh {772 70 495 525} type Double xclass {Non-DAW} visible
  616. } {
  617. Fl_Tabs {} {open
  618. xywh {-4 122 513 427}
  619. } {
  620. Fl_Group {} {
  621. label Credits open
  622. xywh {-4 147 507 394}
  623. } {
  624. Fl_Box {} {
  625. label {Non-DAW was written from scratch by
  626. Jonathan Moore Liles for his own use
  627. (see the manual).
  628. Nobody planned. Nobody helped.
  629. You can help now by donating time, money,
  630. and/or replacing the rest of Linux Audio
  631. with fast, light, reliable alternatives.}
  632. xywh {42 188 418 262} box ROUNDED_BOX color 46 labelsize 18
  633. }
  634. }
  635. Fl_Group {} {
  636. label License open
  637. xywh {-1 157 510 392} hide
  638. } {
  639. Fl_Box {} {
  640. label {Copyright (C) 2008 Jonathan Moore Liles}
  641. xywh {50 168 410 37} labeltype SHADOW_LABEL labelfont 1 labelsize 18
  642. }
  643. Fl_Box {} {
  644. 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.
  645. 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.
  646. 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.}
  647. xywh {10 217 475 233} box ROUNDED_BOX color 46 labelfont 1 labelsize 12 labelcolor 53 align 144
  648. }
  649. }
  650. }
  651. Fl_Box {} {
  652. label {the Non-DAW (Digital Audio Workstation)}
  653. xywh {-1 1 499 115} align 16
  654. code0 {o->image( Fl_Shared_Image::get( INSTALL_PREFIX "/share/pixmaps/non-daw/logo.png" ) );}
  655. }
  656. Fl_Return_Button {} {
  657. label Rock
  658. callback {about_dialog_window->hide();}
  659. xywh {400 480 76 30}
  660. }
  661. Fl_Button {} {
  662. label {http://non-daw.tuxfamily.org}
  663. callback {\#if ! ( FL_MAJOR_VERSION >= 1 && FL_MINOR_VERSION >= 1 && FL_PATCH_VERSION >= 8 )
  664. // FIXME: got a better idea?
  665. system( "x-www-browser http://non-daw.tuxfamily.org &" );
  666. \#else
  667. fl_open_uri( "http://non-daw.tuxfamily.org" );
  668. \#endif}
  669. xywh {125 480 245 30} color 14 labeltype SHADOW_LABEL labelcolor 6
  670. }
  671. }
  672. }
  673. Function {save_timeline_settings()} {open
  674. } {
  675. code {if ( Project::open() )
  676. {
  677. // save project local options (Timeline menu)
  678. ((Fl_Menu_Settings*)menubar)->dump( menubar->find_item( "&Options/&Project" ), "options" );
  679. }} {}
  680. }
  681. Function {load_timeline_settings()} {open
  682. } {
  683. code {if ( Project::open() )
  684. {
  685. ((Fl_Menu_Settings*)menubar)->load( menubar->find_item( "&Options/&Project" ), "options" );
  686. }
  687. update_menu();
  688. project_name->redraw();} {}
  689. }
  690. Function {quit()} {open
  691. } {
  692. code {Project::close();
  693. save();
  694. exit( 0 );} {}
  695. }
  696. }
  697. class New_Project_Dialog {open
  698. } {
  699. Function {New_Project_Dialog()} {open
  700. } {
  701. code {make_window();} {}
  702. }
  703. Function {run()} {open return_type void
  704. } {
  705. code {_window->show();
  706. while ( _window->shown() )
  707. Fl::wait();} {}
  708. }
  709. Function {make_window()} {open
  710. } {
  711. Fl_Window _window {
  712. label {New Project} open
  713. xywh {619 742 550 195} type Double modal xclass Non_DAW visible
  714. } {
  715. Fl_File_Input _name {
  716. label {Named:}
  717. xywh {75 140 375 35}
  718. }
  719. Fl_Button {} {
  720. label Browse
  721. callback {_directory->value( fl_dir_chooser( "Directory for new project", NULL, 0 ) );}
  722. xywh {455 100 80 35}
  723. }
  724. Fl_Return_Button {} {
  725. label Create
  726. callback {if ( strlen( _directory->value() ) && strlen( _name->value() ) )
  727. {
  728. char pat[512];
  729. snprintf( pat, sizeof( pat ), "%s/%s", _directory->value(), _name->value() );
  730. if ( ! Project::create( pat, _template->text( _template->value() ) ) )
  731. fl_alert( "Error creating project!" );
  732. _window->hide();
  733. }}
  734. xywh {455 140 80 35}
  735. }
  736. Fl_File_Input _directory {
  737. label {Where:}
  738. callback {if ( ! fl_filename_isdir( o->value() ) )
  739. {
  740. fl_alert( "Must be a directory" );
  741. o->value( "" );
  742. }}
  743. xywh {75 100 375 35}
  744. code0 {\#include <FL/filename.H>}
  745. }
  746. Fl_Box {} {
  747. label {New Project}
  748. xywh {15 8 520 33} box RSHADOW_BOX color 133 labelsize 20 labelcolor 32
  749. }
  750. Fl_Choice _template {
  751. label {Template:}
  752. private xywh {310 60 225 25} down_box BORDER_BOX
  753. } {
  754. MenuItem {} {
  755. label Default
  756. xywh {0 0 40 25}
  757. }
  758. }
  759. }
  760. }
  761. }
  762. Function {new_project_chooser()} {open C return_type void
  763. } {
  764. code {New_Project_Dialog nsd;
  765. nsd.run();} {}
  766. }