*fix the bugfix: Input and Output Ports exchanged in Track/Bus inspector
authorHans Baier <hansfbaier@googlemail.com>
Fri, 23 May 2008 02:13:31 +0000 (02:13 +0000)
committerHans Baier <hansfbaier@googlemail.com>
Fri, 23 May 2008 02:13:31 +0000 (02:13 +0000)
*increased buffer sizes to get rid of overruns (PitchBender still doesnt work though....)

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

gtk2_ardour/io_selector.cc
libs/ardour/buffer_set.cc
libs/ardour/midi_model.cc
libs/ardour/midi_port.cc

index 1708c9036e53e164033bd91d6f7b7c91164c9923..b0b1a5f9b7674496e87b2e0995a8902fc6bfc8e4 100644 (file)
@@ -34,7 +34,7 @@
 
 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)
@@ -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->input(r)->get_connections (connections);
-       } else {
                _io->output(r)->get_connections (connections);
+       } else {
+               _io->input(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 280f70693b6ce2d017a2d623db496c1473eb5d34..65e9f8ac8f0695e9bc012f9479e1188c76f777be 100644 (file)
@@ -107,7 +107,7 @@ BufferSet::ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capac
        // See MidiPort::MidiPort
        // We probably need a map<DataType, size_t> parameter for capacity
        if (type == DataType::MIDI)
-               buffer_capacity *= 4;
+               buffer_capacity *= 8;
 
        // The vector of buffers of the type we care about
        BufferVec& bufs = _buffers[type];
index bf92c4f341a3d18aea3b28769d28a37851b528f3..5d327cd2d7d221ae1b3074a22d1d3adeba129574 100644 (file)
@@ -180,9 +180,9 @@ const MidiModel::const_iterator& MidiModel::const_iterator::operator++()
        
        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;
index 6b097930f1cb89ecc515590baca8c3a7e54e3271..14f88f2ad5a0f59d95a52560432cf977290ecede 100644 (file)
@@ -33,7 +33,7 @@ MidiPort::MidiPort (const std::string& name, Flags flags, bool external, nframes
 {
        // FIXME: size kludge (see BufferSet::ensure_buffers)
        // Jack needs to tell us this
-       _buffer = new MidiBuffer (capacity * 4);
+       _buffer = new MidiBuffer (capacity * 8);
 
        if (external) {
                /* external ports use the same buffer for the jack port (_ext_port)