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.

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