1
#ifndef INCLUDED_ECA_CONTROL_H
2
#define INCLUDED_ECA_CONTROL_H
4
#include "eca-iamode-parser.h"
5
#include "eca-control-objects.h"
6
#include "eca-control-dump.h"
7
#include "sample-specs.h"
14
* Class for controlling the whole ecasound library
16
* Related design patters: Facade (GoF185)
18
* @author Kai Vehmanen
20
class ECA_CONTROL : public ECA_CONTROL_OBJECTS,
21
public ECA_IAMODE_PARSER {
26
/** @name Constructors and dtors */
29
ECA_CONTROL (ECA_SESSION* psession);
34
/** @name Public functions for issuing command */
38
* Parses a std::string containing set of ecasound interactive mode (EIAM)
39
* commands and acts accordingly.
41
void command(const std::string& cmd);
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.
48
void command_float_arg(const std::string& cmd, double arg);
51
* See ECA_IAMODE_PARSER for detailed decsription of 'action_id'.
53
void action(int action_id, const std::vector<std::string>& args);
57
/** @name Public functions for getting session information */
61
* Return info about chainsetups
63
std::string chainsetup_status(void) const;
66
* Return info about current chain status
69
* is_selected() == true
70
* selected_chains().size() > 0
72
std::string chain_status(void) const;
75
* Return info about inputs and outputs
77
std::string aio_status(void) const;
80
* Return info about chain operators (selected chainsetup)
83
* is_selected() == true
85
std::string chain_operator_status(void) const;
88
* Return info about controllers (selected chainsetup)
91
* is_selected() == true
93
std::string controller_status(void) const;
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);
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);
109
/** @name Public functions printing status information */
112
void print_last_value(void);
113
std::string last_value_to_string(void);
119
std::string action_args_rep;
120
double action_arg_f_rep;
121
bool action_arg_f_set_rep;
123
bool action_reconnect;
125
bool wellformed_mode_rep;
126
ECA_CONTROL_DUMP ctrl_dump_rep;
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;
138
std::string chainsetup_details_to_string(const ECA_CHAINSETUP* cs) const;