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.

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