* bugfix: Inputs and Outputs swapped in the Track/Bus Inspector
authorHans Baier <hansfbaier@googlemail.com>
Wed, 21 May 2008 23:01:40 +0000 (23:01 +0000)
committerHans Baier <hansfbaier@googlemail.com>
Wed, 21 May 2008 23:01:40 +0000 (23:01 +0000)
* bugfix: control_to_midi_event has no effect
* typo (track/bus inspector)

git-svn-id: svn://localhost/ardour2/branches/3.0@3379 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/io_selector.cc
gtk2_ardour/port_matrix.cc
libs/ardour/ardour/midi_model.h
libs/ardour/midi_model.cc

index f0d589c138b372d5d6fa1ad9fb41ba5c643e60a6..1708c9036e53e164033bd91d6f7b7c91164c9923 100644 (file)
@@ -40,7 +40,7 @@ IOSelector::IOSelector (ARDOUR::Session& session, boost::shared_ptr<ARDOUR::IO>
          _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));
@@ -69,13 +69,13 @@ void
 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);
@@ -89,9 +89,9 @@ IOSelector::get_state (int r, std::string const & p) const
        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;
@@ -110,7 +110,7 @@ IOSelector::get_state (int r, std::string const & p) const
 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());
@@ -120,7 +120,7 @@ IOSelector::n_rows () const
 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());
@@ -131,7 +131,7 @@ IOSelector::maximum_rows () const
 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());
@@ -141,7 +141,7 @@ IOSelector::minimum_rows () const
 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();
@@ -155,7 +155,7 @@ IOSelector::add_row ()
        // 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);
@@ -186,7 +186,7 @@ IOSelector::remove_row (int r)
        // 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);
index f47a4ff191a8b1c64467d3c9fd6e157da79e9250..425ad80bbc9198efc9b77a9548d4fd0939c9c1b1 100644 (file)
@@ -601,7 +601,7 @@ PortMatrix::set_offer_inputs (bool i)
 
 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)
index a49a8783716b1cac44e3623cebe8fd78c21635e0..2481aa8d342f63d2a6cdd4bc78cdcc120a77c75d 100644 (file)
@@ -200,7 +200,7 @@ public:
        
        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;
index d01bf4276b3500f66ca98601854e79525295506f..02b076a5e5c24b457d186127c41aa2cbe874fbdd 100644 (file)
@@ -59,13 +59,14 @@ void MidiModel::read_unlock() const {
 
 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();
 
@@ -286,8 +287,9 @@ MidiModel::const_iterator& MidiModel::const_iterator::operator=(const const_iter
        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;
 }
@@ -355,11 +357,12 @@ size_t MidiModel::read(MidiRingBuffer& dst, nframes_t start, nframes_t nframes,
  * \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: