1
// ------------------------------------------------------------------------
2
// eca-chain.cpp: Class representing an abstract audio signal chain.
3
// Copyright (C) 1999-2009 Kai Vehmanen
4
// Copyright (C) 2005 Stuart Allie
7
// eca-style-version: 3
9
// This program is free software; you can redistribute it and/or modify
10
// it under the terms of the GNU General Public License as published by
11
// the Free Software Foundation; either version 2 of the License, or
12
// (at your option) any later version.
14
// This program is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
// GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program. If not, see <http://www.gnu.org/licenses/>.
21
// ------------------------------------------------------------------------
1
23
#ifndef INCLUDED_CHAIN_H
2
24
#define INCLUDED_CHAIN_H
44
76
bool is_valid(void) const;
78
void init(SAMPLE_BUFFER* sbuf = 0, int in_channels = 0, int out_channels = 0);
81
void controller_update(void);
82
void refresh_parameters(void);
84
std::string to_string(void) const;
88
// -------------------------------------------------------------------
90
/** @name Input and output */
46
93
void connect_input(int input);
47
94
void disconnect_input(void);
48
95
void connect_output(int output);
62
109
int connected_output(void) const { return output_id_rep; }
113
// -------------------------------------------------------------------
115
/** @name Access objects via stateless addressing */
65
120
void add_chain_operator(CHAIN_OPERATOR* chainop);
66
void remove_chain_operator(void);
67
void select_chain_operator(int index);
68
void select_chain_operator_parameter(int index);
69
void set_parameter(CHAIN_OPERATOR::parameter_t value);
72
* Index of selected chain operator
121
void add_controller(GENERIC_CONTROLLER* gcontroller);
122
void remove_chain_operator(int op_index);
124
void set_parameter(int op_index, int param_index, CHAIN_OPERATOR::parameter_t value);
126
int number_of_chain_operators(void) const { return chainops_rep.size(); }
127
int number_of_chain_operator_parameters(int index) const;
129
const CHAIN_OPERATOR* get_chain_operator(int index) const { return chainops_rep[index]; }
130
const GENERIC_CONTROLLER* get_controller(int index) const { return gcontrollers_rep[index]; }
132
int number_of_controllers(void) const { return gcontrollers_rep.size(); }
133
void set_controller_parameter(int op_index, int param_index, CHAIN_OPERATOR::parameter_t value);
137
// -------------------------------------------------------------------
139
/** @name Access objects via stateful addressing */
142
void select_chain_operator(int op_index);
143
void select_chain_operator_parameter(int param_index);
145
/** Index (1..N) of selected chain operator */
74
146
int selected_chain_operator(void) const { return selected_chainop_number_rep; }
75
147
int selected_chain_operator_parameter(void) const { return selected_chainop_parameter_rep; }
76
int number_of_chain_operators(void) const { return chainops_rep.size(); }
77
149
int number_of_chain_operator_parameters(void) const;
78
151
CHAIN_OPERATOR::parameter_t get_parameter(void) const;
79
152
std::string chain_operator_name(void) const;
80
153
std::string chain_operator_parameter_name(void) const;
81
const CHAIN_OPERATOR* get_chain_operator(int index) const { return chainops_rep[index]; }
82
const CHAIN_OPERATOR* get_selected_chain_operator(void) const { return selected_chainop_repp; }
84
void add_controller(GENERIC_CONTROLLER* gcontroller);
155
const CHAIN_OPERATOR* get_selected_chain_operator(void) const;
85
157
void remove_controller(void);
86
158
void select_controller(int index);
87
159
void select_controller_parameter(int index);
88
void set_controller_parameter(CHAIN_OPERATOR::parameter_t value);
89
const GENERIC_CONTROLLER* get_controller(int index) const { return gcontrollers_rep[index]; }
90
161
const GENERIC_CONTROLLER* get_selected_controller(void) const { return selected_controller_repp; }
91
162
int number_of_controller_parameters(void) const;
92
163
std::string controller_parameter_name(void) const;
93
164
CHAIN_OPERATOR::parameter_t get_controller_parameter(void) const;
96
* Index of selected controller
166
/** Index (1...N) of selected controller */
98
167
int selected_controller(void) const { return selected_controller_number_rep; }
99
168
int selected_controller_parameter(void) const { return selected_controller_parameter_rep; }
100
int number_of_controllers(void) const { return gcontrollers_rep.size(); }
101
170
std::string controller_name(void) const;
103
172
void selected_chain_operator_as_target(void);
111
180
OPERATOR* selected_target(void) const { return selected_dynobj_repp; }
113
void init(SAMPLE_BUFFER* sbuf = 0, int in_channels = 0, int out_channels = 0);
116
void controller_update(void);
117
void refresh_parameters(void);
119
std::string to_string(void) const;
184
// -------------------------------------------------------------------
121
186
/** @name Functions implemented from ECA_SAMPLERATE_AWARE */