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.

1089 lines
30KB

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