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.

1015 lines
28KB

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