File: eca-chainsetup-edit.h

package info (click to toggle)
ecasound 2.9.1-7
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 5,652 kB
  • ctags: 6,128
  • sloc: cpp: 39,403; sh: 10,512; ansic: 2,040; lisp: 1,918; makefile: 909; python: 611; ruby: 202
file content (105 lines) | stat: -rw-r--r-- 3,322 bytes parent folder | download | duplicates (5)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// ------------------------------------------------------------------------
// eca-chainsetup-edit.h: Chainsetup edit object
// Copyright (C) 2009,2012 Kai Vehmanen
//
// Attributes:
//     eca-style-version: 3
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
// ------------------------------------------------------------------------

#ifndef INCLUDED_ECA_CHAINSETUP_EDIT_H
#define INCLUDED_ECA_CHAINSETUP_EDIT_H

class CHAIN;
class ECA_CHAINSETUP;

namespace ECA {
  enum Chainsetup_edit_type {
  
    edit_c_bypass = 0,
    edit_c_muting,
    edit_cop_add,
    edit_cop_bypass,
    edit_cop_set_param,
    edit_ctrl_add,
    edit_ctrl_set_param,
  };

  /*
   * Chainsetup edit objects are defined for all operations 
   * that can be performed either from the real-time engine
   * (if modifying chainsetup that is currently run), or
   * from the non-real-time control thread (modifying 
   * selected but not running chainsetup).
   *
   * Using edit objects avoids duplicated code to describe
   * and parse the needed actions in both ECA_ENGINE and 
   * ECA_CONTROL.
   */

  struct chainsetup_edit {

    Chainsetup_edit_type type;
    const ECA_CHAINSETUP *cs_ptr;

    /* FIXME: should a version tag be added as way to invalidate
     *        edit objects in case chainsetup is modified */

    union {
      struct {
	int chain;     /**< @see ECA_CHAINSETUP::get_chain_index() */
	int val;
      } c_bypass;

      struct {
	int chain;     /**< @see ECA_CHAINSETUP::get_chain_index() */
	int val;
      } c_muting;

      struct {
	int chain;     /**< @see ECA_CHAINSETUP::get_chain_index() */
	int op;        /**< @see CHAIN::set_parameter() */
	int param;     /**< @see CHAIN::set_parameter() */
	double value;  /**< @see CHAIN::set_parameter() */
      } cop_set_param;

      struct {
	int chain;     /**< @see ECA_CHAINSETUP::get_chain_index() */
	int op;        /**< @see CHAIN::bypass_operator() */
	int bypass;    /**< @see CHAIN::bypass_operator() */
      } cop_bypass;

      struct {
        int chain;     /**< @see ECA_CHAINSETUP::get_chain_index() */
      } c_generic_param;

      struct {
	int chain;     /**< @see ECA_CHAINSETUP::get_chain_index() */
	int op;        /**< @see CHAIN::set_controller_parameter() */
	int param;     /**< @see CHAIN::set_controller_parameter() */
	double value;  /**< @see CHAIN::set_controller_parameter() */
      } ctrl_set_param;
    } m;

    bool need_chain_reinit;
    std::string param; /**< arbitrary string parameter, semantics 
                          depend on 'type' */
  };

  typedef struct chainsetup_edit chainsetup_edit_t;
}

#endif /* INCLUDED_ECA_CHAINSETUP_EDIT_H */