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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
|
// ------------------------------------------------------------------------
// eca-control-dump.cpp: Class for dumping status information to
// a standard output stream
// Copyright (C) 2000 Kai Vehmanen
//
// 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
// ------------------------------------------------------------------------
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <kvu_utils.h>
#include <kvu_numtostr.h>
#include "audioio.h"
#include "eca-chainop.h"
#include "eca-control.h"
#include "eca-control-dump.h"
void ECA_CONTROL_DUMP::dump_status(void) {
dump("dump-status", ctrl_repp->engine_status());
}
void ECA_CONTROL_DUMP::dump_position(void) {
dump("dump-position", kvu_numtostr(ctrl_repp->position_in_seconds_exact(), ctrl_repp->float_to_string_precision()));
}
void ECA_CONTROL_DUMP::dump_length(void) {
dump("dump-length", kvu_numtostr(ctrl_repp->length_in_seconds_exact(), ctrl_repp->float_to_string_precision()));
}
void ECA_CONTROL_DUMP::dump_chainsetup_status(void) {
if (ctrl_repp->is_connected() == true)
dump("dump-cs-status", "connected");
else if (ctrl_repp->is_selected() == true)
dump("dump-cs-status", "selected");
else
dump("dump-cs-status", "");
}
void ECA_CONTROL_DUMP::dump_selected_chain(void) {
const std::vector<std::string>& t = ctrl_repp->selected_chains();
if (t.empty() == false) {
dump("dump-c-selected", kvu_vector_to_string(t, ","));
}
else
dump("dump-c-selected", "");
}
void ECA_CONTROL_DUMP::dump_selected_audio_input(void) {
const AUDIO_IO* t = ctrl_repp->get_audio_input();
if (t != 0) {
dump("dump-ai-selected", t->label());
}
else
dump("dump-ai-selected", "");
}
void ECA_CONTROL_DUMP::dump_selected_audio_output(void) {
const AUDIO_IO* t = ctrl_repp->get_audio_output();
if (t != 0) {
dump("dump-ao-selected", t->label());
}
else
dump("dump-ao-selected", "");
}
void ECA_CONTROL_DUMP::dump_audio_input_position(void) {
const AUDIO_IO* t = ctrl_repp->get_audio_input();
if (t != 0) {
dump("dump-ai-position", kvu_numtostr(t->position_in_seconds_exact(), ctrl_repp->float_to_string_precision()));
}
else
dump("dump-ai-position", "");
}
void ECA_CONTROL_DUMP::dump_audio_output_position(void) {
const AUDIO_IO* t = ctrl_repp->get_audio_output();
if (t != 0) {
dump("dump-ao-position", kvu_numtostr(t->position_in_seconds_exact(), ctrl_repp->float_to_string_precision()));
}
else
dump("dump-ao-position", "");
}
void ECA_CONTROL_DUMP::dump_audio_input_length(void) {
const AUDIO_IO* t = ctrl_repp->get_audio_input();
if (t != 0) {
dump("dump-ai-length", kvu_numtostr(t->length_in_seconds_exact(), ctrl_repp->float_to_string_precision()));
}
else
dump("dump-ai-length", "");
}
void ECA_CONTROL_DUMP::dump_audio_output_length(void) {
const AUDIO_IO* t = ctrl_repp->get_audio_output();
if (t != 0) {
dump("dump-ao-length", kvu_numtostr(t->length_in_seconds_exact(), ctrl_repp->float_to_string_precision()));
}
else
dump("dump-ao-length", "");
}
void ECA_CONTROL_DUMP::dump_audio_input_open_state(void) {
const AUDIO_IO* t = ctrl_repp->get_audio_input();
if (t != 0) {
if (t->is_open() == true)
dump("dump-ai-open-state", "open");
else
dump("dump-ai-open-state", "closed");
}
else
dump("dump-ai-open-state", "");
}
void ECA_CONTROL_DUMP::dump_audio_output_open_state(void) {
const AUDIO_IO* t = ctrl_repp->get_audio_output();
if (t != 0) {
if (t->is_open() == true)
dump("dump-ao-open-state", "open");
else
dump("dump-ao-open-state", "closed");
}
else
dump("dump-ao-open-state", "");
}
void ECA_CONTROL_DUMP::dump_chain_operator_value(int chainop, int param) {
ctrl_repp->select_chain_operator(chainop);
const CHAIN_OPERATOR* t = ctrl_repp->get_chain_operator();
if (t != 0) {
dump("dump-cop-value", kvu_numtostr(t->get_parameter(param), ctrl_repp->float_to_string_precision()));
}
else
dump("dump-cop-value", "");
}
|