Update NTK.
[nondaw.git] / mixer / src / Mixer_Strip.H
blob06b97683de1f93e3f86f0af9f4bc9044e453a1ec
2 /*******************************************************************************/
3 /* Copyright (C) 2010 Jonathan Moore Liles                                     */
4 /*                                                                             */
5 /* This program is free software; you can redistribute it and/or modify it     */
6 /* under the terms of the GNU General Public License as published by the       */
7 /* Free Software Foundation; either version 2 of the License, or (at your      */
8 /* option) any later version.                                                  */
9 /*                                                                             */
10 /* This program is distributed in the hope that it will be useful, but WITHOUT */
11 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       */
12 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for   */
13 /* more details.                                                               */
14 /*                                                                             */
15 /* You should have received a copy of the GNU General Public License along     */
16 /* with This program; see the file COPYING.  If not,write to the Free Software */
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18 /*******************************************************************************/
20 #pragma once
22 #include <FL/Fl.H>
23 #include "DPM.H"
24 #include "Panner.H"
25 #include <FL/Fl_Scalepack.H>
26 #include <FL/Fl_Pack.H>
27 #include <FL/Fl_Flip_Button.H>
28 #include <FL/Fl_Dial.H>
29 #include <FL/Fl_Group.H>
30 #include <FL/Fl_Box.H>
31 #include <FL/Fl_Button.H>
32 #include <FL/Fl_Value_Slider.H>
33 #include <FL/Fl_Counter.H>
34 #include <FL/Fl_Progress.H>
35 //#include "Fader.H"
36 #include <JACK/Port.H>
39 #include "../FL/Fl_Sometimes_Input.H"
41 #include "Loggable.H"
42 class Chain;
43 class Fl_Flowpack;
44 class Controller_Module;
45 class Meter_Indicator_Module;
46 class Module;
47 class Fl_Flip_Button;
48 class Fl_Input;
49 class Fl_Menu_;
50 class Fl_Menu_Button;
52 class Mixer_Strip : public Fl_Group, public Loggable {
54 public:
56     static int min_h ( void ) { return 336; }
58     Mixer_Strip( const char *strip_name );
59     Mixer_Strip();                                              /* for log create */
60     virtual ~Mixer_Strip();
62     void chain ( Chain *c );
64     void log_children ( void );
66     virtual void color ( Fl_Color c );
67     virtual Fl_Color color ( void ) const;
69     LOG_CREATE_FUNC( Mixer_Strip );
71     static void configure_outputs ( Fl_Widget *o, void *v );
72     void configure_outputs ( void );
74     bool configure_ports ( int n );
76     void handle_module_added ( Module *m );
77     void handle_module_removed ( Module *m );
79     void update ( void );
81     void name ( const char *name );
82     const char *name ( void ) const { return label(); }
84 private:
86     /* used to defer setting the mode of the gain controller until the
87      chain has been added and the controller connected to a default
88      module */
89     int _gain_controller_mode;
91     Fl_Flip_Button *width_button;
92     Fl_Flip_Button *tab_button;
93     Fl_Button *close_button;
94     Fl_Button *left_button;
95     Fl_Button *right_button;
96     Fl_Input *name_field;
98     Fl_Flowpack *controls_pack;
99     Fl_Group *tab_group;
100     Fl_Group *signal_tab;
101     Fl_Group *fader_tab;
102     Fl_Pack *panner_pack;
104     Chain *_chain;
106     Controller_Module *gain_controller;
107     Controller_Module *jack_input_controller;
108     Controller_Module *spatialization_controller;
109     Meter_Indicator_Module *meter_indicator;
111     nframes_t nframes;
113     Fl_Color _color;
115     void init ( );
116     void cb_handle(Fl_Widget*);
117     static void cb_handle(Fl_Widget*, void*);
119     void set_tab ( void );
121     void update_port_names ( void );
123     void menu_cb ( const Fl_Menu_ *m );
124     static void menu_cb ( Fl_Widget *w, void *v );
125     Fl_Menu_Button & menu ( void ) const;
127     static void snapshot ( void *v );
128     void snapshot ( void );
129     bool export_strip ( const char *filename );
131 protected:
133     void get ( Log_Entry &e ) const;
134     void set ( Log_Entry &e );
136     virtual int handle ( int m );
137     virtual void draw ( void );
139 public:
141     static bool import_strip ( const char *filename );
143     void command_move_left ( void );
144     void command_move_right ( void );
145     void command_close ( void );
146     void command_rename ( const char * s );
147     void command_width ( bool b );
148     void command_view ( bool b );