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.

875 lines
25KB

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