2 /*******************************************************************************/
3 /* Copyright (C) 2009 Jonathan Moore Liles */
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. */
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 */
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 /*******************************************************************************/
24 #include "JACK/Port.H"
25 #include "OSC/Endpoint.H"
32 class Controller_Module : public Module
35 static void update_cb ( void *v );
36 void update_cb ( void );
40 volatile float control_value;
42 Fl_Menu_Button & menu ( void );
43 static void menu_cb ( Fl_Widget *w, void *v );
44 void menu_cb ( const Fl_Menu_ *m );
51 enum Mode { GUI, CV, OSC, MIDI };
59 Mode mode ( void ) const { return _mode; }
62 Type type ( void ) const { return _type; }
64 Controller_Module ( bool is_default = false );
65 virtual ~Controller_Module ( );
67 const char *name ( void ) const { return "Controller"; }
69 int can_support_inputs ( int ) { return 0; }
70 bool configure_inputs ( int ) { return false; }
72 void pad ( bool v ) { _pad = v; }
74 static void cb_handle ( Fl_Widget *w, void *v );
75 void cb_handle ( Fl_Widget *w );
76 static void cb_spatializer_handle ( Fl_Widget *w, void *v );
77 void cb_spatializer_handle ( Fl_Widget *w );
79 void connect_to ( Port *p );
80 bool connect_spatializer_to ( Module *m );
81 void disconnect ( void );
83 void handle_control_changed ( Port *p );
84 void handle_chain_name_changed ( void );
86 virtual void command_remove ( void );
88 LOG_CREATE_FUNC( Controller_Module );
90 void process ( nframes_t nframes );
100 // void set_control_value ( float f ) { control_value = f; }
104 void get ( Log_Entry &e ) const;
105 void set ( Log_Entry &e );
109 char *generate_osc_path ( void );
110 void change_osc_path ( char *path );
112 std::vector<JACK::Port> jack_input;
116 Fl_Valuator *control;