File: ctrl-source.h

package info (click to toggle)
ecasound 2.9.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 6,292 kB
  • sloc: cpp: 39,475; sh: 4,335; lisp: 1,918; ansic: 1,883; makefile: 888; python: 617; ruby: 202
file content (45 lines) | stat: -rw-r--r-- 1,080 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef INCLUDE_CTRL_SOURCE_H
#define INCLUDE_CTRL_SOURCE_H

#include "eca-audio-position.h"
#include "eca-operator.h"

/**
 * Interface class for implementing control data
 * source objects. 
 */
class CONTROLLER_SOURCE : public OPERATOR {

 public:

  typedef SAMPLE_SPECS::sample_t parameter_t;

  /**
   * Initializes the controller source.
   *
   * This function is called at least once before 
   * the first call to value().
   */
  virtual void init(void) = 0;

  /**
   * Returns the current value for the given
   * position.
   */
  virtual parameter_t value(double pos_secs) = 0; 
  /**
   * Sets an initial value for the controller. 
   * 
   * Controllers that are driven by external sources, can use the 
   * initial value if there is an initial gap in control data. The 
   * standard value range ofs [0,1] should be used.
   *
   * Should be set before the first call to value().
   */
  virtual void set_initial_value(parameter_t arg) = 0; 

  virtual CONTROLLER_SOURCE* clone(void) const = 0;
  virtual CONTROLLER_SOURCE* new_expr(void) const = 0;
};

#endif