Non reinvents the DAW. Powerful enough to form a complete studio, fast and light enough to run on low-end hardware like the eeePC or Raspberry Pi, and so reliable that it can be used live https://non.tuxfamily.org/
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.

133 lines
3.3KB

  1. # data file for the Fltk User Interface Designer (fluid)
  2. version 1.0300
  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 {\#include <stdlib.h>} {private local
  25. }
  26. decl {\#include <string.h>} {private local
  27. }
  28. decl {\#include <stdio.h>} {private local
  29. }
  30. decl {\#include <FL/Fl_File_Chooser.H>} {private local
  31. }
  32. class New_Project_Dialog {open
  33. } {
  34. Function {New_Project_Dialog()} {open
  35. } {
  36. code {_default_path = 0;
  37. path = 0;
  38. make_window();} {}
  39. }
  40. Function {run()} {open return_type void
  41. } {
  42. code {_directory->value( _default_path );
  43. _window->show();
  44. while ( _window->shown() )
  45. Fl::wait();} {}
  46. }
  47. Function {make_window()} {open
  48. } {
  49. Fl_Window _window {
  50. label {New Project} open selected
  51. xywh {743 696 550 105} type Double modal visible
  52. } {
  53. Fl_File_Input _name {
  54. label {Named:}
  55. xywh {75 55 375 35}
  56. }
  57. Fl_Button {} {
  58. label Browse
  59. callback {_directory->value( fl_dir_chooser( "Directory for new project", NULL, 0 ) );}
  60. xywh {455 15 80 35}
  61. }
  62. Fl_Return_Button {} {
  63. label Create
  64. callback {if ( strlen( _directory->value() ) && strlen( _name->value() ) )
  65. {
  66. char pat[1024];
  67. snprintf( pat, sizeof( pat ), "%s/%s", _directory->value(), _name->value() );
  68. path = strdup( pat );
  69. _default_path = _directory->value() ? strdup( _directory->value() ) : 0;
  70. //if ( ! Project::create( pat, _template->text( _template->value() ) ) )
  71. // fl_alert( "Error creating project!" );
  72. _window->hide();
  73. }}
  74. xywh {455 55 80 35}
  75. }
  76. Fl_File_Input _directory {
  77. label {Where:}
  78. callback {if ( ! fl_filename_isdir( o->value() ) )
  79. {
  80. fl_alert( "Must be a directory" );
  81. o->value( "" );
  82. return;
  83. }
  84. // write_line( user_config_dir, "default_path", o->value() );}
  85. xywh {75 15 375 35}
  86. code0 {\#include <FL/filename.H>}
  87. code1 {char *v = NULL;}
  88. code2 {// read_line( user_config_dir, "default_path", &v );}
  89. code3 {o->value( v );}
  90. }
  91. }
  92. }
  93. decl {char *path;} {public local
  94. }
  95. decl {char *_default_path} {private local
  96. }
  97. Function {default_path( char *s )} {open return_type void
  98. } {
  99. code {_default_path = s;} {}
  100. }
  101. Function {default_path()} {open return_type {char *}
  102. } {
  103. code {return _default_path;} {}
  104. }
  105. }
  106. Function {new_project_chooser( char **default_path)} {open C return_type {char*}
  107. } {
  108. code {New_Project_Dialog nsd;
  109. nsd.default_path( *default_path );
  110. nsd.run();
  111. if ( nsd.default_path() )
  112. *default_path = nsd.default_path();
  113. return nsd.path;} {}
  114. }