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.

174 lines
5.1KB

  1. /*******************************************************************************/
  2. /* Copyright (C) 2009 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. #pragma once
  19. #include <FL/Fl.H>
  20. #include <FL/Fl_Widget.H>
  21. #include <FL/Fl_Group.H>
  22. #include <FL/Fl_Scroll.H>
  23. #include <FL/Fl_Pack.H>
  24. #include "Mixer_Strip.H"
  25. #include "Thread.H"
  26. class Fl_Blink_Button;
  27. class Fl_Flowpack;
  28. class Fl_Menu_Bar;
  29. class Spatialization_Console;
  30. namespace OSC { class Endpoint; }
  31. #include <lo/lo.h>
  32. class Group;
  33. class Mixer : public Fl_Group
  34. {
  35. public:
  36. OSC::Endpoint *osc_endpoint;
  37. Fl_Button *sm_blinker;
  38. private:
  39. float _update_interval;
  40. static void show_tooltip ( const char *s );
  41. static void hide_tooltip ( void );
  42. int _rows;
  43. int _strip_height;
  44. Fl_Color system_colors[3];
  45. Mixer_Strip* track_by_name ( const char *name );
  46. void snapshot ( void );
  47. static void snapshot ( void *v ) { ((Mixer*)v)->snapshot(); }
  48. void cb_menu(Fl_Widget*);
  49. static void cb_menu(Fl_Widget*, void*);
  50. Fl_Menu_Bar *menubar;
  51. Fl_Scroll *scroll;
  52. Fl_Pack *pack;
  53. Fl_Box *project_name;
  54. Fl_Box *_status;
  55. Fl_Flowpack *mixer_strips;
  56. void load_options ( void );
  57. void save_options ( void );
  58. void save_translations ( void );
  59. void load_translations ( void );
  60. static void send_feedback_cb ( void *v );
  61. void send_feedback ( void );
  62. void redraw_windows ( void );
  63. static void handle_dirty ( int, void *v );
  64. static int osc_non_hello ( const char *, const char *, lo_arg **, int , lo_message msg, void * );
  65. static int osc_strip_by_number ( const char *, const char *, lo_arg **, int , lo_message msg, void * );
  66. static void update_cb ( void * );
  67. void update_cb ( void );
  68. public:
  69. Group * group_by_name ( const char * name );
  70. char *get_unique_group_name ( const char *name );
  71. std::list <Group*> groups;
  72. Group *group ( int n );
  73. void add_group ( Group *g );
  74. void remove_group ( Group *g );
  75. void update_menu ( void );
  76. static Spatialization_Console *spatialization_console;
  77. int nstrips ( void ) const;
  78. Mixer_Strip* track_by_number ( int n );
  79. void update_frequency ( float f );
  80. void status ( const char *s ) {
  81. if ( s ) _status->copy_label( s );
  82. else _status->label(0);
  83. _status->redraw(); }
  84. virtual int handle ( int m );
  85. char * get_unique_track_name ( const char *name );
  86. int min_h ( void ) const { return Mixer_Strip::min_h() + (18 * 2); }
  87. void rows ( int n );
  88. virtual void resize ( int X, int Y, int W, int H );
  89. void new_strip ( void );
  90. void add ( Mixer_Strip *ms );
  91. void remove ( Mixer_Strip *ms );
  92. void move_left ( Mixer_Strip *ms );
  93. void move_right ( Mixer_Strip *ms );
  94. void insert ( Mixer_Strip *ms, Mixer_Strip *before );
  95. void insert ( Mixer_Strip *ms, int i );
  96. bool contains ( Mixer_Strip *ms );
  97. Mixer_Strip * event_inside ( void );
  98. int find_strip ( const Mixer_Strip *m ) const;
  99. bool save ( void );
  100. void quit ( void );
  101. Mixer ( int X, int Y, int W, int H, const char *L );
  102. virtual ~Mixer();
  103. void handle_hello ( lo_message msg );
  104. void announce ( const char *nash_url, const char *process_name );
  105. int init_osc ( const char* osc_port );
  106. void sm_active ( bool b );
  107. void say_hello ( void );
  108. void save_default_project_settings ( void );
  109. void load_default_project_settings ( void );
  110. void reset_project_settings ( void );
  111. void save_project_settings ( void );
  112. void load_project_settings ( void );
  113. public:
  114. void edit_translations ( void );
  115. void command_clear_mappings ( void );
  116. void command_new ( void );
  117. bool command_save ( void );
  118. bool command_load ( const char *path, const char *display_name = 0 );
  119. bool command_new ( const char *path, const char *display_name = 0 );
  120. void command_quit ( void );
  121. void command_add_strip ( void );
  122. };
  123. extern Mixer* mixer;