_io (io)
{
/* Listen for ports changing on the IO */
- if (!offer_inputs) {
+ if (_offer_inputs) {
_io->input_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
} else {
_io->output_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
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->output(r)->get_connections (connections);
- } else {
_io->input(r)->get_connections (connections);
+ } else {
+ _io->output(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);
PortGroupList::PortGroupList (ARDOUR::Session & session, ARDOUR::DataType type, bool offer_inputs, Mask mask)
: _session (session), _type (type), _offer_inputs (offer_inputs),
- buss (_("Buss"), "ardour:", mask & BUSS),
+ buss (_("Bus"), "ardour:", mask & BUSS),
track (_("Track"), "ardour:", mask & TRACK),
system (_("System"), "system:", mask & SYSTEM),
other (_("Other"), "", mask & OTHER)
const MidiSource* midi_source() const { return _midi_source; }
void set_midi_source(MidiSource* source) { _midi_source = source; }
- bool control_to_midi_event(boost::shared_ptr<MIDI::Event> ev, const MidiControlIterator& iter) const;
+ bool control_to_midi_event(boost::shared_ptr<MIDI::Event>& ev, const MidiControlIterator& iter) const;
private:
friend class DeltaCommand;
MidiModel::const_iterator::const_iterator(const MidiModel& model, double t)
: _model(&model)
- , _is_end( (t == DBL_MAX) || model.empty())
- , _locked( !_is_end)
+ , _is_end( (t == DBL_MAX) || model.empty() )
+ , _locked( !_is_end )
{
//cerr << "Created MIDI iterator @ " << t << " (is end: " << _is_end << ")" << endl;
- if (_is_end)
+ if (_is_end) {
return;
+ }
model.read_lock();
size_t index = other._control_iter - other._control_iters.begin();
_control_iter = _control_iters.begin() + index;
- if (!_is_end)
+ if (!_is_end) {
_event = boost::shared_ptr<MIDI::Event>(new MIDI::Event(*other._event, true));
+ }
return *this;
}
* \return true on success
*/
bool
-MidiModel::control_to_midi_event(boost::shared_ptr<MIDI::Event> ev, const MidiControlIterator& iter) const
+MidiModel::control_to_midi_event(boost::shared_ptr<MIDI::Event>& ev, const MidiControlIterator& iter) const
{
assert(iter.automation_list.get());
- if (!ev)
+ if (!ev) {
ev = boost::shared_ptr<MIDI::Event>(new MIDI::Event(0, 3, NULL, true));
+ }
switch (iter.automation_list->parameter().type()) {
case MidiCCAutomation: