IOSelector::IOSelector (ARDOUR::Session& session, boost::shared_ptr<ARDOUR::IO> io, bool offer_inputs)
: PortMatrix (
- session, io->default_type(), offer_inputs,
+ session, io->default_type(), !offer_inputs,
PortGroupList::Mask (PortGroupList::BUSS | PortGroupList::SYSTEM | PortGroupList::OTHER)
),
_io (io)
IOSelector::set_state (int r, std::string const & p, bool s)
{
if (s) {
- if (_offer_inputs) {
+ if (!_offer_inputs) {
_io->connect_input (_io->input(r), p, 0);
} else {
_io->connect_output (_io->output(r), p, 0);
}
} else {
- if (_offer_inputs) {
+ if (!_offer_inputs) {
_io->disconnect_input (_io->input(r), p, 0);
} else {
_io->disconnect_output (_io->output(r), p, 0);
vector<string> connections;
if (_offer_inputs) {
- _io->input(r)->get_connections (connections);
- } else {
_io->output(r)->get_connections (connections);
+ } else {
+ _io->input(r)->get_connections (connections);
}
int k = 0;
uint32_t
IOSelector::n_rows () const
{
- if (_offer_inputs) {
+ if (!_offer_inputs) {
return _io->inputs().num_ports (_io->default_type());
} else {
return _io->outputs().num_ports (_io->default_type());
uint32_t
IOSelector::maximum_rows () const
{
- if (_offer_inputs) {
+ if (!_offer_inputs) {
return _io->input_maximum ().get (_io->default_type());
} else {
return _io->output_maximum ().get (_io->default_type());
uint32_t
IOSelector::minimum_rows () const
{
- if (_offer_inputs) {
+ if (!_offer_inputs) {
return _io->input_minimum ().get (_io->default_type());
} else {
return _io->output_minimum ().get (_io->default_type());
std::string
IOSelector::row_name (int r) const
{
- if (_offer_inputs) {
+ if (!_offer_inputs) {
return _io->input(r)->name();
} else {
return _io->output(r)->name();
// The IO selector only works for single typed IOs
const ARDOUR::DataType t = _io->default_type ();
- if (_offer_inputs) {
+ if (!_offer_inputs) {
try {
_io->add_input_port ("", this);
// The IO selector only works for single typed IOs
const ARDOUR::DataType t = _io->default_type ();
- if (_offer_inputs) {
+ if (!_offer_inputs) {
_io->remove_input_port (_io->input (r), this);
} else {
_io->remove_output_port (_io->output (r), this);
assert(_event->buffer() && _event->buffer()[0] != '\0');
- /*cerr << "const_iterator::operator++: _event type:" << hex << "0x" << int(_event->type())
+ cerr << "const_iterator::operator++: _event type:" << hex << "0x" << int(_event->type())
<< " buffer: 0x" << int(_event->buffer()[0]) << " 0x" << int(_event->buffer()[1])
- << " 0x" << int(_event->buffer()[2]) << endl;*/
+ << " 0x" << int(_event->buffer()[2]) << endl;
if (! (_event->is_note() || _event->is_cc() || _event->is_pgm_change() || _event->is_pitch_bender() || _event->is_channel_aftertouch()) ) {
cerr << "FAILED event buffer: " << hex << int(_event->buffer()[0]) << int(_event->buffer()[1]) << int(_event->buffer()[2]) << endl;