~ubuntu-branches/ubuntu/lucid/ecasound2.2/lucid

« back to all changes in this revision

Viewing changes to libecasound/eca-chain.h

  • Committer: Bazaar Package Importer
  • Author(s): Junichi Uekawa
  • Date: 2009-11-02 18:22:35 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091102182235-4ngh7699dmkgonyu
Tags: 2.7.0-1
* New upstream release.
* Depend on libreadline-dev instead of libreadline5-dev by request of
  Mattias Klose. It's now libreadline6-dev. (closes: #553748)
* Update menu file to use section Applications/ instead of Apps/.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
//
 
6
// Attributes:
 
7
//     eca-style-version: 3
 
8
//
 
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.
 
13
// 
 
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.
 
18
// 
 
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
// ------------------------------------------------------------------------
 
22
 
1
23
#ifndef INCLUDED_CHAIN_H
2
24
#define INCLUDED_CHAIN_H
3
25
 
18
40
 
19
41
 public:
20
42
 
 
43
  /** @name Object construction and destruction */
 
44
  /*@{*/
 
45
 
21
46
  CHAIN (void);
22
47
  virtual ~CHAIN (void);
23
48
 
 
49
  /*@}*/
 
50
 
 
51
  // -------------------------------------------------------------------
 
52
 
 
53
  /** @name Chain state */
 
54
  /*@{*/
 
55
 
24
56
  bool is_initialized(void) const { return initialized_rep; }
25
57
 
26
58
  /**
43
75
 
44
76
  bool is_valid(void) const;
45
77
 
 
78
  void init(SAMPLE_BUFFER* sbuf = 0, int in_channels = 0, int out_channels = 0);
 
79
  void release(void);
 
80
  void process(void);
 
81
  void controller_update(void);
 
82
  void refresh_parameters(void);
 
83
 
 
84
  std::string to_string(void) const;
 
85
 
 
86
  /*@}*/
 
87
 
 
88
  // -------------------------------------------------------------------
 
89
 
 
90
  /** @name Input and output */
 
91
  /*@{*/
 
92
 
46
93
  void connect_input(int input);
47
94
  void disconnect_input(void);
48
95
  void connect_output(int output);
61
108
   */
62
109
  int connected_output(void) const { return output_id_rep; }
63
110
 
 
111
  /*@}*/
 
112
 
 
113
  // -------------------------------------------------------------------
 
114
 
 
115
  /** @name Access objects via stateless addressing */
 
116
  /*@{*/
 
117
 
64
118
  void clear(void);
 
119
 
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);
70
 
 
71
 
  /**
72
 
   * Index of selected chain operator
73
 
   */
 
121
  void add_controller(GENERIC_CONTROLLER* gcontroller);
 
122
  void remove_chain_operator(int op_index);
 
123
 
 
124
  void set_parameter(int op_index, int param_index, CHAIN_OPERATOR::parameter_t value);
 
125
 
 
126
  int number_of_chain_operators(void) const { return chainops_rep.size(); }
 
127
  int number_of_chain_operator_parameters(int index) const;
 
128
 
 
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]; }
 
131
 
 
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);
 
134
 
 
135
  /*@}*/
 
136
 
 
137
  // -------------------------------------------------------------------
 
138
 
 
139
  /** @name Access objects via stateful addressing */
 
140
  /*@{*/
 
141
 
 
142
  void select_chain_operator(int op_index);
 
143
  void select_chain_operator_parameter(int param_index);
 
144
 
 
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(); }
 
148
 
77
149
  int number_of_chain_operator_parameters(void) const;
 
150
 
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; }
83
 
 
84
 
  void add_controller(GENERIC_CONTROLLER* gcontroller);
 
154
 
 
155
  const CHAIN_OPERATOR* get_selected_chain_operator(void) const;
 
156
 
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]; }
 
160
 
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;
94
165
 
95
 
  /**
96
 
   * Index of selected controller
97
 
   */
 
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(); }
 
169
 
101
170
  std::string controller_name(void) const;
102
171
 
103
172
  void selected_chain_operator_as_target(void);
110
179
   */
111
180
  OPERATOR* selected_target(void) const { return selected_dynobj_repp; }
112
181
 
113
 
  void init(SAMPLE_BUFFER* sbuf = 0, int in_channels = 0, int out_channels = 0);
114
 
  void release(void);
115
 
  void process(void);
116
 
  void controller_update(void);
117
 
  void refresh_parameters(void);
 
182
  /*@}*/
118
183
 
119
 
  std::string to_string(void) const;
 
184
  // -------------------------------------------------------------------
120
185
 
121
186
  /** @name Functions implemented from ECA_SAMPLERATE_AWARE */
122
187
  /*@{*/
134
199
 
135
200
  /*@}*/
136
201
 
 
202
  // -------------------------------------------------------------------
 
203
 
137
204
 private:
138
205
 
139
206
  bool initialized_rep;
146
213
  std::vector<CHAIN_OPERATOR*> chainops_rep;
147
214
  std::vector<GENERIC_CONTROLLER*> gcontrollers_rep;
148
215
 
149
 
  CHAIN_OPERATOR* selected_chainop_repp;
150
216
  GENERIC_CONTROLLER* selected_controller_repp;
151
217
  OPERATOR* selected_dynobj_repp;
152
218