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.

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