1
// ------------------------------------------------------------------------
2
// eca-control-interface.cpp: C++ implementation of the Ecasound
4
// Copyright (C) 2000,2002 Kai Vehmanen
6
// This library is free software; you can redistribute it and/or
7
// modify it under the terms of the GNU Lesser General Public
8
// License as published by the Free Software Foundation; either
9
// version 2.1 of the License, or (at your option) any later version.
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
16
// You should have received a copy of the GNU General Public License
17
// along with this program; if not, write to the Free Software
18
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
// ------------------------------------------------------------------------
24
#include <ecasoundc.h>
26
#include "eca-control-interface.h"
34
ECA_CONTROL_INTERFACE::ECA_CONTROL_INTERFACE (void)
36
eci_repp = eci_init_r();
42
ECA_CONTROL_INTERFACE::~ECA_CONTROL_INTERFACE (void)
44
eci_cleanup_r(eci_repp);
48
* Parse string mode command and act accordingly.
50
void ECA_CONTROL_INTERFACE::command(const string& cmd)
52
eci_command_r(eci_repp, cmd.c_str());
55
void ECA_CONTROL_INTERFACE::command_float_arg(const string& cmd, double arg)
57
eci_command_float_arg_r(eci_repp, cmd.c_str(), arg);
60
const vector<string>& ECA_CONTROL_INTERFACE::last_string_list(void) const
63
int count = eci_last_string_list_count_r(eci_repp);
64
for(int n = 0; n < count; n++) {
65
const char* next = eci_last_string_list_item_r(eci_repp, n);
67
strlist_rep.push_back(string(next));
73
const string& ECA_CONTROL_INTERFACE::last_string(void) const
75
str_rep = string(eci_last_string_r(eci_repp));
79
double ECA_CONTROL_INTERFACE::last_float(void) const
81
return(eci_last_float_r(eci_repp));
84
int ECA_CONTROL_INTERFACE::last_integer(void) const
86
return(eci_last_integer_r(eci_repp));
89
long int ECA_CONTROL_INTERFACE::last_long_integer(void) const
91
return(eci_last_long_integer_r(eci_repp));
94
const string& ECA_CONTROL_INTERFACE::last_error(void) const
96
str_rep = string(eci_last_error_r(eci_repp));
100
const string& ECA_CONTROL_INTERFACE::last_type(void) const
102
str_rep = string(eci_last_type_r(eci_repp));
106
bool ECA_CONTROL_INTERFACE::error(void) const
108
return((eci_error_r(eci_repp) != 0) ? true : false);
111
bool ECA_CONTROL_INTERFACE::events_available(void)
116
void ECA_CONTROL_INTERFACE::next_event(void)
120
const string& ECA_CONTROL_INTERFACE::current_event(void)