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.

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