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.

839 lines
23KB

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