From 3b96ad2a9759feaf2d3b2c676630c12bbbdfbaae Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 11 Jan 2009 18:30:30 +0000 Subject: [PATCH] pending changes to port_matrix code git-svn-id: svn://localhost/ardour2/branches/3.0@4401 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_matrix.cc | 89 +------------------------------------- gtk2_ardour/port_matrix.h | 1 - 2 files changed, 2 insertions(+), 88 deletions(-) diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index 5b259e79cf..f3bcce8105 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -110,7 +110,6 @@ PortGroupUI::setup_visibility () PortMatrix::PortMatrix (ARDOUR::Session& session, ARDOUR::DataType type, bool offer_inputs, PortGroupList::Mask mask) : _offer_inputs (offer_inputs), _port_group_list (session, type, offer_inputs, mask), _type (type) { - _row_labels_vbox = 0; _side_vbox_pad = 0; _visibility_checkbutton_box.pack_start (*(manage (new Label (_("Connections displayed: ")))), false, false, 10); @@ -119,11 +118,6 @@ PortMatrix::PortMatrix (ARDOUR::Session& session, ARDOUR::DataType type, bool of _scrolled_window.set_policy (POLICY_ALWAYS, POLICY_AUTOMATIC); _scrolled_window.set_shadow_type (SHADOW_NONE); - VBox* b = manage (new VBox); - - b->pack_start (_port_group_hbox, false, false); - b->pack_start (_port_group_hbox, false, false); - _scrolled_window.add (matrix); if (offer_inputs) { @@ -135,8 +129,6 @@ PortMatrix::PortMatrix (ARDOUR::Session& session, ARDOUR::DataType type, bool of } pack_start (_overall_hbox); - - _port_group_hbox.signal_size_allocate().connect (sigc::hide (sigc::mem_fun (*this, &IOSelector::setup_dimensions))); } PortMatrix::~PortMatrix () @@ -154,17 +146,6 @@ PortMatrix::set_ports (const std::list& ports) void PortMatrix::clear () { - for (std::vector::iterator j = _row_labels.begin(); j != _row_labels.end(); ++j) { - delete *j; - } - _row_labels.clear (); - - if (_row_labels_vbox) { - _side_vbox.remove (*_row_labels_vbox); - delete _row_labels_vbox; - _row_labels_vbox = 0; - } - /* remove lurking, invisible label and padding */ _side_vbox.children().clear (); @@ -180,73 +161,16 @@ PortMatrix::clear () _port_group_ui.clear (); } - -/** Set up dimensions of some of our widgets which depend on other dimensions - * within the dialogue. - */ -void -PortMatrix::setup_dimensions () -{ - /* Row labels */ - for (std::vector::iterator j = _row_labels.begin(); j != _row_labels.end(); ++j) { - (*j)->get_child()->set_size_request (-1, matrix.row_spacing()); - } - - if (_side_vbox_pad) { - if (_offer_inputs) { - _side_vbox_pad->set_size_request (-1, matrix.row_spacing() / 4); - } else { - _side_vbox_pad->set_size_request (-1, matrix.row_spacing() / 4); - } - } -} - - /** Set up the dialogue */ void PortMatrix::setup () { clear (); - int const rows = n_rows (); - - /* Row labels */ - - _row_labels_vbox = new VBox; - int const run_rows = std::max (1, rows); - - for (int j = 0; j < run_rows; ++j) { - - /* embolden the port/channel name */ - - string s = ""; - s += row_name (j); - s += ""; - - Label* label = manage (new Label (s)); - EventBox* b = manage (new EventBox); - - label->set_use_markup (true); - - b->set_events (Gdk::BUTTON_PRESS_MASK); - b->signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &IOSelector::row_label_button_pressed), j)); - b->add (*label); - - _row_labels.push_back (b); - _row_labels_vbox->pack_start (*b, false, false); - } - _side_vbox_pad = new Label (""); /* unmanaged, explicitly deleted */ - if (_offer_inputs) { - _side_vbox.pack_start (*_side_vbox_pad, false, false); - _side_vbox.pack_start (*_row_labels_vbox, false, false); - _side_vbox.pack_start (*manage (new Label (""))); - } else { - _side_vbox.pack_start (*manage (new Label (""))); - _side_vbox.pack_start (*_row_labels_vbox, false, false); - _side_vbox.pack_start (*_side_vbox_pad, false, false); - } + _side_vbox.pack_start (*_side_vbox_pad, false, false); + _side_vbox.pack_start (*manage (new Label (""))); matrix.clear (); @@ -418,8 +342,6 @@ PortGroupList::refresh () finding all the ports that we can connect to. */ - cerr << "Looking for non-ardour ports\n"; - const char **ports = _session.engine().get_ports ("", _type.to_jack_type(), _offer_inputs ? JackPortIsInput : JackPortIsOutput); if (ports) { @@ -427,8 +349,6 @@ PortGroupList::refresh () int n = 0; string client_matching_string; - cerr << "Got some\n"; - client_matching_string = _session.engine().client_name(); client_matching_string += ':'; @@ -451,11 +371,6 @@ PortGroupList::refresh () free (ports); } - cerr << "at end of refresh, we have " << buss.ports.size () << " buss\n"; - cerr << "at end of refresh, we have " << track.ports.size () << " track\n"; - cerr << "at end of refresh, we have " << system.ports.size () << " system\n"; - cerr << "at end of refresh, we have " << other.ports.size () << " other\n"; - push_back (&system); push_back (&buss); push_back (&track); diff --git a/gtk2_ardour/port_matrix.h b/gtk2_ardour/port_matrix.h index e755d77328..f20c88055f 100644 --- a/gtk2_ardour/port_matrix.h +++ b/gtk2_ardour/port_matrix.h @@ -88,7 +88,6 @@ class PortMatrix : public Gtk::VBox { void setup (); void clear (); - void setup_dimensions (); bool row_label_button_pressed (GdkEventButton*, int); void reset_visibility (); };