mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
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:
parent
000802d23f
commit
af5b9f92a5
8 changed files with 39 additions and 21 deletions
|
|
@ -128,13 +128,31 @@ GlobalPortMatrixWindow::GlobalPortMatrixWindow (ARDOUR::Session& s, ARDOUR::Data
|
||||||
people with very large monitors */
|
people with very large monitors */
|
||||||
|
|
||||||
resize (32768, 32768);
|
resize (32768, 32768);
|
||||||
|
|
||||||
|
_port_matrix.MaxSizeChanged.connect (mem_fun (*this, &GlobalPortMatrixWindow::max_size_changed));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
GlobalPortMatrixWindow::on_realize ()
|
GlobalPortMatrixWindow::on_realize ()
|
||||||
{
|
{
|
||||||
Window::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 ();
|
pair<uint32_t, uint32_t> const m = _port_matrix.max_size ();
|
||||||
|
|
||||||
GdkGeometry g;
|
GdkGeometry g;
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void on_realize ();
|
void on_realize ();
|
||||||
|
void max_size_changed ();
|
||||||
|
void set_max_size ();
|
||||||
|
|
||||||
GlobalPortMatrix _port_matrix;
|
GlobalPortMatrix _port_matrix;
|
||||||
Gtk::Button _rescan_button;
|
Gtk::Button _rescan_button;
|
||||||
|
|
|
||||||
|
|
@ -421,9 +421,7 @@ PortGroupList::bundles () const
|
||||||
_bundles.clear ();
|
_bundles.clear ();
|
||||||
|
|
||||||
for (PortGroupList::List::const_iterator i = begin (); i != end (); ++i) {
|
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;
|
return _bundles;
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,7 @@ PortMatrix::PortMatrix (ARDOUR::Session& session, ARDOUR::DataType type)
|
||||||
_column_index (1),
|
_column_index (1),
|
||||||
_min_height_divisor (1),
|
_min_height_divisor (1),
|
||||||
_show_only_bundles (false),
|
_show_only_bundles (false),
|
||||||
_inhibit_toggle_show_only_bundles (false),
|
_inhibit_toggle_show_only_bundles (false)
|
||||||
_realized (false)
|
|
||||||
{
|
{
|
||||||
_body = new PortMatrixBody (this);
|
_body = new PortMatrixBody (this);
|
||||||
|
|
||||||
|
|
@ -115,7 +114,7 @@ PortMatrix::routes_changed ()
|
||||||
void
|
void
|
||||||
PortMatrix::setup ()
|
PortMatrix::setup ()
|
||||||
{
|
{
|
||||||
if (!_realized) {
|
if ((get_flags () & Gtk::REALIZED) == 0) {
|
||||||
select_arrangement ();
|
select_arrangement ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -461,15 +460,7 @@ PortMatrix::max_size () const
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PortMatrix::on_realize ()
|
PortMatrix::setup_max_size ()
|
||||||
{
|
{
|
||||||
Widget::on_realize ();
|
MaxSizeChanged ();
|
||||||
_realized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
PortMatrix::on_unrealize ()
|
|
||||||
{
|
|
||||||
Widget::on_unrealize ();
|
|
||||||
_realized = false;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,8 @@ public:
|
||||||
void setup_all_ports ();
|
void setup_all_ports ();
|
||||||
|
|
||||||
std::pair<uint32_t, uint32_t> max_size () const;
|
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 c Channels; where c[0] is from _ports[0] and c[1] is from _ports[1].
|
||||||
* @param s New state.
|
* @param s New state.
|
||||||
|
|
@ -160,8 +162,6 @@ private:
|
||||||
void hide_group (boost::weak_ptr<PortGroup>);
|
void hide_group (boost::weak_ptr<PortGroup>);
|
||||||
void show_group (boost::weak_ptr<PortGroup>);
|
void show_group (boost::weak_ptr<PortGroup>);
|
||||||
void toggle_show_only_bundles ();
|
void toggle_show_only_bundles ();
|
||||||
void on_realize ();
|
|
||||||
void on_unrealize ();
|
|
||||||
|
|
||||||
/// port type that we are working with
|
/// port type that we are working with
|
||||||
ARDOUR::DataType _type;
|
ARDOUR::DataType _type;
|
||||||
|
|
|
||||||
|
|
@ -471,6 +471,7 @@ void
|
||||||
PortMatrixBody::component_size_changed ()
|
PortMatrixBody::component_size_changed ()
|
||||||
{
|
{
|
||||||
compute_rectangles ();
|
compute_rectangles ();
|
||||||
|
_matrix->setup_max_size ();
|
||||||
_matrix->setup_scrollbars ();
|
_matrix->setup_scrollbars ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ PortMatrixColumnLabels::render (cairo_t* cr)
|
||||||
|
|
||||||
/* compute width of this group */
|
/* compute width of this group */
|
||||||
uint32_t w = 0;
|
uint32_t w = 0;
|
||||||
if (!(*i)->visible() || (*i)->bundles().empty()) {
|
if (!(*i)->visible()) {
|
||||||
w = grid_spacing ();
|
w = grid_spacing ();
|
||||||
} else {
|
} else {
|
||||||
if (_matrix->show_only_bundles()) {
|
if (_matrix->show_only_bundles()) {
|
||||||
|
|
@ -158,7 +158,11 @@ PortMatrixColumnLabels::render (cairo_t* cr)
|
||||||
} else {
|
} else {
|
||||||
w = (*i)->total_channels() * grid_spacing();
|
w = (*i)->total_channels() * grid_spacing();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (w == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* rectangle */
|
/* rectangle */
|
||||||
set_source_rgb (cr, get_a_group_colour (g));
|
set_source_rgb (cr, get_a_group_colour (g));
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ PortMatrixRowLabels::render (cairo_t* cr)
|
||||||
|
|
||||||
/* compute height of this group */
|
/* compute height of this group */
|
||||||
double h = 0;
|
double h = 0;
|
||||||
if (!(*i)->visible() || (*i)->bundles().empty()) {
|
if (!(*i)->visible()) {
|
||||||
h = grid_spacing ();
|
h = grid_spacing ();
|
||||||
} else {
|
} else {
|
||||||
if (_matrix->show_only_bundles()) {
|
if (_matrix->show_only_bundles()) {
|
||||||
|
|
@ -130,6 +130,10 @@ PortMatrixRowLabels::render (cairo_t* cr)
|
||||||
h = (*i)->total_channels () * grid_spacing();
|
h = (*i)->total_channels () * grid_spacing();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (h == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* rectangle */
|
/* rectangle */
|
||||||
set_source_rgb (cr, get_a_group_colour (g));
|
set_source_rgb (cr, get_a_group_colour (g));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue