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.

125 lines
3.4KB

  1. /*******************************************************************************/
  2. /* Copyright (C) 2008 Jonathan Moore Liles */
  3. /* */
  4. /* This program is free software; you can redistribute it and/or modify it */
  5. /* under the terms of the GNU General Public License as published by the */
  6. /* Free Software Foundation; either version 2 of the License, or (at your */
  7. /* option) any later version. */
  8. /* */
  9. /* This program is distributed in the hope that it will be useful, but WITHOUT */
  10. /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
  11. /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
  12. /* more details. */
  13. /* */
  14. /* You should have received a copy of the GNU General Public License along */
  15. /* with This program; see the file COPYING. If not,write to the Free Software */
  16. /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  17. /*******************************************************************************/
  18. #include <FL/Fl.H>
  19. #include <FL/Fl_Window.H>
  20. #include <FL/Fl_Double_Window.H>
  21. #include <FL/Fl_Overlay_Window.H>
  22. #include <FL/Fl_Scroll.H>
  23. // #include <FL/Fl_Scrollbar.H>
  24. #include <FL/Fl_Pack.H>
  25. #include <FL/Fl_Group.H>
  26. #include <FL/Fl_Slider.H>
  27. #include <FL/Fl_Button.H>
  28. #include "Scalebar.H"
  29. // #include "Waveform.H"
  30. #include "Region.H"
  31. #include <stdio.h>
  32. #include <unistd.h>
  33. #include <sys/stat.h>
  34. #include <stdlib.h>
  35. #include <string.h>
  36. #include "Sequence.H"
  37. #include "Audio_Sequence.H"
  38. #include "Timeline.H"
  39. #include "Tempo_Sequence.H"
  40. #include "Time_Sequence.H"
  41. #include "Ruler_Sequence.H"
  42. #include "Control_Sequence.H"
  43. #include "Transport.H"
  44. #include "Loggable.H"
  45. #include "Track.H"
  46. #include "Engine.H"
  47. // #include "Clock.H"
  48. #include "TLE.H"
  49. #include "../FL/Boxtypes.H"
  50. #include <stdlib.h>
  51. #include <sys/stat.h>
  52. Engine *engine;
  53. Timeline *timeline;
  54. Transport *transport;
  55. /* void cb_undo ( Fl_Widget *w, void *v ) */
  56. /* { */
  57. /* Loggable::undo(); */
  58. /* } */
  59. char *user_config_dir;
  60. static int
  61. ensure_dirs ( void )
  62. {
  63. asprintf( &user_config_dir, "%s/.non-daw", getenv( "HOME" ) );
  64. return 0 == mkdir( user_config_dir, 0777 );
  65. }
  66. int
  67. main ( int argc, char **argv )
  68. {
  69. /* welcome to C++ */
  70. LOG_REGISTER_CREATE( Region );
  71. LOG_REGISTER_CREATE( Time_Point );
  72. LOG_REGISTER_CREATE( Tempo_Point );
  73. LOG_REGISTER_CREATE( Ruler_Point );
  74. LOG_REGISTER_CREATE( Control_Point );
  75. LOG_REGISTER_CREATE( Track );
  76. LOG_REGISTER_CREATE( Audio_Sequence );
  77. LOG_REGISTER_CREATE( Control_Sequence );
  78. init_boxtypes();
  79. if ( ! ensure_dirs() )
  80. /* error */;
  81. /* TODO: change to seesion dir */
  82. TLE tle;
  83. /* we don't really need a pointer for this */
  84. engine = new Engine;
  85. engine->init();
  86. /* always start stopped (please imagine for me a realistic
  87. * scenario requiring otherwise */
  88. transport->stop();
  89. Loggable::open( "history" );
  90. // Fl::add_timeout( UPDATE_FREQ, clock_update_cb, o );
  91. tle.main_window->show( argc, argv );
  92. Fl::run();
  93. }