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

« back to all changes in this revision

Viewing changes to libecasound/eca-control.h

  • Committer: Bazaar Package Importer
  • Author(s): Junichi Uekawa
  • Date: 2005-04-14 09:15:48 UTC
  • Revision ID: james.westby@ubuntu.com-20050414091548-o7kgb47z0tcunh0s
Tags: upstream-2.4.1
ImportĀ upstreamĀ versionĀ 2.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef INCLUDED_ECA_CONTROL_H
 
2
#define INCLUDED_ECA_CONTROL_H
 
3
 
 
4
#include "eca-iamode-parser.h"
 
5
#include "eca-control-objects.h"
 
6
#include "eca-control-dump.h"
 
7
#include "sample-specs.h"
 
8
 
 
9
class CHAIN_OPERATOR;
 
10
class ECA_CHAINSETUP;
 
11
class ECA_OBJECT_MAP;
 
12
 
 
13
/**
 
14
 * Class for controlling the whole ecasound library
 
15
 *
 
16
 * Related design patters: Facade (GoF185)
 
17
 *
 
18
 * @author Kai Vehmanen
 
19
 */
 
20
class ECA_CONTROL : public ECA_CONTROL_OBJECTS,
 
21
                    public ECA_IAMODE_PARSER {
 
22
 
 
23
 
 
24
 public:
 
25
 
 
26
  /** @name Constructors and dtors */
 
27
  /*@{*/
 
28
 
 
29
  ECA_CONTROL (ECA_SESSION* psession);
 
30
  ~ECA_CONTROL (void);
 
31
 
 
32
  /*@}*/
 
33
 
 
34
  /** @name Public functions for issuing command */
 
35
  /*@{*/
 
36
 
 
37
  /**
 
38
   * Parses a std::string containing set of ecasound interactive mode (EIAM)
 
39
   * commands and acts accordingly.
 
40
   */
 
41
  void command(const std::string& cmd);
 
42
 
 
43
  /**
 
44
   * A special version of 'command()' which parses a std::string-float-arg 
 
45
   * pair. The std::string argument is required to contain exactly one EIAM 
 
46
   * command, while the float argument contains one numerical parameter.
 
47
   */
 
48
  void command_float_arg(const std::string& cmd, double arg);
 
49
 
 
50
  /**
 
51
   * See ECA_IAMODE_PARSER for detailed decsription of 'action_id'.
 
52
   */
 
53
  void action(int action_id, const std::vector<std::string>& args);
 
54
 
 
55
  /*@}*/
 
56
 
 
57
  /** @name Public functions for getting session information */
 
58
  /*@{*/
 
59
 
 
60
  /**
 
61
   * Return info about chainsetups
 
62
   */
 
63
  std::string chainsetup_status(void) const;
 
64
 
 
65
  /**
 
66
   * Return info about current chain status
 
67
   *
 
68
   * require:
 
69
   *  is_selected() == true
 
70
   *  selected_chains().size() > 0
 
71
   */
 
72
  std::string chain_status(void) const;
 
73
 
 
74
  /**
 
75
   * Return info about inputs and outputs
 
76
   */
 
77
  std::string aio_status(void) const;
 
78
 
 
79
  /**
 
80
   * Return info about chain operators (selected chainsetup)
 
81
   *
 
82
   * require:
 
83
   *  is_selected() == true
 
84
   */
 
85
  std::string chain_operator_status(void) const;
 
86
 
 
87
  /**
 
88
   * Return info about controllers (selected chainsetup)
 
89
   *
 
90
   * require:
 
91
   *  is_selected() == true
 
92
   */
 
93
  std::string controller_status(void) const;
 
94
 
 
95
  void aio_register(void); 
 
96
  void cop_register(void);
 
97
  void preset_register(void); 
 
98
  void ladspa_register(void);
 
99
  void ctrl_register(void);
 
100
 
 
101
  void operator_descriptions_helper(const ECA_OBJECT_MAP& arg, std::string* result);
 
102
  void cop_descriptions(void);
 
103
  void preset_descriptions(void);
 
104
  void ladspa_descriptions(bool use_id);
 
105
  void ctrl_descriptions(void);
 
106
 
 
107
  /*@}*/
 
108
 
 
109
  /** @name Public functions printing status information */
 
110
  /*@{*/
 
111
 
 
112
  void print_last_value(void);
 
113
  std::string last_value_to_string(void);
 
114
 
 
115
  /*@}*/
 
116
 
 
117
 private:
 
118
 
 
119
  std::string action_args_rep;
 
120
  double action_arg_f_rep; 
 
121
  bool action_arg_f_set_rep;
 
122
  bool action_ok;
 
123
  bool action_reconnect;
 
124
  bool action_restart;
 
125
  bool wellformed_mode_rep;
 
126
  ECA_CONTROL_DUMP ctrl_dump_rep;
 
127
 
 
128
  void action(int action_id);
 
129
  void check_action_preconditions(int action_id);
 
130
  void chainsetup_option(const std::string& cmd);
 
131
  void set_action_argument(const std::string& s);
 
132
  void set_action_argument(double v);
 
133
  void clear_action_arguments(void);
 
134
  double first_action_argument_as_float(void) const;
 
135
  long int first_action_argument_as_long_int(void) const;
 
136
  SAMPLE_SPECS::sample_pos_t first_action_argument_as_samples(void) const;
 
137
 
 
138
  std::string chainsetup_details_to_string(const ECA_CHAINSETUP* cs) const;
 
139
};
 
140
 
 
141
#endif