projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new trim cursors from chrisg, fix up hotspots for said cursors, make Editor cursors...
[ardour.git]
/
gtk2_ardour
/
port_matrix_component.h
diff --git
a/gtk2_ardour/port_matrix_component.h
b/gtk2_ardour/port_matrix_component.h
index 7531e44bddd81cf06ed8ea488bdd00139a669a48..196a24b0c01333987d88a7e156a906a1e42bf3b7 100644
(file)
--- a/
gtk2_ardour/port_matrix_component.h
+++ b/
gtk2_ardour/port_matrix_component.h
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2002-2009 Paul Davis
+ Copyright (C) 2002-2009 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-20,10
+20,19
@@
#ifndef __gtk_ardour_port_matrix_component_h__
#define __gtk_ardour_port_matrix_component_h__
#ifndef __gtk_ardour_port_matrix_component_h__
#define __gtk_ardour_port_matrix_component_h__
+#include <stdint.h>
#include <gtkmm/eventbox.h>
#include <gtkmm/eventbox.h>
+#include <boost/shared_ptr.hpp>
+class PortMatrix;
class PortMatrixBody;
class PortMatrixNode;
class PortMatrixBody;
class PortMatrixNode;
+class PortGroup;
+class PortGroupList;
+
+namespace ARDOUR {
+ class BundleChannel;
+}
/** One component of the PortMatrix. This is a cairo-rendered
* Pixmap.
/** One component of the PortMatrix. This is a cairo-rendered
* Pixmap.
@@
-31,16
+40,20
@@
class PortMatrixNode;
class PortMatrixComponent
{
public:
class PortMatrixComponent
{
public:
- PortMatrixComponent (PortMatrixBody *);
+ PortMatrixComponent (PortMatrix
*, PortMatrix
Body *);
virtual ~PortMatrixComponent ();
virtual double component_to_parent_x (double x) const = 0;
virtual double parent_to_component_x (double x) const = 0;
virtual double component_to_parent_y (double y) const = 0;
virtual double parent_to_component_y (double y) const = 0;
virtual ~PortMatrixComponent ();
virtual double component_to_parent_x (double x) const = 0;
virtual double parent_to_component_x (double x) const = 0;
virtual double component_to_parent_y (double y) const = 0;
virtual double parent_to_component_y (double y) const = 0;
- virtual void mouseover_changed (
PortMatrixNode
const &) = 0;
+ virtual void mouseover_changed (
std::list<PortMatrixNode>
const &) = 0;
virtual void draw_extra (cairo_t *) = 0;
virtual void draw_extra (cairo_t *) = 0;
+ virtual void button_press (double, double, int, uint32_t, guint) {}
+ virtual void button_release (double, double, int, uint32_t, guint) {}
+ virtual void motion (double, double) {}
+ void set_show_ports (bool);
void setup ();
GdkPixmap* get_pixmap (GdkDrawable *);
std::pair<uint32_t, uint32_t> dimensions ();
void setup ();
GdkPixmap* get_pixmap (GdkDrawable *);
std::pair<uint32_t, uint32_t> dimensions ();
@@
-48,7
+61,7
@@
public:
void require_render () {
_render_required = true;
}
void require_render () {
_render_required = true;
}
-
+
void require_rebuild () {
_dimension_computation_required = true;
_render_required = true;
void require_rebuild () {
_dimension_computation_required = true;
_render_required = true;
@@
-62,14
+75,9
@@
public:
return _parent_rectangle;
}
return _parent_rectangle;
}
- /** @return width of columns in the grid */
- static uint32_t column_width () {
- return 32;
- }
-
- /** @return height of rows in the grid */
- static uint32_t row_height () {
- return 32;
+ /** @return grid spacing */
+ static uint32_t grid_spacing () {
+ return 24;
}
protected:
}
protected:
@@
-85,18
+93,18
@@
protected:
}
/** @return width of thin lines in the grid */
}
/** @return width of thin lines in the grid */
- static
uint32_t
thin_grid_line_width () {
- return
1
;
+ static
double
thin_grid_line_width () {
+ return
0.5
;
}
/** @return width of thick lines in the grid */
}
/** @return width of thick lines in the grid */
- static
uint32_t
thick_grid_line_width () {
- return
2
;
+ static
double
thick_grid_line_width () {
+ return
1
;
}
/** @return space around the connection indicator */
static uint32_t connection_indicator_pad () {
}
/** @return space around the connection indicator */
static uint32_t connection_indicator_pad () {
- return
8
;
+ return
6
;
}
static uint32_t mouseover_line_width () {
}
static uint32_t mouseover_line_width () {
@@
-108,12
+116,10
@@
protected:
return M_PI / 4;
}
return M_PI / 4;
}
- /* XXX I guess these colours should come from a theme, or something */
-
/** @return background colour */
/** @return background colour */
- static Gdk::Color background_colour () {
- return Gdk::Color ("#000000");
- }
+ Gdk::Color background_colour ();
+
+ /* XXX I guess these colours should come from a theme, or something */
/** @return text colour */
static Gdk::Color text_colour () {
/** @return text colour */
static Gdk::Color text_colour () {
@@
-122,7
+128,7
@@
protected:
/** @return grid line colour */
static Gdk::Color grid_colour () {
/** @return grid line colour */
static Gdk::Color grid_colour () {
- return Gdk::Color ("#
333333
");
+ return Gdk::Color ("#
000000
");
}
/** @return colour of association blobs */
}
/** @return colour of association blobs */
@@
-140,8
+146,8
@@
protected:
return Gdk::Color ("#ff0000");
}
return Gdk::Color ("#ff0000");
}
- /** @return colour to paint
mouseover line
s */
- static Gdk::Color
mouseover_port
_colour () {
+ /** @return colour to paint
channel highlight
s */
+ static Gdk::Color
highlighted_channel
_colour () {
return Gdk::Color ("#777777");
}
return Gdk::Color ("#777777");
}
@@
-162,10
+168,12
@@
protected:
return Gdk::Color ("#444444");
}
}
return Gdk::Color ("#444444");
}
}
-
+
void set_source_rgb (cairo_t *, Gdk::Color const &);
void set_source_rgba (cairo_t *, Gdk::Color const &, double);
void set_source_rgb (cairo_t *, Gdk::Color const &);
void set_source_rgba (cairo_t *, Gdk::Color const &, double);
- std::pair<std::string, double> display_port_name (cairo_t*, std::string const &, double) const;
+ uint32_t group_size (boost::shared_ptr<const PortGroup>) const;
+ uint32_t channel_to_position (ARDOUR::BundleChannel, boost::shared_ptr<const PortGroup>) const;
+ virtual ARDOUR::BundleChannel position_to_channel (double, double, boost::shared_ptr<const PortGroup>) const;
/** Render the complete component to a cairo context. */
virtual void render (cairo_t *) = 0;
/** Render the complete component to a cairo context. */
virtual void render (cairo_t *) = 0;
@@
-174,12
+182,13
@@
protected:
*/
virtual void compute_dimensions () = 0;
*/
virtual void compute_dimensions () = 0;
+ PortMatrix* _matrix;
PortMatrixBody* _body; ///< the PortMatrixBody that we're in
uint32_t _width; ///< full width of the contents
uint32_t _height; ///< full height of the contents
Gdk::Rectangle _parent_rectangle;
PortMatrixBody* _body; ///< the PortMatrixBody that we're in
uint32_t _width; ///< full width of the contents
uint32_t _height; ///< full height of the contents
Gdk::Rectangle _parent_rectangle;
-private:
+private:
GdkPixmap* _pixmap; ///< pixmap
bool _render_required; ///< true if the rendered pixmap is out of date
bool _dimension_computation_required; ///< true if the dimensions are out of date
GdkPixmap* _pixmap; ///< pixmap
bool _render_required; ///< true if the rendered pixmap is out of date
bool _dimension_computation_required; ///< true if the dimensions are out of date