Various tweaks to the port matrix.

git-svn-id: svn://localhost/ardour2/branches/3.0@5380 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-07-18 13:10:08 +00:00
parent 000802d23f
commit af5b9f92a5
8 changed files with 39 additions and 21 deletions

View file

@ -128,12 +128,30 @@ GlobalPortMatrixWindow::GlobalPortMatrixWindow (ARDOUR::Session& s, ARDOUR::Data
people with very large monitors */
resize (32768, 32768);
_port_matrix.MaxSizeChanged.connect (mem_fun (*this, &GlobalPortMatrixWindow::max_size_changed));
}
void
GlobalPortMatrixWindow::on_realize ()
{
Window::on_realize ();
set_max_size ();
}
void
GlobalPortMatrixWindow::max_size_changed ()
{
set_max_size ();
resize (32768, 32768);
}
void
GlobalPortMatrixWindow::set_max_size ()
{
if ((get_flags() & Gtk::REALIZED) == 0) {
return;
}
pair<uint32_t, uint32_t> const m = _port_matrix.max_size ();

View file

@ -64,6 +64,8 @@ public:
private:
void on_realize ();
void max_size_changed ();
void set_max_size ();
GlobalPortMatrix _port_matrix;
Gtk::Button _rescan_button;

View file

@ -421,9 +421,7 @@ PortGroupList::bundles () const
_bundles.clear ();
for (PortGroupList::List::const_iterator i = begin (); i != end (); ++i) {
if ((*i)->visible()) {
std::copy ((*i)->bundles().begin(), (*i)->bundles().end(), std::back_inserter (_bundles));
}
std::copy ((*i)->bundles().begin(), (*i)->bundles().end(), std::back_inserter (_bundles));
}
return _bundles;

View file

@ -50,8 +50,7 @@ PortMatrix::PortMatrix (ARDOUR::Session& session, ARDOUR::DataType type)
_column_index (1),
_min_height_divisor (1),
_show_only_bundles (false),
_inhibit_toggle_show_only_bundles (false),
_realized (false)
_inhibit_toggle_show_only_bundles (false)
{
_body = new PortMatrixBody (this);
@ -115,7 +114,7 @@ PortMatrix::routes_changed ()
void
PortMatrix::setup ()
{
if (!_realized) {
if ((get_flags () & Gtk::REALIZED) == 0) {
select_arrangement ();
}
@ -461,15 +460,7 @@ PortMatrix::max_size () const
}
void
PortMatrix::on_realize ()
PortMatrix::setup_max_size ()
{
Widget::on_realize ();
_realized = true;
}
void
PortMatrix::on_unrealize ()
{
Widget::on_unrealize ();
_realized = false;
MaxSizeChanged ();
}

View file

@ -110,6 +110,8 @@ public:
void setup_all_ports ();
std::pair<uint32_t, uint32_t> max_size () const;
void setup_max_size ();
sigc::signal<void> MaxSizeChanged;
/** @param c Channels; where c[0] is from _ports[0] and c[1] is from _ports[1].
* @param s New state.
@ -160,8 +162,6 @@ private:
void hide_group (boost::weak_ptr<PortGroup>);
void show_group (boost::weak_ptr<PortGroup>);
void toggle_show_only_bundles ();
void on_realize ();
void on_unrealize ();
/// port type that we are working with
ARDOUR::DataType _type;

View file

@ -471,6 +471,7 @@ void
PortMatrixBody::component_size_changed ()
{
compute_rectangles ();
_matrix->setup_max_size ();
_matrix->setup_scrollbars ();
}

View file

@ -150,7 +150,7 @@ PortMatrixColumnLabels::render (cairo_t* cr)
/* compute width of this group */
uint32_t w = 0;
if (!(*i)->visible() || (*i)->bundles().empty()) {
if (!(*i)->visible()) {
w = grid_spacing ();
} else {
if (_matrix->show_only_bundles()) {
@ -158,7 +158,11 @@ PortMatrixColumnLabels::render (cairo_t* cr)
} else {
w = (*i)->total_channels() * grid_spacing();
}
}
}
if (w == 0) {
continue;
}
/* rectangle */
set_source_rgb (cr, get_a_group_colour (g));

View file

@ -121,7 +121,7 @@ PortMatrixRowLabels::render (cairo_t* cr)
/* compute height of this group */
double h = 0;
if (!(*i)->visible() || (*i)->bundles().empty()) {
if (!(*i)->visible()) {
h = grid_spacing ();
} else {
if (_matrix->show_only_bundles()) {
@ -131,6 +131,10 @@ PortMatrixRowLabels::render (cairo_t* cr)
}
}
if (h == 0) {
continue;
}
/* rectangle */
set_source_rgb (cr, get_a_group_colour (g));
double const rw = _highest_group_name + 2 * name_pad();