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.

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