23 #include "canvas/colors.h"
43 cairo_surface_t* surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, 200, 200);
44 cairo_t* cr = cairo_create (surface);
57 for (PortGroup::BundleList::const_iterator j = c.begin (); j != c.end(); ++j) {
59 cairo_text_extents_t ext;
60 cairo_text_extents (cr, (*j)->bundle->name().c_str(), &ext);
65 for (uint32_t k = 0; k < (*j)->bundle->nchannels().n_total(); ++k) {
73 (*j)->bundle->channel_name (k).c_str(),
85 cairo_text_extents_t ext;
86 cairo_text_extents (cr,
X_(
"AQRjpy"), &ext);
98 cairo_surface_destroy (surface);
134 for (PortGroup::BundleList::const_iterator i = bundles.begin (); i != bundles.end(); ++i) {
154 for (PortGroup::BundleList::const_iterator i = bundles.begin (); i != bundles.end(); ++i) {
158 for (uint32_t j = 0; j < C; ++j) {
163 (*i)->bundle->type_channel_to_overall (
_matrix->
type (), j)
209 for (list<PortMatrixNode>::const_iterator i = m.begin(); i != m.end(); ++i) {
222 vector<pair<double, double> >
225 vector<pair<double, double> > shape;
234 shape.push_back (make_pair (x_, y_));
236 shape.push_back (make_pair (x_, y_));
237 x_ -= lc * cos (
angle());
238 y_ += lc * sin (
angle());
239 shape.push_back (make_pair (x_, y_));
240 x_ += w * pow (sin (
angle()), 2);
242 shape.push_back (make_pair (x_, y_));
248 shape.push_back (make_pair (x_, y_));
250 shape.push_back (make_pair (x_, y_));
251 x_ += lc * cos (
angle());
252 y_ -= lc * sin (
angle());
253 shape.push_back (make_pair (x_, y_));
256 shape.push_back (make_pair (x_, y_));
282 cairo_move_to (cr, x_, y_);
284 cairo_line_to (cr, x_, y_);
287 cairo_line_to (cr, x_, y_);
289 cairo_line_to (cr, x_, y_);
290 cairo_line_to (cr, xoff, y);
291 cairo_fill_preserve (cr);
296 Gdk::Color textcolor;
326 cairo_rotate (cr, -
angle());
327 cairo_show_text (cr, b->
name().c_str());
333 cairo_t* cr, Gdk::Color fg_colour, Gdk::Color bg_colour,
double xoff,
double yoff,
ARDOUR::BundleChannel const &bc
336 vector<pair<double, double> >
const shape =
port_name_shape (xoff, yoff);
338 cairo_move_to (cr, shape[0].first, shape[0].second);
339 for (uint32_t i = 1; i < 4; ++i) {
340 cairo_line_to (cr, shape[i].first, shape[i].second);
342 cairo_line_to (cr, shape[0].first, shape[0].second);
345 cairo_fill_preserve (cr);
350 Gdk::Color textcolor;
381 cairo_rotate (cr, -
angle());
413 _body->queue_draw_area (
428 _body->queue_draw_area (
439 _body->queue_draw_area (
473 }
else if (ev->button == 3) {
501 list<PortMatrixNode> n;
503 for (uint32_t i = 0; i < w.
bundle->nchannels().n_total(); ++i) {
void popup_menu(ARDOUR::BundleChannel, ARDOUR::BundleChannel, uint32_t)
void add_channel_highlight(ARDOUR::BundleChannel const &)
double parent_to_component_x(double x) const
void motion(double, double)
std::vector< std::pair< double, double > > port_name_shape(double, double) const
void set_source_rgb(cairo_t *, Gdk::Color const &)
List::const_iterator begin() const
static uint32_t name_pad()
virtual void remove_channel(ARDOUR::BundleChannel)
std::list< BundleRecord * > BundleList
bool should_show(ARDOUR::DataType) const
double component_to_parent_x(double x) const
static uint32_t grid_spacing()
std::list< PortMatrixNode > mouseover() const
uint32_t count_of_our_type(ARDOUR::ChanCount) const
static Gdk::Color get_a_bundle_colour(int x)
ARDOUR::BundleChannel position_to_channel(double, double, boost::shared_ptr< const PortGroup >) const
void render_channel_name(cairo_t *, Gdk::Color, Gdk::Color, double, double, ARDOUR::BundleChannel const &)
void compute_dimensions()
double basic_text_x_pos(int) const
double channel_x(ARDOUR::BundleChannel const &) const
double component_to_parent_y(double y) const
List::const_iterator end() const
column labels on top, row labels to the right
uint32_t _height
full height of the contents
uint32_t gdk_color_to_rgba(Gdk::Color const &)
uint32_t contrasting_text_color(uint32_t c)
void set_color_from_rgba(Gdk::Color &, uint32_t)
double _longest_channel_name
uint32_t group_size(boost::shared_ptr< const PortGroup >) const
double parent_to_component_y(double y) const
PortGroup::BundleList const & bundles() const
virtual ARDOUR::BundleChannel position_to_channel(double, double, boost::shared_ptr< const PortGroup >) const
ChanCount nchannels() const
uint32_t channel_to_position(ARDOUR::BundleChannel, boost::shared_ptr< const PortGroup >) const
Gdk::Color background_colour()
void mouseover_changed(std::list< PortMatrixNode > const &)
uint32_t count_of_our_type_min_1(ARDOUR::ChanCount) const
Gdk::Rectangle _parent_rectangle
double _longest_bundle_name
void highlight_associated_channels(int, ARDOUR::BundleChannel)
static uint32_t label_border_width()
PortMatrixBody * _body
the PortMatrixBody that we're in
row labels to the left, column labels on the bottom
bool show_only_bundles() const
ARDOUR::DataType type() const
static bool is_delete_event(GdkEventButton *)
void set_mouseover(PortMatrixNode const &)
uint32_t _width
full width of the contents
boost::shared_ptr< Bundle > bundle
void render_bundle_name(cairo_t *, Gdk::Color, Gdk::Color, double, double, boost::shared_ptr< ARDOUR::Bundle >)
double channel_y(ARDOUR::BundleChannel const &) const
void button_press(double, double, GdkEventButton *)
boost::shared_ptr< const PortGroup > visible_columns() const
int channel
channel index, or -1 for "all"
PortMatrixColumnLabels(PortMatrix *, PortMatrixBody *)
static bool bundle_with_channels(boost::shared_ptr< ARDOUR::Bundle >)
Arrangement arrangement() const
PortGroupList const * columns() const
void queue_draw_for(ARDOUR::BundleChannel const &)