#include <gtkmm/entry.h>
#include "ardour_dialog.h"
#include "port_matrix.h"
+#include "i18n.h"
namespace ARDOUR {
class Session;
void setup_ports (int);
bool list_is_global (int) const;
+ std::string disassociation_verb () const {
+ return _("Disassociate");
+ }
+
private:
enum {
OTHER = 0,
#include "port_matrix.h"
#include "port_group.h"
#include "ardour_dialog.h"
+#include "i18n.h"
class GlobalPortMatrix : public PortMatrix
{
return false;
}
+ std::string disassociation_verb () const {
+ return _("Disconnect");
+ }
+
bool list_is_global (int) const {
return true;
}
#include "ardour_dialog.h"
#include "port_matrix.h"
+#include "i18n.h"
namespace ARDOUR {
class PortInsert;
bool can_rename_channels (int d) const {
return false;
}
+
+ std::string disassociation_verb () const {
+ return _("Disconnect");
+ }
uint32_t n_io_ports () const;
boost::shared_ptr<ARDOUR::IO> const io () { return _io; }
return _other;
}
-
private:
int _other;
#include "ardour/route.h"
#include "port_matrix.h"
#include "port_matrix_body.h"
+#include "port_matrix_component.h"
#include "i18n.h"
using namespace std;
boost::weak_ptr<ARDOUR::Bundle> w (bc[dim].bundle);
if (_show_only_bundles) {
- snprintf (buf, sizeof (buf), _("Disassociate all from '%s'"), bc[dim].bundle->name().c_str());
+ snprintf (buf, sizeof (buf), _("%s all from '%s'"), disassociation_verb().c_str(), bc[dim].bundle->name().c_str());
} else {
snprintf (
- buf, sizeof (buf), _("Disassociate all from '%s/%s'"),
- bc[dim].bundle->name().c_str(), bc[dim].bundle->channel_name (bc[dim].channel).c_str()
+ buf, sizeof (buf), _("%s all from '%s/%s'"),
+ disassociation_verb().c_str(),
+ bc[dim].bundle->name().c_str(),
+ bc[dim].bundle->channel_name (bc[dim].channel).c_str()
);
}
{
MaxSizeChanged ();
}
+
+bool
+PortMatrix::on_scroll_event (GdkEventScroll* ev)
+{
+ double const h = _hscroll.get_value ();
+ double const v = _vscroll.get_value ();
+
+ switch (ev->direction) {
+ case GDK_SCROLL_UP:
+ _vscroll.set_value (v - PortMatrixComponent::grid_spacing ());
+ break;
+ case GDK_SCROLL_DOWN:
+ _vscroll.set_value (v + PortMatrixComponent::grid_spacing ());
+ break;
+ case GDK_SCROLL_LEFT:
+ _hscroll.set_value (h - PortMatrixComponent::grid_spacing ());
+ break;
+ case GDK_SCROLL_RIGHT:
+ _hscroll.set_value (h + PortMatrixComponent::grid_spacing ());
+ break;
+ }
+
+ return true;
+}
virtual void remove_channel (ARDOUR::BundleChannel) = 0;
virtual bool can_rename_channels (int) const = 0;
virtual void rename_channel (ARDOUR::BundleChannel) {}
+ virtual std::string disassociation_verb () const = 0;
enum Result {
Cancelled,
void hide_group (boost::weak_ptr<PortGroup>);
void show_group (boost::weak_ptr<PortGroup>);
void toggle_show_only_bundles ();
+ bool on_scroll_event (GdkEventScroll *);
/// port type that we are working with
ARDOUR::DataType _type;
} else if (_matrix->arrangement() == PortMatrix::LEFT_TO_BOTTOM) {
col_rect.set_height (min (_alloc_height, col.second));
-
+
row_rect.set_x (0);
row_rect.set_y (0);
row_rect.set_width (min (_alloc_width, row.first));
_highest_text = 0;
/* width of the whole thing */
_width = 0;
-
- PortGroup::BundleList const c = _matrix->columns()->bundles();
- for (PortGroup::BundleList::const_iterator i = c.begin (); i != c.end(); ++i) {
-
- cairo_text_extents_t ext;
- cairo_text_extents (cr, i->bundle->name().c_str(), &ext);
- if (ext.width > _longest_bundle_name) {
- _longest_bundle_name = ext.width;
- }
- if (ext.height > _highest_text) {
- _highest_text = ext.height;
- }
-
- for (uint32_t j = 0; j < i->bundle->nchannels (); ++j) {
+ _highest_group_name = 0;
+
+ for (PortGroupList::List::const_iterator i = _matrix->columns()->begin(); i != _matrix->columns()->end(); ++i) {
+ PortGroup::BundleList const c = _matrix->columns()->bundles();
+ for (PortGroup::BundleList::const_iterator j = c.begin (); j != c.end(); ++j) {
- cairo_text_extents (
- cr,
- i->bundle->channel_name (j).c_str(),
- &ext
- );
+ cairo_text_extents_t ext;
+ cairo_text_extents (cr, j->bundle->name().c_str(), &ext);
+ if (ext.width > _longest_bundle_name) {
+ _longest_bundle_name = ext.width;
+ }
+
+ if (ext.height > _highest_text) {
+ _highest_text = ext.height;
+ }
+
+ for (uint32_t k = 0; k < j->bundle->nchannels (); ++k) {
+
+ cairo_text_extents (
+ cr,
+ j->bundle->channel_name (k).c_str(),
+ &ext
+ );
+ }
if (ext.width > _longest_channel_name) {
_longest_channel_name = ext.width;
}
}
- if (_matrix->show_only_bundles()) {
- _width += grid_spacing();
- } else {
- _width += i->bundle->nchannels() * grid_spacing();
- }
- }
+ _width += group_size (*i) * grid_spacing ();
- _highest_group_name = 0;
- for (PortGroupList::List::const_iterator i = _matrix->columns()->begin(); i != _matrix->columns()->end(); ++i) {
- if ((*i)->visible()) {
- cairo_text_extents_t ext;
- cairo_text_extents (cr, (*i)->name.c_str(), &ext);
- if (ext.height > _highest_group_name) {
- _highest_group_name = ext.height;
- }
- } else {
- _width += grid_spacing ();
+ cairo_text_extents_t ext;
+ cairo_text_extents (cr, (*i)->name.c_str(), &ext);
+ if (ext.height > _highest_group_name) {
+ _highest_group_name = ext.height;
}
}
PortMatrixGrid::compute_dimensions ()
{
_width = 0;
+
for (PortGroupList::List::const_iterator i = _matrix->columns()->begin(); i != _matrix->columns()->end(); ++i) {
_width += group_size (*i) * grid_spacing ();
}
_longest_port_name = 0;
_longest_bundle_name = 0;
_height = 0;
+ _highest_group_name = 0;
+
+ for (PortGroupList::List::const_iterator i = _matrix->rows()->begin(); i != _matrix->rows()->end(); ++i) {
+
+ PortGroup::BundleList const r = (*i)->bundles ();
+ for (PortGroup::BundleList::const_iterator j = r.begin(); j != r.end(); ++j) {
+
+ for (uint32_t k = 0; k < j->bundle->nchannels(); ++k) {
+ cairo_text_extents_t ext;
+ cairo_text_extents (cr, j->bundle->channel_name(k).c_str(), &ext);
+ if (ext.width > _longest_port_name) {
+ _longest_port_name = ext.width;
+ }
+ }
- PortGroup::BundleList const r = _matrix->rows()->bundles();
- for (PortGroup::BundleList::const_iterator i = r.begin(); i != r.end(); ++i) {
- for (uint32_t j = 0; j < i->bundle->nchannels(); ++j) {
cairo_text_extents_t ext;
- cairo_text_extents (cr, i->bundle->channel_name(j).c_str(), &ext);
- if (ext.width > _longest_port_name) {
- _longest_port_name = ext.width;
+ cairo_text_extents (cr, j->bundle->name().c_str(), &ext);
+ if (ext.width > _longest_bundle_name) {
+ _longest_bundle_name = ext.width;
}
}
+ _height += group_size (*i) * grid_spacing ();
+
cairo_text_extents_t ext;
- cairo_text_extents (cr, i->bundle->name().c_str(), &ext);
- if (ext.width > _longest_bundle_name) {
- _longest_bundle_name = ext.width;
- }
-
- if (_matrix->show_only_bundles()) {
- _height += grid_spacing ();
- } else {
- _height += i->bundle->nchannels() * grid_spacing();
+ cairo_text_extents (cr, (*i)->name.c_str(), &ext);
+ if (ext.height > _highest_group_name) {
+ _highest_group_name = ext.height;
}
}
- _highest_group_name = 0;
- for (PortGroupList::List::const_iterator i = _matrix->rows()->begin(); i != _matrix->rows()->end(); ++i) {
- if ((*i)->visible()) {
- cairo_text_extents_t ext;
- cairo_text_extents (cr, (*i)->name.c_str(), &ext);
- if (ext.height > _highest_group_name) {
- _highest_group_name = ext.height;
- }
- } else {
- /* add another grid_spacing for a tab for this hidden group */
- _height += grid_spacing ();
- }
- }
-
cairo_destroy (cr);
gdk_pixmap_unref (pm);
void
RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> insert)
{
- Placement place = PreFader;
-
boost::shared_ptr<Send> send;
boost::shared_ptr<Return> retrn;
boost::shared_ptr<PluginInsert> plugin_insert;
bool can_rename_channels (int) const {
return false;
}
+
+ std::string disassociation_verb () const {
+ return _("Disassociate");
+ }
private:
/* see PortMatrix: signal flow from 0 to 1 (out to in) */