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.

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