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.

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