plugin selector from doug; lots and lots of fixes from karsten
git-svn-id: svn://localhost/trunk/ardour2@105 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
46cbbae4ee
commit
bac3c6bc0f
|
@ -116,6 +116,7 @@ glade_factory.cc
|
||||||
grouped_buttons.cc
|
grouped_buttons.cc
|
||||||
gtk-custom-hruler.c
|
gtk-custom-hruler.c
|
||||||
gtk-custom-ruler.c
|
gtk-custom-ruler.c
|
||||||
|
imageframe.cc
|
||||||
imageframe_socket_handler.cc
|
imageframe_socket_handler.cc
|
||||||
imageframe_time_axis.cc
|
imageframe_time_axis.cc
|
||||||
imageframe_time_axis_group.cc
|
imageframe_time_axis_group.cc
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
using namespace sigc;
|
using namespace sigc;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace Editing;
|
using namespace Editing;
|
||||||
|
using namespace Gnome;
|
||||||
|
using namespace Canvas;
|
||||||
|
|
||||||
sigc::signal<void,CrossfadeView*> CrossfadeView::GoingAway;
|
sigc::signal<void,CrossfadeView*> CrossfadeView::GoingAway;
|
||||||
|
|
||||||
|
@ -57,17 +59,13 @@ CrossfadeView::CrossfadeView (Gnome::Canvas::Group *parent,
|
||||||
_valid = true;
|
_valid = true;
|
||||||
_visible = true;
|
_visible = true;
|
||||||
|
|
||||||
fade_in = gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
|
fade_in = new Line (*group);
|
||||||
gnome_canvas_line_get_type(),
|
fade_in->property_fill_color_rgba().set_value(color_map[cCrossfadeLine]);
|
||||||
"fill_color_rgba", color_map[cCrossfadeLine],
|
fade_in->property_width_pixels().set_value(1);
|
||||||
"width_pixels", (guint) 1,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
fade_out = gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
|
fade_out = new Line (*group);
|
||||||
gnome_canvas_line_get_type(),
|
fade_out->property_fill_color_rgba().set_value(color_map[cCrossfadeLine]);
|
||||||
"fill_color_rgba", color_map[cCrossfadeLine],
|
fade_out->property_width_pixels().set_value(1);
|
||||||
"width_pixels", (guint) 1,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
set_height (get_time_axis_view().height);
|
set_height (get_time_axis_view().height);
|
||||||
|
|
||||||
|
@ -108,8 +106,8 @@ CrossfadeView::reset_width_dependent_items (double pixel_width)
|
||||||
active_changed ();
|
active_changed ();
|
||||||
|
|
||||||
if (pixel_width < 5) {
|
if (pixel_width < 5) {
|
||||||
gnome_canvas_item_hide (fade_in);
|
fade_in->hide();
|
||||||
gnome_canvas_item_hide (fade_out);
|
fade_out->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +145,7 @@ CrossfadeView::crossfade_changed (Change what_changed)
|
||||||
void
|
void
|
||||||
CrossfadeView::redraw_curves ()
|
CrossfadeView::redraw_curves ()
|
||||||
{
|
{
|
||||||
GnomeCanvasPoints* points;
|
Points* points;
|
||||||
int32_t npoints;
|
int32_t npoints;
|
||||||
float* vec;
|
float* vec;
|
||||||
|
|
||||||
|
@ -176,12 +174,12 @@ CrossfadeView::redraw_curves ()
|
||||||
npoints = std::min (gdk_screen_width(), npoints);
|
npoints = std::min (gdk_screen_width(), npoints);
|
||||||
|
|
||||||
if (!_visible || !crossfade.active() || npoints < 3) {
|
if (!_visible || !crossfade.active() || npoints < 3) {
|
||||||
gnome_canvas_item_hide (fade_in);
|
fade_in->hide();
|
||||||
gnome_canvas_item_hide (fade_out);
|
fade_out->hide();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
gnome_canvas_item_show (fade_in);
|
fade_in->show();
|
||||||
gnome_canvas_item_show (fade_out);
|
fade_out->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
points = get_canvas_points ("xfade edit redraw", npoints);
|
points = get_canvas_points ("xfade edit redraw", npoints);
|
||||||
|
@ -189,21 +187,23 @@ CrossfadeView::redraw_curves ()
|
||||||
|
|
||||||
crossfade.fade_in().get_vector (0, crossfade.length(), vec, npoints);
|
crossfade.fade_in().get_vector (0, crossfade.length(), vec, npoints);
|
||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
points->coords[pci++] = i;
|
Art::Point &p = (*points)[pci++];
|
||||||
points->coords[pci++] = 2.0 + h - (h * vec[i]);
|
p.set_x(i);
|
||||||
|
p.set_y(2.0 + h - (h * vec[i]));
|
||||||
}
|
}
|
||||||
gnome_canvas_item_set (fade_in, "points", points, NULL);
|
fade_in->property_points().set_value(*points);
|
||||||
|
|
||||||
crossfade.fade_out().get_vector (0, crossfade.length(), vec, npoints);
|
crossfade.fade_out().get_vector (0, crossfade.length(), vec, npoints);
|
||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
points->coords[pci++] = i;
|
Art::Point &p = (*points)[pci++];
|
||||||
points->coords[pci++] = 2.0 + h - (h * vec[i]);
|
p.set_x(i);
|
||||||
|
p.set_y(2.0 + h - (h * vec[i]));
|
||||||
}
|
}
|
||||||
gnome_canvas_item_set (fade_out, "points", points, NULL);
|
fade_out->property_points().set_value(*points);
|
||||||
|
|
||||||
delete [] vec;
|
delete [] vec;
|
||||||
|
|
||||||
gnome_canvas_points_unref (points);
|
delete points;
|
||||||
|
|
||||||
/* XXX this is ugly, but it will have to wait till Crossfades are reimplented
|
/* XXX this is ugly, but it will have to wait till Crossfades are reimplented
|
||||||
as regions. This puts crossfade views on top of a track, above all regions.
|
as regions. This puts crossfade views on top of a track, above all regions.
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <gtkmm.h>
|
#include <gtkmm.h>
|
||||||
#include <libgnomecanvas/libgnomecanvas.h>
|
#include <libgnomecanvasmm/libgnomecanvasmm.h>
|
||||||
#include <sigc++/signal.h>
|
#include <sigc++/signal.h>
|
||||||
#include <ardour/crossfade.h>
|
#include <ardour/crossfade.h>
|
||||||
|
|
||||||
|
@ -71,10 +71,10 @@ struct CrossfadeView : public TimeAxisViewItem
|
||||||
|
|
||||||
double spu;
|
double spu;
|
||||||
|
|
||||||
GnomeCanvasItem *overlap_rect;
|
Gnome::Canvas::Item *overlap_rect;
|
||||||
GnomeCanvasItem *fade_in;
|
Gnome::Canvas::Line *fade_in;
|
||||||
GnomeCanvasItem *fade_out;
|
Gnome::Canvas::Line *fade_out;
|
||||||
GnomeCanvasItem *active_button;
|
Gnome::Canvas::Item *active_button;
|
||||||
|
|
||||||
void crossfade_changed (ARDOUR::Change);
|
void crossfade_changed (ARDOUR::Change);
|
||||||
void active_changed ();
|
void active_changed ();
|
||||||
|
|
|
@ -604,8 +604,8 @@ class Editor : public PublicEditor
|
||||||
|
|
||||||
struct Cursor {
|
struct Cursor {
|
||||||
Editor& editor;
|
Editor& editor;
|
||||||
ArdourCanvas::Points* points;
|
ArdourCanvas::Points points;
|
||||||
ArdourCanvas::Item* canvas_item;
|
ArdourCanvas::Line canvas_item;
|
||||||
jack_nframes_t current_frame;
|
jack_nframes_t current_frame;
|
||||||
double length;
|
double length;
|
||||||
|
|
||||||
|
|
|
@ -31,30 +31,32 @@ using namespace ARDOUR;
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
|
|
||||||
Editor::Cursor::Cursor (Editor& ed, const string& color, bool (Editor::*callbck)(GdkEvent*,ArdourCanvas::Item*))
|
Editor::Cursor::Cursor (Editor& ed, const string& color, bool (Editor::*callbck)(GdkEvent*,ArdourCanvas::Item*))
|
||||||
: editor (ed), length(1.0)
|
: editor (ed),
|
||||||
|
points (2),
|
||||||
|
canvas_item (*editor.cursor_group),
|
||||||
|
length(1.0)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* "randomly" initialize coords */
|
/* "randomly" initialize coords */
|
||||||
|
|
||||||
points->push_back(Gnome::Art::Point(-9383839.0, 0.0));
|
points.push_back(Gnome::Art::Point(-9383839.0, 0.0));
|
||||||
points->push_back(Gnome::Art::Point(1.0, 0.0));
|
points.push_back(Gnome::Art::Point(1.0, 0.0));
|
||||||
Gnome::Canvas::Group *group = editor.cursor_group;
|
|
||||||
|
|
||||||
// cerr << "set cursor points, nc = " << points->num_points << endl;
|
// cerr << "set cursor points, nc = " << points->num_points << endl;
|
||||||
|
|
||||||
canvas_item = new Gnome::Canvas::Line (*group, *points);
|
canvas_item.property_points().set_value(points);
|
||||||
canvas_item->set_property ("fill_color", color.c_str());
|
canvas_item.property_fill_color().set_value(color.c_str());
|
||||||
canvas_item->set_property ("width_pixels", 1);
|
canvas_item.property_width_pixels().set_value(1);
|
||||||
canvas_item->set_property ("first_arrowhead", (gboolean) TRUE);
|
canvas_item.property_first_arrowhead().set_value(TRUE);
|
||||||
canvas_item->set_property ("last_arrowhead", (gboolean) TRUE);
|
canvas_item.property_last_arrowhead().set_value(TRUE);
|
||||||
canvas_item->set_property ("arrow_shape_a", 11.0);
|
canvas_item.property_arrow_shape_a().set_value(11.0);
|
||||||
canvas_item->set_property ("arrow_shape_b", 0.0);
|
canvas_item.property_arrow_shape_b().set_value(0.0);
|
||||||
canvas_item->set_property ("arrow_shape_c", 9.0);
|
canvas_item.property_arrow_shape_c().set_value(9.0);
|
||||||
|
|
||||||
// cerr << "cursor line @ " << canvas_item << endl;
|
// cerr << "cursor line @ " << canvas_item << endl;
|
||||||
|
|
||||||
canvas_item->set_data ("cursor", this);
|
canvas_item.set_data ("cursor", this);
|
||||||
canvas_item->signal_event().connect (bind (mem_fun (ed, callbck), canvas_item));
|
canvas_item.signal_event().connect (bind (mem_fun (ed, callbck), &canvas_item));
|
||||||
|
|
||||||
current_frame = 1; /* force redraw at 0 */
|
current_frame = 1; /* force redraw at 0 */
|
||||||
}
|
}
|
||||||
|
@ -62,8 +64,6 @@ Editor::Cursor::Cursor (Editor& ed, const string& color, bool (Editor::*callbck)
|
||||||
Editor::Cursor::~Cursor ()
|
Editor::Cursor::~Cursor ()
|
||||||
|
|
||||||
{
|
{
|
||||||
gtk_object_destroy (GTK_OBJECT(canvas_item));
|
|
||||||
gnome_canvas_points_unref (points->gobj());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -72,43 +72,43 @@ Editor::Cursor::set_position (jack_nframes_t frame)
|
||||||
double new_pos = editor.frame_to_unit (frame);
|
double new_pos = editor.frame_to_unit (frame);
|
||||||
|
|
||||||
if (editor.session == 0) {
|
if (editor.session == 0) {
|
||||||
canvas_item->hide();
|
canvas_item.hide();
|
||||||
} else {
|
} else {
|
||||||
canvas_item->show();
|
canvas_item.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
current_frame = frame;
|
current_frame = frame;
|
||||||
|
|
||||||
if (new_pos == points->front().get_x()) {
|
if (new_pos == points.front().get_x()) {
|
||||||
|
|
||||||
/* change in position is not visible, so just raise it */
|
/* change in position is not visible, so just raise it */
|
||||||
|
|
||||||
canvas_item->raise_to_top();
|
canvas_item.raise_to_top();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
points->front().set_x(new_pos);
|
points.front().set_x(new_pos);
|
||||||
points->back().set_x(new_pos);
|
points.back().set_x(new_pos);
|
||||||
|
|
||||||
// cerr << "set cursor2 al points, nc = " << points->num_points << endl;
|
// cerr << "set cursor2 al points, nc = " << points->num_points << endl;
|
||||||
canvas_item->set_property ("points", points);
|
canvas_item.property_points().set_value(points);
|
||||||
canvas_item->raise_to_top();
|
canvas_item.raise_to_top();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::Cursor::set_length (double units)
|
Editor::Cursor::set_length (double units)
|
||||||
{
|
{
|
||||||
length = units;
|
length = units;
|
||||||
points->back().set_x (points->front().get_y() + length);
|
points.back().set_x (points.front().get_y() + length);
|
||||||
// cerr << "set cursor3 al points, nc = " << points->num_points << endl;
|
// cerr << "set cursor3 al points, nc = " << points->num_points << endl;
|
||||||
canvas_item->set_property("points", points);
|
canvas_item.property_points().set_value(points);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::Cursor::set_y_axis (double position)
|
Editor::Cursor::set_y_axis (double position)
|
||||||
{
|
{
|
||||||
points->front().set_y (position);
|
points.front().set_y (position);
|
||||||
points->back().set_x (position + length);
|
points.back().set_x (position + length);
|
||||||
// cerr << "set cursor4 al points, nc = " << points->num_points << endl;
|
// cerr << "set cursor4 al points, nc = " << points->num_points << endl;
|
||||||
canvas_item->set_property("points", points);
|
canvas_item.property_points().set_value(points);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,14 +85,14 @@ Editor::event_frame (GdkEvent* event, double* pcx, double* pcy)
|
||||||
case GDK_BUTTON_PRESS:
|
case GDK_BUTTON_PRESS:
|
||||||
case GDK_2BUTTON_PRESS:
|
case GDK_2BUTTON_PRESS:
|
||||||
case GDK_3BUTTON_PRESS:
|
case GDK_3BUTTON_PRESS:
|
||||||
gnome_canvas_w2c_d (GNOME_CANVAS(&track_canvas), event->button.x, event->button.y, pcx, pcy);
|
track_canvas.w2c(event->button.x, event->button.y, *pcx, *pcy);
|
||||||
break;
|
break;
|
||||||
case GDK_MOTION_NOTIFY:
|
case GDK_MOTION_NOTIFY:
|
||||||
gnome_canvas_w2c_d (GNOME_CANVAS(&track_canvas), event->motion.x, event->motion.y, pcx, pcy);
|
track_canvas.w2c(event->motion.x, event->motion.y, *pcx, *pcy);
|
||||||
break;
|
break;
|
||||||
case GDK_ENTER_NOTIFY:
|
case GDK_ENTER_NOTIFY:
|
||||||
case GDK_LEAVE_NOTIFY:
|
case GDK_LEAVE_NOTIFY:
|
||||||
gnome_canvas_w2c_d (GNOME_CANVAS(&track_canvas), event->crossing.x, event->crossing.y, pcx, pcy);
|
track_canvas.w2c(event->crossing.x, event->crossing.y, *pcx, *pcy);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
warning << string_compose (_("Editor::event_frame() used on unhandled event type %1"), event->type) << endmsg;
|
warning << string_compose (_("Editor::event_frame() used on unhandled event type %1"), event->type) << endmsg;
|
||||||
|
@ -282,7 +282,7 @@ Editor::step_mouse_mode (bool next)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
bool
|
||||||
Editor::button_press_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item_type)
|
Editor::button_press_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item_type)
|
||||||
{
|
{
|
||||||
jack_nframes_t where = event_frame (event, 0, 0);
|
jack_nframes_t where = event_frame (event, 0, 0);
|
||||||
|
@ -780,7 +780,7 @@ Editor::button_press_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemTy
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
bool
|
||||||
Editor::button_release_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item_type)
|
Editor::button_release_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item_type)
|
||||||
{
|
{
|
||||||
jack_nframes_t where = event_frame (event, 0, 0);
|
jack_nframes_t where = event_frame (event, 0, 0);
|
||||||
|
@ -1115,7 +1115,7 @@ Editor::maybe_autoscroll (GdkEvent* event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
bool
|
||||||
Editor::enter_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item_type)
|
Editor::enter_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item_type)
|
||||||
{
|
{
|
||||||
ControlPoint* cp;
|
ControlPoint* cp;
|
||||||
|
@ -1313,7 +1313,7 @@ Editor::enter_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
bool
|
||||||
Editor::leave_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item_type)
|
Editor::leave_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item_type)
|
||||||
{
|
{
|
||||||
AutomationLine* al;
|
AutomationLine* al;
|
||||||
|
@ -1436,7 +1436,7 @@ Editor::left_automation_track ()
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
bool
|
||||||
Editor::motion_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item_type)
|
Editor::motion_handler (Gnome::Canvas::Item* item, GdkEvent* event, ItemType item_type)
|
||||||
{
|
{
|
||||||
gint x, y;
|
gint x, y;
|
||||||
|
@ -1924,11 +1924,11 @@ Editor::cursor_drag_finished_callback (Gnome::Canvas::Item* item, GdkEvent* even
|
||||||
|
|
||||||
cursor_drag_motion_callback (item, event);
|
cursor_drag_motion_callback (item, event);
|
||||||
|
|
||||||
if (item == playhead_cursor->canvas_item) {
|
if (item == &playhead_cursor->canvas_item) {
|
||||||
if (session) {
|
if (session) {
|
||||||
session->request_locate (playhead_cursor->current_frame, drag_info.was_rolling);
|
session->request_locate (playhead_cursor->current_frame, drag_info.was_rolling);
|
||||||
}
|
}
|
||||||
} else if (item == edit_cursor->canvas_item) {
|
} else if (item == &edit_cursor->canvas_item) {
|
||||||
edit_cursor->set_position (edit_cursor->current_frame);
|
edit_cursor->set_position (edit_cursor->current_frame);
|
||||||
edit_cursor_clock.set (edit_cursor->current_frame);
|
edit_cursor_clock.set (edit_cursor->current_frame);
|
||||||
}
|
}
|
||||||
|
@ -2331,7 +2331,7 @@ Editor::control_point_drag_motion_callback (Gnome::Canvas::Item* item, GdkEvent*
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cp->line.parent_group()->w2i (cx, cy);
|
cp->line.parent_group().w2i (cx, cy);
|
||||||
|
|
||||||
cx = max (0.0, cx);
|
cx = max (0.0, cx);
|
||||||
cy = max (0.0, cy);
|
cy = max (0.0, cy);
|
||||||
|
@ -2405,7 +2405,7 @@ Editor::start_line_grab (AutomationLine* line, GdkEvent* event)
|
||||||
|
|
||||||
cx = event->button.x;
|
cx = event->button.x;
|
||||||
cy = event->button.y;
|
cy = event->button.y;
|
||||||
line->parent_group()->w2i (cx, cy);
|
line->parent_group().w2i (cx, cy);
|
||||||
frame_within_region = (jack_nframes_t) floor (cx * frames_per_unit);
|
frame_within_region = (jack_nframes_t) floor (cx * frames_per_unit);
|
||||||
|
|
||||||
if (!line->control_points_adjacent (frame_within_region, current_line_drag_info.before,
|
if (!line->control_points_adjacent (frame_within_region, current_line_drag_info.before,
|
||||||
|
@ -2414,7 +2414,7 @@ Editor::start_line_grab (AutomationLine* line, GdkEvent* event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
drag_info.item = line->grab_item();
|
drag_info.item = &line->grab_item();
|
||||||
drag_info.data = line;
|
drag_info.data = line;
|
||||||
drag_info.motion_callback = &Editor::line_drag_motion_callback;
|
drag_info.motion_callback = &Editor::line_drag_motion_callback;
|
||||||
drag_info.finished_callback = &Editor::line_drag_finished_callback;
|
drag_info.finished_callback = &Editor::line_drag_finished_callback;
|
||||||
|
@ -2437,7 +2437,7 @@ Editor::line_drag_motion_callback (Gnome::Canvas::Item* item, GdkEvent* event)
|
||||||
double cx = drag_info.current_pointer_x;
|
double cx = drag_info.current_pointer_x;
|
||||||
double cy = drag_info.current_pointer_y;
|
double cy = drag_info.current_pointer_y;
|
||||||
|
|
||||||
line->parent_group()->w2i (cx, cy);
|
line->parent_group().w2i (cx, cy);
|
||||||
|
|
||||||
double fraction;
|
double fraction;
|
||||||
fraction = 1.0 - (cy / line->height());
|
fraction = 1.0 - (cy / line->height());
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
#include "canvas-simplerect.h"
|
#include "simplerect.h"
|
||||||
|
#include "waveview.h"
|
||||||
#include "ghostregion.h"
|
#include "ghostregion.h"
|
||||||
#include "automation_time_axis.h"
|
#include "automation_time_axis.h"
|
||||||
#include "rgb_macros.h"
|
#include "rgb_macros.h"
|
||||||
|
|
||||||
using namespace Editing;
|
using namespace Editing;
|
||||||
|
using namespace ArdourCanvas;
|
||||||
|
|
||||||
GhostRegion::GhostRegion (AutomationTimeAxisView& atv, double initial_pos)
|
GhostRegion::GhostRegion (AutomationTimeAxisView& atv, double initial_pos)
|
||||||
: trackview (atv)
|
: trackview (atv)
|
||||||
|
@ -32,14 +34,15 @@ GhostRegion::GhostRegion (AutomationTimeAxisView& atv, double initial_pos)
|
||||||
GhostRegion::~GhostRegion ()
|
GhostRegion::~GhostRegion ()
|
||||||
{
|
{
|
||||||
GoingAway (this);
|
GoingAway (this);
|
||||||
gtk_object_destroy (GTK_OBJECT(group));
|
delete base_rect;
|
||||||
|
delete group;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
GhostRegion::set_samples_per_unit (double spu)
|
GhostRegion::set_samples_per_unit (double spu)
|
||||||
{
|
{
|
||||||
for (vector<GnomeCanvasItem*>::iterator i = waves.begin(); i != waves.end(); ++i) {
|
for (vector<WaveView*>::iterator i = waves.begin(); i != waves.end(); ++i) {
|
||||||
gnome_canvas_item_set ((*i), "samples_per_unit", spu, NULL);
|
(*i)->property_samples_per_unit().set_value(spu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +56,7 @@ void
|
||||||
GhostRegion::set_height ()
|
GhostRegion::set_height ()
|
||||||
{
|
{
|
||||||
gdouble ht;
|
gdouble ht;
|
||||||
vector<GnomeCanvasItem*>::iterator i;
|
vector<WaveView*>::iterator i;
|
||||||
uint32_t n;
|
uint32_t n;
|
||||||
|
|
||||||
base_rect->set_property ("y2", (double) trackview.height);
|
base_rect->set_property ("y2", (double) trackview.height);
|
||||||
|
@ -61,7 +64,8 @@ GhostRegion::set_height ()
|
||||||
|
|
||||||
for (n = 0, i = waves.begin(); i != waves.end(); ++i, ++n) {
|
for (n = 0, i = waves.begin(); i != waves.end(); ++i, ++n) {
|
||||||
gdouble yoff = n * ht;
|
gdouble yoff = n * ht;
|
||||||
gnome_canvas_item_set ((*i), "height", ht, "y", yoff, NULL);
|
(*i)->property_height().set_value(ht);
|
||||||
|
(*i)->property_y().set_value(yoff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <sigc++/signal.h>
|
#include <sigc++/signal.h>
|
||||||
#include <libgnomecanvasmm/libgnomecanvasmm.h>
|
#include <libgnomecanvasmm/libgnomecanvasmm.h>
|
||||||
|
#include "canvas.h"
|
||||||
#include "simplerect.h"
|
#include "simplerect.h"
|
||||||
|
|
||||||
class AutomationTimeAxisView;
|
class AutomationTimeAxisView;
|
||||||
|
@ -31,9 +32,9 @@ class AutomationTimeAxisView;
|
||||||
struct GhostRegion : public sigc::trackable
|
struct GhostRegion : public sigc::trackable
|
||||||
{
|
{
|
||||||
AutomationTimeAxisView& trackview;
|
AutomationTimeAxisView& trackview;
|
||||||
Gnome::Canvas::Group* group;
|
ArdourCanvas::Group* group;
|
||||||
Gnome::Canvas::SimpleRect* base_rect;
|
ArdourCanvas::SimpleRect* base_rect;
|
||||||
std::vector<GnomeCanvasItem*> waves;
|
std::vector<ArdourCanvas::WaveView*> waves;
|
||||||
|
|
||||||
GhostRegion (AutomationTimeAxisView& tv, double initial_unit_pos);
|
GhostRegion (AutomationTimeAxisView& tv, double initial_unit_pos);
|
||||||
~GhostRegion ();
|
~GhostRegion ();
|
||||||
|
|
185
gtk2_ardour/imageframe.cc
Normal file
185
gtk2_ardour/imageframe.cc
Normal file
|
@ -0,0 +1,185 @@
|
||||||
|
// Generated by gtkmmproc -- DO NOT MODIFY!
|
||||||
|
|
||||||
|
#include "imageframe.h"
|
||||||
|
#include "imageframe_p.h"
|
||||||
|
#include <libgnomecanvasmm/private/shape_p.h>
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* rect.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 1998 EMC Capital Management Inc.
|
||||||
|
* Developed by Havoc Pennington <hp@pobox.com>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the Free
|
||||||
|
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Gnome
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace Canvas
|
||||||
|
{
|
||||||
|
|
||||||
|
ImageFrame::ImageFrame(Group& parentx, ArtPixBuf* pbuf, double x, double y, Gtk::AnchorType anchor, double w, double h)
|
||||||
|
: Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
|
||||||
|
{
|
||||||
|
item_construct(parentx);
|
||||||
|
set("x1",x1,"y1",y1,"x2",x2,"y2",y2,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageFrame::ImageFrame(Group& parentx)
|
||||||
|
: Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
|
||||||
|
{
|
||||||
|
item_construct(parentx);
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace Canvas */
|
||||||
|
} /* namespace Gnome */
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
} // anonymous namespace
|
||||||
|
|
||||||
|
|
||||||
|
namespace Glib
|
||||||
|
{
|
||||||
|
|
||||||
|
Gnome::Canvas::ImageFrame* wrap(GnomeCanvasImageFrame* object, bool take_copy)
|
||||||
|
{
|
||||||
|
return dynamic_cast<Gnome::Canvas::ImageFrame *> (Glib::wrap_auto ((GObject*)(object), take_copy));
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace Glib */
|
||||||
|
|
||||||
|
namespace Gnome
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace Canvas
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/* The *_Class implementation: */
|
||||||
|
|
||||||
|
const Glib::Class& ImageFrame_Class::init()
|
||||||
|
{
|
||||||
|
if(!gtype_) // create the GType if necessary
|
||||||
|
{
|
||||||
|
// Glib::Class has to know the class init function to clone custom types.
|
||||||
|
class_init_func_ = &ImageFrame_Class::class_init_function;
|
||||||
|
|
||||||
|
// This is actually just optimized away, apparently with no harm.
|
||||||
|
// Make sure that the parent type has been created.
|
||||||
|
//CppClassParent::CppObjectType::get_type();
|
||||||
|
|
||||||
|
// Create the wrapper type, with the same class/instance size as the base type.
|
||||||
|
register_derived_type(gnome_canvas_imageframe_get_type());
|
||||||
|
|
||||||
|
// Add derived versions of interfaces, if the C type implements any interfaces:
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImageFrame_Class::class_init_function(void* g_class, void* class_data)
|
||||||
|
{
|
||||||
|
BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
|
||||||
|
CppClassParent::class_init_function(klass, class_data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Glib::ObjectBase* ImageFrame_Class::wrap_new(GObject* o)
|
||||||
|
{
|
||||||
|
return manage(new ImageFrame((GnomeCanvasImageFrame*)(o)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The implementation: */
|
||||||
|
|
||||||
|
ImageFrame::ImageFrame(const Glib::ConstructParams& construct_params)
|
||||||
|
: Item(construct_params)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageFrame::ImageFrame(GnomeCanvasImageFrame* castitem)
|
||||||
|
: Item ((GnomeCanvasItem*)(castitem))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageFrame::~ImageFrame()
|
||||||
|
{
|
||||||
|
destroy_();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageFrame::CppClassType ImageFrame::rect_class_; // initialize static member
|
||||||
|
|
||||||
|
GType ImageFrame::get_type()
|
||||||
|
{
|
||||||
|
return rect_class_.init().get_type();
|
||||||
|
}
|
||||||
|
|
||||||
|
GType ImageFrame::get_base_type()
|
||||||
|
{
|
||||||
|
return gnome_canvas_imageframe_get_type();
|
||||||
|
}
|
||||||
|
|
||||||
|
Glib::PropertyProxy<double> ImageFrame::property_x()
|
||||||
|
{
|
||||||
|
return Glib::PropertyProxy<double> (this, "x");
|
||||||
|
}
|
||||||
|
Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_x() const
|
||||||
|
{
|
||||||
|
return Glib::PropertyProxy_ReadOnly<double> (this, "x");
|
||||||
|
}
|
||||||
|
Glib::PropertyProxy<double> ImageFrame::property_y()
|
||||||
|
{
|
||||||
|
return Glib::PropertyProxy<double> (this, "y");
|
||||||
|
}
|
||||||
|
Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_y() const
|
||||||
|
{
|
||||||
|
return Glib::PropertyProxy_ReadOnly<double> (this, "y");
|
||||||
|
}
|
||||||
|
Glib::PropertyProxy<double> ImageFrame::property_width()
|
||||||
|
{
|
||||||
|
return Glib::PropertyProxy<double> (this, "width");
|
||||||
|
}
|
||||||
|
Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_width() const
|
||||||
|
{
|
||||||
|
return Glib::PropertyProxy_ReadOnly<double> (this, "width");
|
||||||
|
}
|
||||||
|
Glib::PropertyProxy<double> ImageFrame::property_drawwidth()
|
||||||
|
{
|
||||||
|
return Glib::PropertyProxy<double> (this, "drawwidth");
|
||||||
|
}
|
||||||
|
Glib::PropertyProxy_ReadOnly<double> ImageFrame::property_drawwidth() const
|
||||||
|
{
|
||||||
|
return Glib::PropertyProxy_ReadOnly<double> (this, "drawwidth");
|
||||||
|
}
|
||||||
|
|
||||||
|
Glib::PropertyProxy<Gtk::AnchorType> ImageFrame::property_anchor()
|
||||||
|
{
|
||||||
|
return Glib::PropertyProxy<Gtk::AnchorType>(this, "anchor");
|
||||||
|
}
|
||||||
|
|
||||||
|
Glib::PropertyProxy_ReadOnly<Gtk::AnchorType> ImageFrame::property_anchor() const
|
||||||
|
{
|
||||||
|
return Glib::PropertyProxy_ReadOnly<Gtk::AnchorType>(this, "anchor");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Canvas
|
||||||
|
|
||||||
|
} // namespace Gnome
|
144
gtk2_ardour/imageframe.h
Normal file
144
gtk2_ardour/imageframe.h
Normal file
|
@ -0,0 +1,144 @@
|
||||||
|
// -*- c++ -*-
|
||||||
|
#ifndef _LIBGNOMECANVASMM_IMAGEFRAME_H
|
||||||
|
#define _LIBGNOMECANVASMM_IMAGEFRAME_H
|
||||||
|
|
||||||
|
#include <glibmm.h>
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* rect.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 1998 EMC Capital Management Inc.
|
||||||
|
* Developed by Havoc Pennington <hp@pobox.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 1999 The Gtk-- Development Team
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the Free
|
||||||
|
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <libgnomecanvasmm/item.h>
|
||||||
|
#include <libgnomecanvasmm/group.h>
|
||||||
|
#include <libgnomecanvasmm/shape.h>
|
||||||
|
#include "canvas-imageframe.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||||
|
typedef struct _GnomeCanvasImageFrame GnomeCanvasImageFrame;
|
||||||
|
typedef struct _GnomeCanvasImageFrameClass GnomeCanvasImageFrameClass;
|
||||||
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
||||||
|
|
||||||
|
|
||||||
|
namespace Gnome
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace Canvas
|
||||||
|
{ class ImageFrame_Class; } // namespace Canvas
|
||||||
|
|
||||||
|
} // namespace Gnome
|
||||||
|
namespace Gnome
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace Canvas
|
||||||
|
{
|
||||||
|
|
||||||
|
//class Group;
|
||||||
|
|
||||||
|
|
||||||
|
class ImageFrame : public Item
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||||
|
typedef ImageFrame CppObjectType;
|
||||||
|
typedef ImageFrame_Class CppClassType;
|
||||||
|
typedef GnomeCanvasImageFrame BaseObjectType;
|
||||||
|
typedef GnomeCanvasImageFrameClass BaseClassType;
|
||||||
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
||||||
|
|
||||||
|
virtual ~ImageFrame();
|
||||||
|
|
||||||
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class ImageFrame_Class;
|
||||||
|
static CppClassType rect_class_;
|
||||||
|
|
||||||
|
// noncopyable
|
||||||
|
ImageFrame(const ImageFrame&);
|
||||||
|
ImageFrame& operator=(const ImageFrame&);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
explicit ImageFrame(const Glib::ConstructParams& construct_params);
|
||||||
|
explicit ImageFrame(GnomeCanvasImageFrame* castitem);
|
||||||
|
|
||||||
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
||||||
|
|
||||||
|
public:
|
||||||
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||||
|
static GType get_type() G_GNUC_CONST;
|
||||||
|
static GType get_base_type() G_GNUC_CONST;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
///Provides access to the underlying C GtkObject.
|
||||||
|
GnomeCanvasImageFrame* gobj() { return reinterpret_cast<GnomeCanvasImageFrame*>(gobject_); }
|
||||||
|
|
||||||
|
///Provides access to the underlying C GtkObject.
|
||||||
|
const GnomeCanvasImageFrame* gobj() const { return reinterpret_cast<GnomeCanvasImageFrame*>(gobject_); }
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
//C++ methods used to invoke GTK+ virtual functions:
|
||||||
|
|
||||||
|
protected:
|
||||||
|
//GTK+ Virtual Functions (override these to change behaviour):
|
||||||
|
|
||||||
|
//Default Signal Handlers::
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
ImageFrame(Group& parentx, ArtPixBuf* pbuf, double x, double y, Gtk::AnchorType anchor, double w, double h);
|
||||||
|
explicit ImageFrame(Group& parent);
|
||||||
|
|
||||||
|
Glib::PropertyProxy<double> property_x();
|
||||||
|
Glib::PropertyProxy_ReadOnly<double> property_x() const;
|
||||||
|
Glib::PropertyProxy<double> property_y();
|
||||||
|
Glib::PropertyProxy_ReadOnly<double> property_y() const;
|
||||||
|
Glib::PropertyProxy<double> property_width();
|
||||||
|
Glib::PropertyProxy_ReadOnly<double> property_width() const;
|
||||||
|
Glib::PropertyProxy<double> property_drawwidth();
|
||||||
|
Glib::PropertyProxy_ReadOnly<double> property_drawwidth() const;
|
||||||
|
Glib::PropertyProxy<double> property_height();
|
||||||
|
Glib::PropertyProxy_ReadOnly<double> property_height() const;
|
||||||
|
Glib::PropertyProxy<Gtk::AnchorType> property_anchor() ;
|
||||||
|
Glib::PropertyProxy_ReadOnly<Gtk::AnchorType> property_anchor() const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace Canvas */
|
||||||
|
} /* namespace Gnome */
|
||||||
|
|
||||||
|
namespace Glib
|
||||||
|
{
|
||||||
|
/** @relates Gnome::Canvas::ImageFrame
|
||||||
|
* @param object The C instance
|
||||||
|
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
|
||||||
|
* @result A C++ instance that wraps this C instance.
|
||||||
|
*/
|
||||||
|
Gnome::Canvas::ImageFrame* wrap(GnomeCanvasImageFrame* object, bool take_copy = false);
|
||||||
|
}
|
||||||
|
#endif /* _LIBGNOMECANVASMM_IMAGEFRAME_H */
|
||||||
|
|
|
@ -48,24 +48,17 @@ using namespace Editing;
|
||||||
* @param ifta the parent ImageFrameTimeAxis of this view helper
|
* @param ifta the parent ImageFrameTimeAxis of this view helper
|
||||||
*/
|
*/
|
||||||
ImageFrameTimeAxisView::ImageFrameTimeAxisView (ImageFrameTimeAxis& tv)
|
ImageFrameTimeAxisView::ImageFrameTimeAxisView (ImageFrameTimeAxis& tv)
|
||||||
: _trackview (tv)
|
: _trackview (tv),
|
||||||
|
canvas_group (*_trackview.canvas_display),
|
||||||
|
canvas_rect (canvas_group, 0.0, 0.0, 1000000.0, tv.height)
|
||||||
{
|
{
|
||||||
region_color = _trackview.color() ;
|
region_color = _trackview.color() ;
|
||||||
stream_base_color = color_map[cImageTrackBase] ;
|
stream_base_color = color_map[cImageTrackBase] ;
|
||||||
|
|
||||||
canvas_group = gnome_canvas_item_new (GNOME_CANVAS_GROUP(_trackview.canvas_display), gnome_canvas_group_get_type (), 0) ;
|
canvas_rect.property_outline_color_rgba().set_value(color_map[cImageTrackOutline]);
|
||||||
|
canvas_rect.property_fill_color_rgba().set_value(stream_base_color);
|
||||||
|
|
||||||
canvas_rect = gnome_canvas_item_new (GNOME_CANVAS_GROUP(canvas_group),
|
canvas_rect.signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_imageframe_view_event), canvas_rect, &_trackview));
|
||||||
gnome_canvas_simplerect_get_type(),
|
|
||||||
"x1", 0.0,
|
|
||||||
"y1", 0.0,
|
|
||||||
"x2", 1000000.0,
|
|
||||||
"y2", (double) tv.height,
|
|
||||||
"outline_color_rgba", color_map[cImageTrackOutline],
|
|
||||||
"fill_color_rgba", stream_base_color,
|
|
||||||
0) ;
|
|
||||||
|
|
||||||
canvas_rect->signal_event().connect (bind (mem_fun (editor, &PublicEditor::canvas_imageframe_view_event), canvas_rect, &_trackview));
|
|
||||||
|
|
||||||
_samples_per_unit = _trackview.editor.get_current_zoom() ;
|
_samples_per_unit = _trackview.editor.get_current_zoom() ;
|
||||||
|
|
||||||
|
@ -99,18 +92,6 @@ ImageFrameTimeAxisView::~ImageFrameTimeAxisView()
|
||||||
iter = next ;
|
iter = next ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destroy all our canvas components
|
|
||||||
if(canvas_rect)
|
|
||||||
{
|
|
||||||
gtk_object_destroy(GTK_OBJECT(canvas_rect)) ;
|
|
||||||
canvas_rect = 0 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(canvas_group)
|
|
||||||
{
|
|
||||||
gtk_object_destroy(GTK_OBJECT(canvas_group));
|
|
||||||
canvas_group = 0 ;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -126,15 +107,12 @@ int
|
||||||
ImageFrameTimeAxisView::set_height (gdouble h)
|
ImageFrameTimeAxisView::set_height (gdouble h)
|
||||||
{
|
{
|
||||||
/* limit the values to something sane-ish */
|
/* limit the values to something sane-ish */
|
||||||
if (h < 10.0 || h > 1000.0)
|
if (h < 10.0 || h > 1000.0) {
|
||||||
{
|
|
||||||
return(-1) ;
|
return(-1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(canvas_rect != 0)
|
canvas_rect.property_y2().set_value(h) ;
|
||||||
{
|
|
||||||
gtk_object_set(GTK_OBJECT(canvas_rect), "y2", h, NULL) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(ImageFrameGroupList::const_iterator citer = imageframe_groups.begin(); citer != imageframe_groups.end(); ++citer)
|
for(ImageFrameGroupList::const_iterator citer = imageframe_groups.begin(); citer != imageframe_groups.end(); ++citer)
|
||||||
{
|
{
|
||||||
|
@ -154,7 +132,9 @@ int
|
||||||
ImageFrameTimeAxisView::set_position (gdouble x, gdouble y)
|
ImageFrameTimeAxisView::set_position (gdouble x, gdouble y)
|
||||||
|
|
||||||
{
|
{
|
||||||
gnome_canvas_item_set (canvas_group, "x", x, "y", y, NULL);
|
canvas_group.property_x().set_value(x);
|
||||||
|
canvas_group.property_y().set_value(y);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,12 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include <gtkmm.h>
|
|
||||||
#include <libgnomecanvas/libgnomecanvas.h>
|
|
||||||
#include <jack/jack.h>
|
#include <jack/jack.h>
|
||||||
|
#include <gtkmm.h>
|
||||||
|
#include <libgnomecanvasmm/libgnomecanvasmm.h>
|
||||||
|
#include "canvas.h"
|
||||||
|
#include "simplerect.h"
|
||||||
|
|
||||||
|
|
||||||
class PublicEditor ;
|
class PublicEditor ;
|
||||||
class ImageFrameTimeAxis ;
|
class ImageFrameTimeAxis ;
|
||||||
|
@ -71,7 +74,7 @@ class ImageFrameTimeAxisView : public sigc::trackable
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
GnomeCanvasItem* canvas_item() { return canvas_group; }
|
ArdourCanvas::Group * canvas_item() { return &canvas_group; }
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------//
|
//---------------------------------------------------------------------------------------//
|
||||||
|
@ -256,8 +259,8 @@ class ImageFrameTimeAxisView : public sigc::trackable
|
||||||
/* the TimeAxisView that this object is acting as the view helper for */
|
/* the TimeAxisView that this object is acting as the view helper for */
|
||||||
ImageFrameTimeAxis& _trackview ;
|
ImageFrameTimeAxis& _trackview ;
|
||||||
|
|
||||||
GnomeCanvasItem *canvas_group ;
|
ArdourCanvas::Group canvas_group ;
|
||||||
GnomeCanvasItem *canvas_rect; /* frame around the whole thing */
|
ArdourCanvas::SimpleRect canvas_rect; /* frame around the whole thing */
|
||||||
|
|
||||||
/** the current samples per unit */
|
/** the current samples per unit */
|
||||||
double _samples_per_unit ;
|
double _samples_per_unit ;
|
||||||
|
|
|
@ -267,8 +267,9 @@ Marker::Marker (PublicEditor& ed, Gnome::Canvas::Group& parent, guint32 rgba, co
|
||||||
Marker::~Marker ()
|
Marker::~Marker ()
|
||||||
{
|
{
|
||||||
/* destroying the group destroys its contents */
|
/* destroying the group destroys its contents */
|
||||||
gtk_object_destroy (GTK_OBJECT(group));
|
delete text;
|
||||||
gnome_canvas_points_unref (points->gobj());
|
delete mark;
|
||||||
|
delete points;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -10,23 +10,6 @@ using namespace std;
|
||||||
using namespace sigc;
|
using namespace sigc;
|
||||||
using namespace Glib;
|
using namespace Glib;
|
||||||
|
|
||||||
struct ActionBinding {
|
|
||||||
Glib::ustring name;
|
|
||||||
Glib::ustring label;
|
|
||||||
Gtk::Action::SlotActivate binding;
|
|
||||||
guint key;
|
|
||||||
Gdk::ModifierType mods;
|
|
||||||
|
|
||||||
ActionBinding (Glib::ustring n, Glib::ustring l, Gtk::Action::SlotActivate b,
|
|
||||||
guint k = GDK_VoidSymbol, Gdk::ModifierType m = Gdk::ModifierType (0))
|
|
||||||
: name (n),
|
|
||||||
label (l),
|
|
||||||
binding (b),
|
|
||||||
key (k),
|
|
||||||
mods (m) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
printit (string txt)
|
printit (string txt)
|
||||||
{
|
{
|
||||||
|
@ -34,37 +17,7 @@ printit (string txt)
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::RefPtr<Action>
|
Glib::RefPtr<Action>
|
||||||
make_action (vector<Glib::RefPtr<ActionGroup> >& groups, string name, string label, slot<void> sl, guint key, Gdk::ModifierType mods)
|
make_action (Glib::RefPtr<ActionGroup> group, string name, string label, RefPtr<AccelGroup> accels, slot<void> sl, guint key, Gdk::ModifierType mods)
|
||||||
{
|
|
||||||
Glib::RefPtr<Action> last;
|
|
||||||
|
|
||||||
for (vector<RefPtr<ActionGroup> >::iterator g = groups.begin(); g != groups.end(); ++g) {
|
|
||||||
Glib::RefPtr<Action> act = Action::create (name, label);
|
|
||||||
(*g)->add (act, sl);
|
|
||||||
AccelMap::add_entry (act->get_accel_path(), key, mods);
|
|
||||||
last = act;
|
|
||||||
}
|
|
||||||
|
|
||||||
return last;
|
|
||||||
}
|
|
||||||
|
|
||||||
Glib::RefPtr<Action>
|
|
||||||
make_action (Glib::RefPtr<ActionGroup> group, Glib::RefPtr<AccelGroup> accel_group, string name, string label, slot<void> sl, guint key, Gdk::ModifierType mods)
|
|
||||||
{
|
|
||||||
Glib::RefPtr<Action> act;
|
|
||||||
|
|
||||||
act = Action::create (name, label);
|
|
||||||
group->add (act, sl);
|
|
||||||
AccelMap::add_entry (act->get_accel_path(), key, mods);
|
|
||||||
act->set_accel_group (accel_group);
|
|
||||||
|
|
||||||
cerr << "action " << name << " has path " << act->get_accel_path() << endl;
|
|
||||||
|
|
||||||
return act;
|
|
||||||
}
|
|
||||||
|
|
||||||
Glib::RefPtr<Action>
|
|
||||||
make_action (Glib::RefPtr<ActionGroup> group, string name, string label, slot<void> sl, guint key, Gdk::ModifierType mods)
|
|
||||||
{
|
{
|
||||||
Glib::RefPtr<Action> act;
|
Glib::RefPtr<Action> act;
|
||||||
|
|
||||||
|
@ -72,24 +25,13 @@ make_action (Glib::RefPtr<ActionGroup> group, string name, string label, slot<vo
|
||||||
group->add (act, sl);
|
group->add (act, sl);
|
||||||
AccelMap::add_entry (act->get_accel_path(), key, mods);
|
AccelMap::add_entry (act->get_accel_path(), key, mods);
|
||||||
|
|
||||||
|
act->set_accel_group (accels);
|
||||||
|
|
||||||
cerr << "action " << name << " has path " << act->get_accel_path() << endl;
|
cerr << "action " << name << " has path " << act->get_accel_path() << endl;
|
||||||
|
|
||||||
return act;
|
return act;
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::RefPtr<Action>
|
|
||||||
make_action (Glib::RefPtr<ActionGroup> group, string name, string label, slot<void> sl)
|
|
||||||
{
|
|
||||||
Glib::RefPtr<Action> act;
|
|
||||||
|
|
||||||
act = Action::create (name, label);
|
|
||||||
group->add (act, sl);
|
|
||||||
|
|
||||||
cerr << "action " << name << " has path " << act->get_accel_path() << endl;
|
|
||||||
|
|
||||||
return act;
|
|
||||||
}
|
|
||||||
|
|
||||||
Glib::RefPtr<Action>
|
Glib::RefPtr<Action>
|
||||||
make_action (Glib::RefPtr<ActionGroup> group, string name, string label)
|
make_action (Glib::RefPtr<ActionGroup> group, string name, string label)
|
||||||
{
|
{
|
||||||
|
@ -119,34 +61,25 @@ lookup_entry (const ustring accel_path, Gtk::AccelKey& key)
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<ActionGroup>
|
RefPtr<ActionGroup>
|
||||||
make_shared_action_group (ustring name, vector<ActionBinding*>& actions)
|
copy_actions (const RefPtr<ActionGroup> src)
|
||||||
{
|
{
|
||||||
RefPtr<ActionGroup> grp = ActionGroup::create (name);
|
RefPtr<ActionGroup> grp = ActionGroup::create (src->get_name());
|
||||||
|
|
||||||
for (vector<ActionBinding*>::iterator i = actions.begin(); i != actions.end(); ++i) {
|
ListHandle<RefPtr<Action> > group_actions = src->get_actions();
|
||||||
RefPtr<Action> act = Action::create ((*i)->name, (*i)->label);
|
|
||||||
|
for (ListHandle<RefPtr<Action> >::iterator a = group_actions.begin(); a != group_actions.end(); ++a) {
|
||||||
|
RefPtr<Action> act = Action::create ((*a)->get_name(), (*a)->property_label());
|
||||||
grp->add (act);
|
grp->add (act);
|
||||||
|
|
||||||
if ((*i)->key != GDK_VoidSymbol) {
|
|
||||||
Gtk::AccelKey key;
|
|
||||||
|
|
||||||
/* since this is a shared action, only add it once */
|
|
||||||
|
|
||||||
if (!lookup_entry (act->get_accel_path(), key)) {
|
|
||||||
AccelMap::add_entry (act->get_accel_path(), (*i)->key, (*i)->mods);
|
|
||||||
cerr << "added accel map entry for " << act->get_accel_path() << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return grp;
|
return grp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char* argv[])
|
main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
Main app (argc, argv);
|
Main app (argc, argv);
|
||||||
|
Window hidden (WINDOW_TOPLEVEL);
|
||||||
Window window (WINDOW_TOPLEVEL);
|
Window window (WINDOW_TOPLEVEL);
|
||||||
Window other_window (WINDOW_TOPLEVEL);
|
Window other_window (WINDOW_TOPLEVEL);
|
||||||
Button button ("click me for baz");
|
Button button ("click me for baz");
|
||||||
|
@ -169,42 +102,38 @@ main (int argc, char* argv[])
|
||||||
|
|
||||||
uimanager = UIManager::create();
|
uimanager = UIManager::create();
|
||||||
other_uimanager = UIManager::create();
|
other_uimanager = UIManager::create();
|
||||||
|
shared_uimanager = UIManager::create();
|
||||||
|
|
||||||
actions = ActionGroup::create("MyActions");
|
actions = ActionGroup::create("MyActions");
|
||||||
other_actions = ActionGroup::create("OtherActions");
|
other_actions = ActionGroup::create("OtherActions");
|
||||||
|
shared_actions = ActionGroup::create("SharedActions");
|
||||||
|
|
||||||
uimanager->add_ui_from_file ("mtest.menus");
|
uimanager->add_ui_from_file ("mtest.menus");
|
||||||
other_uimanager->add_ui_from_file ("mtest_other.menus");
|
other_uimanager->add_ui_from_file ("mtest_other.menus");
|
||||||
|
|
||||||
// AccelMap::load ("mtest.bindings");
|
// AccelMap::load ("mtest.bindings");
|
||||||
|
|
||||||
vector<RefPtr<ActionGroup> > all_groups;
|
RefPtr<AccelGroup> accels = hidden.get_accel_group();
|
||||||
all_groups.push_back (actions);
|
|
||||||
all_groups.push_back (other_actions);
|
|
||||||
|
|
||||||
make_action (actions, "TopMenu", "top");
|
make_action (actions, "TopMenu", "top");
|
||||||
make_action (actions, "Foo", "foo", bind (sigc::ptr_fun (printit), "foo"), GDK_p, Gdk::ModifierType (0));
|
make_action (actions, "Foo", "foo", accels, bind (sigc::ptr_fun (printit), "foo"), GDK_p, Gdk::ModifierType (0));
|
||||||
|
|
||||||
make_action (other_actions, "OTopMenu", "otop");
|
make_action (other_actions, "OTopMenu", "otop");
|
||||||
make_action (other_actions, "OFoo", "foo", bind (sigc::ptr_fun (printit), "o-foo"), GDK_p, Gdk::ModifierType (0));
|
make_action (other_actions, "OFoo", "foo", accels, bind (sigc::ptr_fun (printit), "o-foo"), GDK_p, Gdk::ModifierType (0));
|
||||||
|
|
||||||
vector<ActionBinding*> shared_actions;
|
make_action (shared_actions, "Bar", "bar", accels, bind (sigc::ptr_fun (printit), "barshared"), GDK_p, Gdk::CONTROL_MASK);
|
||||||
|
RefPtr<Action> act = make_action (shared_actions, "Baz", "baz", accels, bind (sigc::ptr_fun (printit), "baz-shared"), GDK_p, Gdk::SHIFT_MASK);
|
||||||
shared_actions.push_back (new ActionBinding ("Bar", "bar", bind (sigc::ptr_fun (printit), "barshared"), GDK_p, Gdk::CONTROL_MASK));
|
|
||||||
shared_actions.push_back (new ActionBinding ("Baz", "baz", bind (sigc::ptr_fun (printit), "baz-shared"), GDK_p, Gdk::SHIFT_MASK));
|
|
||||||
|
|
||||||
RefPtr<Action> act = Action::create (shared_actions.back()->name, shared_actions.back()->label);
|
|
||||||
|
|
||||||
act->connect_proxy (button);
|
act->connect_proxy (button);
|
||||||
act->connect_proxy (other_button);
|
act->connect_proxy (other_button);
|
||||||
|
|
||||||
uimanager->insert_action_group (actions);
|
uimanager->insert_action_group (copy_actions (actions));
|
||||||
uimanager->insert_action_group (make_shared_action_group ("shared", shared_actions));
|
uimanager->insert_action_group (copy_actions (shared_actions));
|
||||||
other_uimanager->insert_action_group (other_actions);
|
other_uimanager->insert_action_group (copy_actions (other_actions));
|
||||||
other_uimanager->insert_action_group (make_shared_action_group ("othershared", shared_actions));
|
other_uimanager->insert_action_group (copy_actions (shared_actions));
|
||||||
|
|
||||||
other_window.add_accel_group (other_uimanager->get_accel_group());
|
other_window.add_accel_group (accels);
|
||||||
window.add_accel_group (uimanager->get_accel_group());
|
window.add_accel_group (accels);
|
||||||
|
|
||||||
Gtk::MenuBar* m;
|
Gtk::MenuBar* m;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include <gtkmm/table.h>
|
#include <gtkmm/table.h>
|
||||||
#include <gtkmm/button.h>
|
#include <gtkmm/button.h>
|
||||||
#include <gtkmm/notebook.h>
|
#include <gtkmm/notebook.h>
|
||||||
#include <gtkmm/ctree.h>
|
|
||||||
|
|
||||||
#include <ardour/plugin_manager.h>
|
#include <ardour/plugin_manager.h>
|
||||||
#include <ardour/plugin.h>
|
#include <ardour/plugin.h>
|
||||||
|
@ -37,35 +36,8 @@
|
||||||
|
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
||||||
static const gchar *i_titles[] = {
|
|
||||||
N_("Available LADSPA plugins"),
|
|
||||||
N_("Type"),
|
|
||||||
N_("# Inputs"),
|
|
||||||
N_("# Outputs"),
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef VST_SUPPORT
|
|
||||||
static const gchar *vst_titles[] = {
|
|
||||||
N_("Available VST plugins"),
|
|
||||||
N_("# Inputs"),
|
|
||||||
N_("# Outputs"),
|
|
||||||
0
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const gchar *o_titles[] = {
|
|
||||||
N_("To be added"),
|
|
||||||
0
|
|
||||||
};
|
|
||||||
|
|
||||||
PluginSelector::PluginSelector (PluginManager *mgr)
|
PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
: ArdourDialog ("plugin selector"),
|
: ArdourDialog ("plugin selector")
|
||||||
ladspa_display (_input_refiller, this, internationalize (i_titles), false, true),
|
|
||||||
#ifdef VST_SUPPORT
|
|
||||||
vst_display (_vst_refiller, this, internationalize (vst_titles), false, true),
|
|
||||||
#endif
|
|
||||||
o_selector (_output_refiller, this, internationalize (o_titles), false, true)
|
|
||||||
{
|
{
|
||||||
set_position (Gtk::WIN_POS_MOUSE);
|
set_position (Gtk::WIN_POS_MOUSE);
|
||||||
set_name ("PluginSelectorWindow");
|
set_name ("PluginSelectorWindow");
|
||||||
|
@ -78,6 +50,41 @@ PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
o_selected_plug = -1;
|
o_selected_plug = -1;
|
||||||
i_selected_plug = 0;
|
i_selected_plug = 0;
|
||||||
|
|
||||||
|
lmodel = Gtk::ListStore::create(lcols);
|
||||||
|
ladspa_display.set_model (lmodel);
|
||||||
|
ladspa_display.append_column (_("Available LADSPA plugins"), lcols.name);
|
||||||
|
ladspa_display.append_column (_("Type"), lcols.type);
|
||||||
|
ladspa_display.append_column (_("# Inputs"),lcols.ins);
|
||||||
|
ladspa_display.append_column (_("# Outputs"), lcols.outs);
|
||||||
|
ladspa_display.set_headers_visible (true);
|
||||||
|
ladspa_display.set_reorderable (false);
|
||||||
|
|
||||||
|
amodel = Gtk::ListStore::create(acols);
|
||||||
|
added_list.set_model (amodel);
|
||||||
|
added_list.append_column (_("To be added"), acols.text);
|
||||||
|
added_list.set_headers_visible (true);
|
||||||
|
added_list.set_reorderable (false);
|
||||||
|
|
||||||
|
for (int i = 0; i <=3; i++) {
|
||||||
|
Gtk::TreeView::Column* column = ladspa_display.get_column(i);
|
||||||
|
column->set_sort_column(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef VST_SUPPORT
|
||||||
|
vmodel = ListStore::create(vcols);
|
||||||
|
vst_display.set_model (vmodel);
|
||||||
|
vst_display.append_column (_("Available plugins"), vcols.name);
|
||||||
|
vst_display.append_column (_("# Inputs"), vcols.ins);
|
||||||
|
vst_display.append_column (_("# Outputs"), vcols.outs);
|
||||||
|
vst_display.set_headers_visible (true);
|
||||||
|
vst_display.set_reorderable (false);
|
||||||
|
|
||||||
|
for (int i = 0; i <=2; i++) {
|
||||||
|
column = vst_display.get_column(i);
|
||||||
|
column->set_sort_column(i);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Gtk::Button *btn_add = manage(new Gtk::Button(_("Add")));
|
Gtk::Button *btn_add = manage(new Gtk::Button(_("Add")));
|
||||||
ARDOUR_UI::instance()->tooltips().set_tip(*btn_add, _("Add a plugin to the effect list"));
|
ARDOUR_UI::instance()->tooltips().set_tip(*btn_add, _("Add a plugin to the effect list"));
|
||||||
Gtk::Button *btn_remove = manage(new Gtk::Button(_("Remove")));
|
Gtk::Button *btn_remove = manage(new Gtk::Button(_("Remove")));
|
||||||
|
@ -101,7 +108,7 @@ PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
table->attach(*btn_remove, 3, 4, 5, 6, Gtk::FILL, Gtk::FILL, 5, 5);
|
table->attach(*btn_remove, 3, 4, 5, 6, Gtk::FILL, Gtk::FILL, 5, 5);
|
||||||
table->attach(*btn_update, 5, 6, 5, 6, Gtk::FILL, Gtk::FILL, 5, 5);
|
table->attach(*btn_update, 5, 6, 5, 6, Gtk::FILL, Gtk::FILL, 5, 5);
|
||||||
|
|
||||||
table->attach(o_selector, 0, 7, 7, 9);
|
table->attach(added_list, 0, 7, 7, 9);
|
||||||
table->attach(*btn_ok, 1, 3, 9, 10, Gtk::FILL, Gtk::FILL, 5, 5);
|
table->attach(*btn_ok, 1, 3, 9, 10, Gtk::FILL, Gtk::FILL, 5, 5);
|
||||||
table->attach(*btn_cancel, 3, 4, 9, 10, Gtk::FILL, Gtk::FILL, 5, 5);
|
table->attach(*btn_cancel, 3, 4, 9, 10, Gtk::FILL, Gtk::FILL, 5, 5);
|
||||||
add (*table);
|
add (*table);
|
||||||
|
@ -116,30 +123,24 @@ PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
|
|
||||||
table->set_name("PluginSelectorTable");
|
table->set_name("PluginSelectorTable");
|
||||||
//ladspa_display.set_name("PluginSelectorDisplay");
|
//ladspa_display.set_name("PluginSelectorDisplay");
|
||||||
ladspa_display.clist().set_name("PluginSelectorList");
|
ladspa_display.set_name("PluginSelectorList");
|
||||||
o_selector.clist().set_name("PluginSelectorList");
|
added_list.set_name("PluginSelectorList");
|
||||||
|
|
||||||
ladspa_display.clist().column_titles_active();
|
//ladspa_display.clist().column(0).set_auto_resize (false);
|
||||||
ladspa_display.clist().column(0).set_auto_resize (false);
|
//ladspa_display.clist().column(0).set_width(470);
|
||||||
ladspa_display.clist().column(0).set_width(470);
|
|
||||||
|
|
||||||
ladspa_display.clist().column(1).set_auto_resize (true);
|
//ladspa_display.clist().column(1).set_auto_resize (true);
|
||||||
o_selector.clist().column(0).set_auto_resize (true);
|
//o_selector.clist().column(0).set_auto_resize (true);
|
||||||
|
|
||||||
ladspa_display.selection_made.connect (mem_fun(*this, &PluginSelector::i_plugin_selected));
|
ladspa_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
|
||||||
ladspa_display.choice_made.connect(mem_fun(*this, &PluginSelector::i_plugin_chosen));
|
|
||||||
ladspa_display.clist().click_column.connect(bind (mem_fun(*this, &PluginSelector::column_clicked), ladspa_display.clist().gobj()));
|
|
||||||
#ifdef VST_SUPPORT
|
#ifdef VST_SUPPORT
|
||||||
if (Config->get_use_vst()) {
|
if (Config->get_use_vst()) {
|
||||||
vst_display.selection_made.connect (mem_fun(*this, &PluginSelector::i_plugin_selected));
|
vst_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
|
||||||
vst_display.choice_made.connect(mem_fun(*this, &PluginSelector::i_plugin_chosen));
|
|
||||||
vst_display.clist().click_column.connect(bind (mem_fun(*this, &PluginSelector::column_clicked), vst_display.clist().gobj()));
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
o_selector.selection_made.connect(mem_fun(*this, &PluginSelector::o_plugin_selected));
|
|
||||||
o_selector.choice_made.connect(mem_fun(*this,&PluginSelector::o_plugin_chosen));
|
|
||||||
btn_update->signal_clicked().connect (mem_fun(*this, &PluginSelector::btn_update_clicked));
|
btn_update->signal_clicked().connect (mem_fun(*this, &PluginSelector::btn_update_clicked));
|
||||||
btn_add->clicked.connect(mem_fun(*this, &PluginSelector::btn_add_clicked));
|
btn_add->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_add_clicked));
|
||||||
btn_remove->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_remove_clicked));
|
btn_remove->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_remove_clicked));
|
||||||
btn_ok->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_ok_clicked));
|
btn_ok->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_ok_clicked));
|
||||||
btn_cancel->signal_clicked().connect(mem_fun(*this,&PluginSelector::btn_cancel_clicked));
|
btn_cancel->signal_clicked().connect(mem_fun(*this,&PluginSelector::btn_cancel_clicked));
|
||||||
|
@ -147,6 +148,13 @@ PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PluginSelector::row_clicked(GdkEventButton* event)
|
||||||
|
{
|
||||||
|
if (event->type == GDK_2BUTTON_PRESS)
|
||||||
|
btn_add_clicked();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginSelector::set_session (Session* s)
|
PluginSelector::set_session (Session* s)
|
||||||
{
|
{
|
||||||
|
@ -160,16 +168,18 @@ PluginSelector::set_session (Session* s)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginSelector::_input_refiller (Gtk::CList &list, void *arg)
|
PluginSelector::_input_refiller (void *arg)
|
||||||
{
|
{
|
||||||
((PluginSelector *) arg)->input_refiller (list);
|
((PluginSelector *) arg)->input_refiller ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void
|
void
|
||||||
PluginSelector::_output_refiller (Gtk::CList &list, void *arg)
|
PluginSelector::_output_refiller (void *arg)
|
||||||
{
|
{
|
||||||
((PluginSelector *) arg)->output_refiller (list);
|
((PluginSelector *) arg)->output_refiller ();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
int compare(const void *left, const void *right)
|
int compare(const void *left, const void *right)
|
||||||
{
|
{
|
||||||
|
@ -177,9 +187,9 @@ int compare(const void *left, const void *right)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginSelector::input_refiller (Gtk::CList &clist)
|
PluginSelector::input_refiller ()
|
||||||
{
|
{
|
||||||
const gchar *rowdata[4];
|
//const gchar *rowdata[4];
|
||||||
guint row;
|
guint row;
|
||||||
list<PluginInfo *> &plugs = manager->ladspa_plugin_info ();
|
list<PluginInfo *> &plugs = manager->ladspa_plugin_info ();
|
||||||
list<PluginInfo *>::iterator i;
|
list<PluginInfo *>::iterator i;
|
||||||
|
@ -187,64 +197,65 @@ PluginSelector::input_refiller (Gtk::CList &clist)
|
||||||
|
|
||||||
// Insert into GTK list
|
// Insert into GTK list
|
||||||
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
|
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
|
||||||
rowdata[0] = (*i)->name.c_str();
|
//rowdata[0] = (*i)->name.c_str();
|
||||||
rowdata[1] = (*i)->category.c_str();
|
//rowdata[1] = (*i)->category.c_str();
|
||||||
|
|
||||||
snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs);
|
snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs);
|
||||||
snprintf (obuf, sizeof(obuf)-1, "%d", (*i)->n_outputs);
|
snprintf (obuf, sizeof(obuf)-1, "%d", (*i)->n_outputs);
|
||||||
rowdata[2] = ibuf;
|
|
||||||
rowdata[3] = obuf;
|
|
||||||
|
|
||||||
clist.insert_row (row, rowdata);
|
Gtk::TreeModel::Row newrow = *(lmodel->append());
|
||||||
clist.rows().back().set_data (*i);
|
newrow[lcols.name] = (*i)->name.c_str();
|
||||||
|
newrow[lcols.type] = (*i)->category.c_str();
|
||||||
|
newrow[lcols.ins] = ibuf;
|
||||||
|
newrow[lcols.outs] = obuf;
|
||||||
|
newrow[lcols.plugin] = *i;
|
||||||
|
//clist.insert_row (row, rowdata);
|
||||||
|
//clist.rows().back().set_data (*i);
|
||||||
}
|
}
|
||||||
|
|
||||||
clist.set_sort_column (0);
|
//clist.set_sort_column (0);
|
||||||
clist.sort ();
|
//clist.sort ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VST_SUPPORT
|
#ifdef VST_SUPPORT
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginSelector::_vst_refiller (Gtk::CList &list, void *arg)
|
PluginSelector::_vst_refiller (void *arg)
|
||||||
{
|
{
|
||||||
((PluginSelector *) arg)->vst_refiller (list);
|
((PluginSelector *) arg)->vst_refiller ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginSelector::vst_refiller (Gtk::CList &clist)
|
PluginSelector::vst_refiller ()
|
||||||
{
|
{
|
||||||
const gchar *rowdata[3];
|
|
||||||
guint row;
|
guint row;
|
||||||
list<PluginInfo *> &plugs = manager->vst_plugin_info ();
|
list<PluginInfo *> &plugs = manager->vst_plugin_info ();
|
||||||
list<PluginInfo *>::iterator i;
|
list<PluginInfo *>::iterator i;
|
||||||
char ibuf[16], obuf[16];
|
char ibuf[16], obuf[16];
|
||||||
|
|
||||||
if (!Config->get_use_vst()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Insert into GTK list
|
// Insert into GTK list
|
||||||
|
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
|
||||||
for (row = 0, i = plugs.begin(); i != plugs.end(); ++i, ++row) {
|
//rowdata[0] = (*i)->name.c_str();
|
||||||
rowdata[0] = (*i)->name.c_str();
|
//rowdata[1] = (*i)->category.c_str();
|
||||||
|
|
||||||
snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs);
|
snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs);
|
||||||
snprintf (obuf, sizeof(obuf)-1, "%d", (*i)->n_outputs);
|
snprintf (obuf, sizeof(obuf)-1, "%d", (*i)->n_outputs);
|
||||||
rowdata[1] = ibuf;
|
|
||||||
rowdata[2] = obuf;
|
|
||||||
|
|
||||||
clist.insert_row (row, rowdata);
|
Gtk::TreeModel::Row newrow = *(vmodel->append());
|
||||||
clist.rows().back().set_data (*i);
|
newrow[vcols.name] = (*i)->name.c_str();
|
||||||
|
newrow[vcols.ins] = ibuf;
|
||||||
|
newrow[vcols.outs] = obuf;
|
||||||
|
newrow[vcols.plugin] = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
clist.set_sort_column (0);
|
//clist.set_sort_column (0);
|
||||||
clist.sort ();
|
//clist.sort ();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
void
|
void
|
||||||
PluginSelector::output_refiller (Gtk::CList &clist)
|
PluginSelector::output_refiller ()
|
||||||
{
|
{
|
||||||
const gchar *rowdata[2];
|
const gchar *rowdata[2];
|
||||||
guint row;
|
guint row;
|
||||||
|
@ -258,59 +269,7 @@ PluginSelector::output_refiller (Gtk::CList &clist)
|
||||||
clist.rows().back().set_data (*i);
|
clist.rows().back().set_data (*i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
void
|
|
||||||
PluginSelector::i_plugin_chosen (Gtkmm2ext::Selector *selector,
|
|
||||||
Gtkmm2ext::SelectionResult *res)
|
|
||||||
{
|
|
||||||
if (res) {
|
|
||||||
// get text for name column (0)
|
|
||||||
i_selected_plug = static_cast<PluginInfo*> (selector->clist().row(res->row).get_data());
|
|
||||||
//i_selected_plug = *res->text;
|
|
||||||
} else {
|
|
||||||
i_selected_plug = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
PluginSelector::i_plugin_selected (Gtkmm2ext::Selector *selector,
|
|
||||||
Gtkmm2ext::SelectionResult *res)
|
|
||||||
{
|
|
||||||
if (res) {
|
|
||||||
added_plugins.push_back (static_cast<PluginInfo*> (selector->clist().row(res->row).get_data()));
|
|
||||||
//added_plugins.push_back(*(res->text));
|
|
||||||
o_selector.rescan();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
PluginSelector::o_plugin_chosen (Gtkmm2ext::Selector *selector,
|
|
||||||
Gtkmm2ext::SelectionResult *res)
|
|
||||||
{
|
|
||||||
if (res && res->text) {
|
|
||||||
o_selected_plug = res->row;
|
|
||||||
} else {
|
|
||||||
o_selected_plug = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
PluginSelector::o_plugin_selected (Gtkmm2ext::Selector *selector,
|
|
||||||
Gtkmm2ext::SelectionResult *res)
|
|
||||||
{
|
|
||||||
if(res && res->text){
|
|
||||||
gint row = 0;
|
|
||||||
list<PluginInfo*>::iterator i = added_plugins.begin();
|
|
||||||
while (row < res->row){
|
|
||||||
i++;
|
|
||||||
row++;
|
|
||||||
}
|
|
||||||
added_plugins.erase(i);
|
|
||||||
o_selector.rescan();
|
|
||||||
o_selected_plug = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginSelector::use_plugin (PluginInfo* pi)
|
PluginSelector::use_plugin (PluginInfo* pi)
|
||||||
|
@ -331,10 +290,26 @@ PluginSelector::use_plugin (PluginInfo* pi)
|
||||||
void
|
void
|
||||||
PluginSelector::btn_add_clicked()
|
PluginSelector::btn_add_clicked()
|
||||||
{
|
{
|
||||||
if (i_selected_plug) {
|
bool vst = notebook.get_current_page(); // 0 = LADSPA, 1 = VST
|
||||||
added_plugins.push_back (i_selected_plug);
|
std::string name;
|
||||||
o_selector.rescan();
|
ARDOUR::PluginInfo *pi;
|
||||||
|
Gtk::TreeModel::Row newrow = *(amodel->append());
|
||||||
|
|
||||||
|
if (vst) {
|
||||||
|
#ifdef VST_SUPPORT
|
||||||
|
Gtk::TreeModel::Row row = *(vst_display.get_selection()->get_selected());
|
||||||
|
name = row[vcols.name];
|
||||||
|
pi = row[vcols.plugin];
|
||||||
|
added_plugins.push_back (row[vcols.plugin]);
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
Gtk::TreeModel::Row row = *(ladspa_display.get_selection()->get_selected());
|
||||||
|
name = row[lcols.name];
|
||||||
|
pi = row[lcols.plugin];
|
||||||
|
added_plugins.push_back (row[lcols.plugin]);
|
||||||
}
|
}
|
||||||
|
newrow[acols.text] = name;
|
||||||
|
newrow[acols.plugin] = pi;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -348,7 +323,7 @@ PluginSelector::btn_remove_clicked()
|
||||||
row++;
|
row++;
|
||||||
}
|
}
|
||||||
added_plugins.erase(i);
|
added_plugins.erase(i);
|
||||||
o_selector.rescan();
|
//o_selector.rescan();
|
||||||
o_selected_plug = -1;
|
o_selected_plug = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -357,8 +332,6 @@ PluginSelector::btn_remove_clicked()
|
||||||
void
|
void
|
||||||
PluginSelector::btn_ok_clicked()
|
PluginSelector::btn_ok_clicked()
|
||||||
{
|
{
|
||||||
using namespace Gtk::CList_Helpers;
|
|
||||||
|
|
||||||
list<PluginInfo*>::iterator i;
|
list<PluginInfo*>::iterator i;
|
||||||
|
|
||||||
for (i = added_plugins.begin(); i != added_plugins.end(); ++i){
|
for (i = added_plugins.begin(); i != added_plugins.end(); ++i){
|
||||||
|
@ -367,23 +340,6 @@ PluginSelector::btn_ok_clicked()
|
||||||
|
|
||||||
hide();
|
hide();
|
||||||
added_plugins.clear();
|
added_plugins.clear();
|
||||||
o_selector.rescan();
|
|
||||||
i_selected_plug = 0;
|
|
||||||
o_selected_plug = -1;
|
|
||||||
|
|
||||||
SelectionList s_list = ladspa_display.clist().selection();
|
|
||||||
SelectionList::iterator s = s_list.begin();
|
|
||||||
if (s != s_list.end()) {
|
|
||||||
(*s).unselect();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef VST_SUPPORT
|
|
||||||
SelectionList v_list = vst_display.clist().selection();
|
|
||||||
SelectionList::iterator v = v_list.begin();
|
|
||||||
if (v != v_list.end()) {
|
|
||||||
(*v).unselect();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -391,16 +347,13 @@ PluginSelector::btn_cancel_clicked()
|
||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
added_plugins.clear();
|
added_plugins.clear();
|
||||||
o_selector.rescan();
|
|
||||||
i_selected_plug = 0;
|
|
||||||
o_selected_plug = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginSelector::btn_update_clicked()
|
PluginSelector::btn_update_clicked()
|
||||||
{
|
{
|
||||||
manager->refresh ();
|
manager->refresh ();
|
||||||
ladspa_display.rescan ();
|
input_refiller ();
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
gint
|
||||||
|
@ -409,10 +362,3 @@ PluginSelector::wm_close(GdkEventAny* ev)
|
||||||
btn_cancel_clicked();
|
btn_cancel_clicked();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
PluginSelector::column_clicked (int column, GtkCList* clist)
|
|
||||||
{
|
|
||||||
gtk_clist_set_sort_column (clist, column);
|
|
||||||
gtk_clist_sort (clist);
|
|
||||||
}
|
|
||||||
|
|
|
@ -46,16 +46,63 @@ class PluginSelector : public ArdourDialog
|
||||||
Gtk::Notebook notebook;
|
Gtk::Notebook notebook;
|
||||||
|
|
||||||
// page 1
|
// page 1
|
||||||
Gtkmm2ext::Selector ladspa_display;
|
//Gtkmm2ext::Selector ladspa_display;
|
||||||
|
struct LadspaColumns : public Gtk::TreeModel::ColumnRecord {
|
||||||
|
LadspaColumns () {
|
||||||
|
add (name);
|
||||||
|
add (type);
|
||||||
|
add (ins);
|
||||||
|
add (outs);
|
||||||
|
add (plugin);
|
||||||
|
}
|
||||||
|
Gtk::TreeModelColumn<std::string> name;
|
||||||
|
Gtk::TreeModelColumn<std::string> type;
|
||||||
|
Gtk::TreeModelColumn<std::string> ins;
|
||||||
|
Gtk::TreeModelColumn<std::string> outs;
|
||||||
|
Gtk::TreeModelColumn<ARDOUR::PluginInfo *> plugin;
|
||||||
|
};
|
||||||
|
LadspaColumns lcols;
|
||||||
|
Glib::RefPtr<Gtk::ListStore> lmodel;
|
||||||
|
Glib::RefPtr<Gtk::TreeSelection> lselection;
|
||||||
|
Gtk::TreeView ladspa_display;
|
||||||
|
|
||||||
|
struct AddedColumns : public Gtk::TreeModel::ColumnRecord {
|
||||||
|
AddedColumns () {
|
||||||
|
add (text);
|
||||||
|
add (plugin);
|
||||||
|
}
|
||||||
|
Gtk::TreeModelColumn<std::string> text;
|
||||||
|
Gtk::TreeModelColumn<ARDOUR::PluginInfo *> plugin;
|
||||||
|
};
|
||||||
|
AddedColumns acols;
|
||||||
|
Glib::RefPtr<Gtk::ListStore> amodel;
|
||||||
|
Glib::RefPtr<Gtk::TreeSelection> aselection;
|
||||||
|
Gtk::TreeView added_list;
|
||||||
|
|
||||||
void column_clicked (int column, GtkCList* clist);
|
void column_clicked (int column, GtkCList* clist);
|
||||||
|
|
||||||
#ifdef VST_SUPPORT
|
#ifdef VST_SUPPORT
|
||||||
// page 2
|
// page 2
|
||||||
Gtkmm2ext::Selector vst_display;
|
struct VstColumns : public Gtk::TreeModel::ColumnRecord {
|
||||||
static void _vst_refiller (Gtk::CList &, void *);
|
VstColumns () {
|
||||||
void vst_refiller (Gtk::CList &);
|
add (name);
|
||||||
|
add (ins);
|
||||||
|
add (outs);
|
||||||
|
add (plugin);
|
||||||
|
}
|
||||||
|
Gtk::TreeModelColumn<std::string> name;
|
||||||
|
Gtk::TreeModelColumn<std::string> ins;
|
||||||
|
Gtk::TreeModelColumn<std::string> outs;
|
||||||
|
Gtk::TreeModelColumn<ARDOUR::PluginInfo *> plugin;
|
||||||
|
};
|
||||||
|
LadspaColumns vcols;
|
||||||
|
Glib::RefPtr<Gtk::ListStore> vmodel;
|
||||||
|
Glib::RefPtr<Gtk::TreeSelection> vselection;
|
||||||
|
Gtk::TreeView vst_display;
|
||||||
|
static void _vst_refiller (void *);
|
||||||
|
void vst_refiller ();
|
||||||
#endif
|
#endif
|
||||||
Gtkmm2ext::Selector o_selector;
|
//Gtkmm2ext::Selector o_selector;
|
||||||
|
|
||||||
ARDOUR::PluginInfo* i_selected_plug;
|
ARDOUR::PluginInfo* i_selected_plug;
|
||||||
|
|
||||||
|
@ -66,20 +113,11 @@ class PluginSelector : public ArdourDialog
|
||||||
ARDOUR::PluginManager *manager;
|
ARDOUR::PluginManager *manager;
|
||||||
list<ARDOUR::PluginInfo*> added_plugins;
|
list<ARDOUR::PluginInfo*> added_plugins;
|
||||||
|
|
||||||
//static void _input_refiller (Gtk::CList &, void *);
|
static void _input_refiller (void *);
|
||||||
//static void _output_refiller (Gtk::CList &, void *);
|
//static void _output_refiller (void *);
|
||||||
|
|
||||||
//void input_refiller (Gtk::CList &);
|
void input_refiller ();
|
||||||
//void output_refiller (Gtk::CList &);
|
void row_clicked(GdkEventButton *);
|
||||||
//void i_plugin_selected (Gtkmm2ext::Selector *selector,
|
|
||||||
// Gtkmm2ext::SelectionResult *res);
|
|
||||||
//void i_plugin_chosen (Gtkmm2ext::Selector *selector,
|
|
||||||
// Gtkmm2ext::SelectionResult *res);
|
|
||||||
//void o_plugin_selected (Gtkmm2ext::Selector *selector,
|
|
||||||
// Gtkmm2ext::SelectionResult *res);
|
|
||||||
//void o_plugin_chosen (Gtkmm2ext::Selector *selector,
|
|
||||||
// Gtkmm2ext::SelectionResult *res);
|
|
||||||
|
|
||||||
void btn_add_clicked();
|
void btn_add_clicked();
|
||||||
void btn_remove_clicked();
|
void btn_remove_clicked();
|
||||||
void btn_ok_clicked();
|
void btn_ok_clicked();
|
||||||
|
|
|
@ -33,9 +33,9 @@
|
||||||
#include "streamview.h"
|
#include "streamview.h"
|
||||||
#include "regionview.h"
|
#include "regionview.h"
|
||||||
#include "audio_time_axis.h"
|
#include "audio_time_axis.h"
|
||||||
#include "canvas-simplerect.h"
|
#include "simplerect.h"
|
||||||
#include "canvas-simpleline.h"
|
#include "simpleline.h"
|
||||||
#include "canvas-waveview.h"
|
#include "waveview.h"
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
#include "region_editor.h"
|
#include "region_editor.h"
|
||||||
#include "region_gain_line.h"
|
#include "region_gain_line.h"
|
||||||
|
@ -50,6 +50,7 @@
|
||||||
using namespace sigc;
|
using namespace sigc;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace Editing;
|
using namespace Editing;
|
||||||
|
using namespace ArdourCanvas;
|
||||||
|
|
||||||
static const int32_t sync_mark_width = 9;
|
static const int32_t sync_mark_width = 9;
|
||||||
|
|
||||||
|
@ -62,14 +63,14 @@ AudioRegionView::AudioRegionView (Gnome::Canvas::Group *parent, AudioTimeAxisVie
|
||||||
Gdk::Color& basic_color,
|
Gdk::Color& basic_color,
|
||||||
bool wfw)
|
bool wfw)
|
||||||
|
|
||||||
: TimeAxisViewItem (r.name(), parent, tv, spu, basic_color, r.position(), r.length(),
|
: TimeAxisViewItem (r.name(), *parent, tv, spu, basic_color, r.position(), r.length(),
|
||||||
TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText|
|
TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText|
|
||||||
TimeAxisViewItem::ShowNameHighlight|
|
TimeAxisViewItem::ShowNameHighlight|
|
||||||
TimeAxisViewItem::ShowFrame)),
|
TimeAxisViewItem::ShowFrame)),
|
||||||
|
|
||||||
region (r)
|
region (r)
|
||||||
{
|
{
|
||||||
Gnome::Canvas::Points *shape;
|
Gnome::Canvas::Points shape;
|
||||||
XMLNode *node;
|
XMLNode *node;
|
||||||
|
|
||||||
editor = 0;
|
editor = 0;
|
||||||
|
@ -100,20 +101,19 @@ AudioRegionView::AudioRegionView (Gnome::Canvas::Group *parent, AudioTimeAxisVie
|
||||||
gtk_object_set_data (GTK_OBJECT(name_highlight), "regionview", this);
|
gtk_object_set_data (GTK_OBJECT(name_highlight), "regionview", this);
|
||||||
gtk_object_set_data (GTK_OBJECT(name_text), "regionview", this);
|
gtk_object_set_data (GTK_OBJECT(name_text), "regionview", this);
|
||||||
|
|
||||||
shape = new Gnome::Canvas::Points ();
|
// shape = new Gnome::Canvas::Points ();
|
||||||
|
|
||||||
/* an equilateral triangle */
|
/* an equilateral triangle */
|
||||||
|
|
||||||
shape->push_back (Gnome::Art::Point (-((sync_mark_width-1)/2), 1));
|
shape.push_back (Gnome::Art::Point (-((sync_mark_width-1)/2), 1));
|
||||||
shape->push_back (Gnome::Art::Point ((sync_mark_width - 1)/2, 1));
|
shape.push_back (Gnome::Art::Point ((sync_mark_width - 1)/2, 1));
|
||||||
shape->push_back (Gnome::Art::Point (0, sync_mark_width - 1));
|
shape.push_back (Gnome::Art::Point (0, sync_mark_width - 1));
|
||||||
shape->push_back (Gnome::Art::Point (-((sync_mark_width-1)/2), 1));
|
shape.push_back (Gnome::Art::Point (-((sync_mark_width-1)/2), 1));
|
||||||
|
|
||||||
sync_mark = new Gnome::Canvas::Polygon (*group);
|
sync_mark = new Gnome::Canvas::Polygon (*group);
|
||||||
sync_mark->set_property ("points", shape);
|
sync_mark->property_points().set_value(shape);
|
||||||
sync_mark->set_property ("fill_color_rgba", fill_color);
|
sync_mark->set_property ("fill_color_rgba", fill_color);
|
||||||
sync_mark->hide();
|
sync_mark->hide();
|
||||||
gnome_canvas_points_unref (shape->gobj());
|
|
||||||
|
|
||||||
fade_in_shape = new Gnome::Canvas::Polygon (*group);
|
fade_in_shape = new Gnome::Canvas::Polygon (*group);
|
||||||
fade_in_shape->set_property ("fill_color_rgba", fade_color);
|
fade_in_shape->set_property ("fill_color_rgba", fade_color);
|
||||||
|
@ -354,7 +354,7 @@ AudioRegionView::region_scale_amplitude_changed ()
|
||||||
|
|
||||||
for (uint32_t n = 0; n < waves.size(); ++n) {
|
for (uint32_t n = 0; n < waves.size(); ++n) {
|
||||||
// force a reload of the cache
|
// force a reload of the cache
|
||||||
gnome_canvas_item_set (waves[n], "data_src", ®ion, NULL);
|
waves[n]->property_data_src().set_value(®ion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,15 +383,15 @@ AudioRegionView::region_resized (Change what_changed)
|
||||||
reset_width_dependent_items (unit_length);
|
reset_width_dependent_items (unit_length);
|
||||||
|
|
||||||
for (uint32_t n = 0; n < waves.size(); ++n) {
|
for (uint32_t n = 0; n < waves.size(); ++n) {
|
||||||
gnome_canvas_item_set (waves[n], "region_start", (guint32) region.start(), NULL);
|
waves[n]->property_region_start().set_value(region.start());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
||||||
|
|
||||||
(*i)->set_duration (unit_length);
|
(*i)->set_duration (unit_length);
|
||||||
|
|
||||||
for (vector<GnomeCanvasItem*>::iterator w = (*i)->waves.begin(); w != (*i)->waves.end(); ++w) {
|
for (vector<WaveView*>::iterator w = (*i)->waves.begin(); w != (*i)->waves.end(); ++w) {
|
||||||
gnome_canvas_item_set ((*w), "region_start", region.start(), NULL);
|
(*w)->property_region_start().set_value(region.start());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -438,9 +438,9 @@ AudioRegionView::region_muted ()
|
||||||
|
|
||||||
for (uint32_t n=0; n < waves.size(); ++n) {
|
for (uint32_t n=0; n < waves.size(); ++n) {
|
||||||
if (region.muted()) {
|
if (region.muted()) {
|
||||||
gnome_canvas_item_set (waves[n], "wave_color", color_map[cMutedWaveForm], NULL);
|
waves[n]->property_wave_color().set_value(color_map[cMutedWaveForm]);
|
||||||
} else {
|
} else {
|
||||||
gnome_canvas_item_set (waves[n], "wave_color", color_map[cWaveForm], NULL);
|
waves[n]->property_wave_color().set_value(color_map[cWaveForm]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -518,8 +518,8 @@ AudioRegionView::set_height (gdouble height)
|
||||||
|
|
||||||
gdouble yoff = n * (ht+1);
|
gdouble yoff = n * (ht+1);
|
||||||
|
|
||||||
gnome_canvas_item_set (waves[n], "height", ht, NULL);
|
waves[n]->property_height().set_value(ht);
|
||||||
gnome_canvas_item_set (waves[n], "y", yoff + 2, NULL);
|
waves[n]->property_y().set_value(yoff + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((height/wcnt) < NAME_HIGHLIGHT_SIZE) {
|
if ((height/wcnt) < NAME_HIGHLIGHT_SIZE) {
|
||||||
|
@ -574,7 +574,7 @@ AudioRegionView::reset_fade_in_shape_width (jack_nframes_t width)
|
||||||
|
|
||||||
width = std::max ((jack_nframes_t) 64, width);
|
width = std::max ((jack_nframes_t) 64, width);
|
||||||
|
|
||||||
GnomeCanvasPoints* points;
|
Points* points;
|
||||||
double pwidth = width / samples_per_unit;
|
double pwidth = width / samples_per_unit;
|
||||||
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
|
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
|
||||||
double h;
|
double h;
|
||||||
|
@ -621,25 +621,24 @@ AudioRegionView::reset_fade_in_shape_width (jack_nframes_t width)
|
||||||
double xdelta = pwidth/npoints;
|
double xdelta = pwidth/npoints;
|
||||||
|
|
||||||
for (pi = 0, pc = 0; pc < npoints; ++pc) {
|
for (pi = 0, pc = 0; pc < npoints; ++pc) {
|
||||||
points->coords[pi++] = 1 + (pc * xdelta);
|
(*points)[pi].set_x(1 + (pc * xdelta));
|
||||||
points->coords[pi++] = 2 + (h - (curve[pc] * h));
|
(*points)[pi++].set_y(2 + (h - (curve[pc] * h)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fold back */
|
/* fold back */
|
||||||
|
|
||||||
points->coords[pi++] = pwidth;
|
(*points)[pi].set_x(pwidth);
|
||||||
points->coords[pi++] = 2;
|
(*points)[pi++].set_y(2);
|
||||||
|
|
||||||
points->coords[pi++] = 1;
|
(*points)[pi].set_x(1);
|
||||||
points->coords[pi++] = 2;
|
(*points)[pi++].set_y(2);
|
||||||
|
|
||||||
/* connect the dots ... */
|
/* connect the dots ... */
|
||||||
|
|
||||||
points->coords[pi++] = points->coords[0];
|
(*points)[pi] = (*points)[0];
|
||||||
points->coords[pi] = points->coords[1];
|
|
||||||
|
|
||||||
fade_in_shape->set_property ("points", points);
|
fade_in_shape->property_points().set_value(*points);
|
||||||
gnome_canvas_points_unref (points);
|
delete points;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -655,7 +654,7 @@ AudioRegionView::reset_fade_out_shape_width (jack_nframes_t width)
|
||||||
|
|
||||||
width = std::max ((jack_nframes_t) 64, width);
|
width = std::max ((jack_nframes_t) 64, width);
|
||||||
|
|
||||||
GnomeCanvasPoints* points;
|
Points* points;
|
||||||
double pwidth = width / samples_per_unit;
|
double pwidth = width / samples_per_unit;
|
||||||
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
|
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
|
||||||
double h;
|
double h;
|
||||||
|
@ -704,25 +703,24 @@ AudioRegionView::reset_fade_out_shape_width (jack_nframes_t width)
|
||||||
double xdelta = pwidth/npoints;
|
double xdelta = pwidth/npoints;
|
||||||
|
|
||||||
for (pi = 0, pc = 0; pc < npoints; ++pc) {
|
for (pi = 0, pc = 0; pc < npoints; ++pc) {
|
||||||
points->coords[pi++] = _pixel_width - 1 - pwidth + (pc*xdelta);
|
(*points)[pi] = _pixel_width - 1 - pwidth + (pc*xdelta);
|
||||||
points->coords[pi++] = 2 + (h - (curve[pc] * h));
|
(*points)[pi++] = 2 + (h - (curve[pc] * h));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fold back */
|
/* fold back */
|
||||||
|
|
||||||
points->coords[pi++] = _pixel_width;
|
(*points)[pi] = _pixel_width;
|
||||||
points->coords[pi++] = h;
|
(*points)[pi++] = h;
|
||||||
|
|
||||||
points->coords[pi++] = _pixel_width;
|
(*points)[pi] = _pixel_width;
|
||||||
points->coords[pi++] = 2;
|
(*points)[pi++] = 2;
|
||||||
|
|
||||||
/* connect the dots ... */
|
/* connect the dots ... */
|
||||||
|
|
||||||
points->coords[pi++] = points->coords[0];
|
(*points)[pi] = (*points)[0];
|
||||||
points->coords[pi] = points->coords[1];
|
|
||||||
|
|
||||||
fade_out_shape->set_property ("points", points);
|
fade_out_shape->set_property ("points", *points);
|
||||||
gnome_canvas_points_unref (points);
|
delete points;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -731,7 +729,7 @@ AudioRegionView::set_samples_per_unit (gdouble spu)
|
||||||
TimeAxisViewItem::set_samples_per_unit (spu);
|
TimeAxisViewItem::set_samples_per_unit (spu);
|
||||||
|
|
||||||
for (uint32_t n=0; n < waves.size(); ++n) {
|
for (uint32_t n=0; n < waves.size(); ++n) {
|
||||||
gnome_canvas_item_set (waves[n], "samples_per_unit", spu, NULL);
|
waves[n]->property_samples_per_unit().set_value(spu);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
||||||
|
@ -762,7 +760,7 @@ void
|
||||||
AudioRegionView::set_amplitude_above_axis (gdouble spp)
|
AudioRegionView::set_amplitude_above_axis (gdouble spp)
|
||||||
{
|
{
|
||||||
for (uint32_t n=0; n < waves.size(); ++n) {
|
for (uint32_t n=0; n < waves.size(); ++n) {
|
||||||
gnome_canvas_item_set (waves[n], "amplitude_above_axis", spp, NULL);
|
waves[n]->property_amplitude_above_axis().set_value(spp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -788,9 +786,9 @@ AudioRegionView::set_colors ()
|
||||||
|
|
||||||
for (uint32_t n=0; n < waves.size(); ++n) {
|
for (uint32_t n=0; n < waves.size(); ++n) {
|
||||||
if (region.muted()) {
|
if (region.muted()) {
|
||||||
gnome_canvas_item_set (waves[n], "wave_color", color_map[cMutedWaveForm], NULL);
|
waves[n]->property_wave_color().set_value(color_map[cMutedWaveForm]);
|
||||||
} else {
|
} else {
|
||||||
gnome_canvas_item_set (waves[n], "wave_color", color_map[cWaveForm], NULL);
|
waves[n]->property_wave_color().set_value(color_map[cWaveForm]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -880,31 +878,27 @@ AudioRegionView::region_sync_changed ()
|
||||||
|
|
||||||
/* lets do it */
|
/* lets do it */
|
||||||
|
|
||||||
GtkArg args[1];
|
Points points;
|
||||||
GnomeCanvasPoints* points;
|
|
||||||
|
|
||||||
args[0].name = X_("points");
|
points = sync_mark->property_points().get_value();
|
||||||
|
|
||||||
sync_mark->get (X_("points"), &points);
|
|
||||||
|
|
||||||
double offset = sync_offset / samples_per_unit;
|
double offset = sync_offset / samples_per_unit;
|
||||||
|
|
||||||
points->coords[0] = offset - ((sync_mark_width-1)/2);
|
points[0].set_x(offset - ((sync_mark_width-1)/2));
|
||||||
points->coords[1] = 1;
|
points[0].set_y(1);
|
||||||
|
|
||||||
points->coords[2] = offset + (sync_mark_width-1)/2;
|
points[1].set_x(offset + (sync_mark_width-1)/2);
|
||||||
points->coords[3] = 1;
|
points[1].set_y(1);
|
||||||
|
|
||||||
points->coords[4] = offset;
|
points[2].set_x(offset);
|
||||||
points->coords[5] = sync_mark_width - 1;
|
points[2].set_y(sync_mark_width - 1);
|
||||||
|
|
||||||
points->coords[6] = offset - ((sync_mark_width-1)/2);
|
points[3].set_x(offset - ((sync_mark_width-1)/2));
|
||||||
points->coords[7] = 1;
|
points[3].set_y(1);
|
||||||
|
|
||||||
sync_mark->show();
|
sync_mark->show();
|
||||||
sync_mark->set_property ("points", points);
|
sync_mark->property_points().set_value(points);
|
||||||
|
|
||||||
gnome_canvas_points_unref (points);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -915,12 +909,12 @@ AudioRegionView::set_waveform_visible (bool yn)
|
||||||
if (((_flags & WaveformVisible) != yn)) {
|
if (((_flags & WaveformVisible) != yn)) {
|
||||||
if (yn) {
|
if (yn) {
|
||||||
for (uint32_t n=0; n < waves.size(); ++n) {
|
for (uint32_t n=0; n < waves.size(); ++n) {
|
||||||
gnome_canvas_item_show (waves[n]);
|
waves[n]->show();
|
||||||
}
|
}
|
||||||
_flags |= WaveformVisible;
|
_flags |= WaveformVisible;
|
||||||
} else {
|
} else {
|
||||||
for (uint32_t n=0; n < waves.size(); ++n) {
|
for (uint32_t n=0; n < waves.size(); ++n) {
|
||||||
gnome_canvas_item_hide (waves[n]);
|
waves[n]->hide();
|
||||||
}
|
}
|
||||||
_flags &= ~WaveformVisible;
|
_flags &= ~WaveformVisible;
|
||||||
}
|
}
|
||||||
|
@ -983,7 +977,7 @@ AudioRegionView::create_waves ()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
wave_caches.push_back (gnome_canvas_waveview_cache_new ());
|
wave_caches.push_back (WaveView::create_cache ());
|
||||||
|
|
||||||
if (wait_for_waves) {
|
if (wait_for_waves) {
|
||||||
if (region.source(n).peaks_ready (bind (mem_fun(*this, &AudioRegionView::peaks_ready_handler), n))) {
|
if (region.source(n).peaks_ready (bind (mem_fun(*this, &AudioRegionView::peaks_ready_handler), n))) {
|
||||||
|
@ -1021,26 +1015,42 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct)
|
||||||
}
|
}
|
||||||
gdouble yoff = which * ht;
|
gdouble yoff = which * ht;
|
||||||
|
|
||||||
GnomeCanvasItem *wave = gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
|
WaveView *wave = new WaveView(*group);
|
||||||
gnome_canvas_waveview_get_type (),
|
|
||||||
"data_src", (gpointer) ®ion,
|
wave->property_data_src().set_value( (gpointer) ®ion);
|
||||||
"cache", wave_caches[which],
|
wave->property_cache().set_value( wave_caches[which]);
|
||||||
"cache_updater", (gboolean) true,
|
wave->property_cache_updater().set_value( (gboolean) true);
|
||||||
"channel", (guint32) which,
|
wave->property_channel().set_value( (guint32) which);
|
||||||
"length_function", (gpointer) region_length_from_c,
|
wave->property_length_function().set_value( (gpointer) region_length_from_c);
|
||||||
"sourcefile_length_function",(gpointer) sourcefile_length_from_c,
|
wave->property_sourcefile_length_function().set_value((gpointer) sourcefile_length_from_c);
|
||||||
"peak_function", (gpointer) region_read_peaks_from_c,
|
wave->property_peak_function().set_value( (gpointer) region_read_peaks_from_c);
|
||||||
"x", 0.0,
|
wave->property_x().set_value( 0.0);
|
||||||
"y", yoff,
|
wave->property_y().set_value( yoff);
|
||||||
"height", (double) ht,
|
wave->property_height().set_value( (double) ht);
|
||||||
"samples_per_unit", samples_per_unit,
|
wave->property_samples_per_unit().set_value( samples_per_unit);
|
||||||
"amplitude_above_axis", _amplitude_above_axis,
|
wave->property_amplitude_above_axis().set_value( _amplitude_above_axis);
|
||||||
"wave_color", (guint32) (region.muted() ? color_map[cMutedWaveForm] : color_map[cWaveForm]),
|
wave->property_wave_color().set_value(region.muted() ? color_map[cMutedWaveForm] : color_map[cWaveForm]);
|
||||||
"region_start",(guint32) region.start(),
|
wave->property_region_start().set_value(region.start());
|
||||||
NULL);
|
// WaveView *wave = gnome_canvas_item_new (GNOME_CANVAS_GROUP(group),
|
||||||
|
// gnome_canvas_waveview_get_type (),
|
||||||
|
// "data_src", (gpointer) ®ion,
|
||||||
|
// "cache", wave_caches[which],
|
||||||
|
// "cache_updater", (gboolean) true,
|
||||||
|
// "channel", (guint32) which,
|
||||||
|
// "length_function", (gpointer) region_length_from_c,
|
||||||
|
// "sourcefile_length_function",(gpointer) sourcefile_length_from_c,
|
||||||
|
// "peak_function", (gpointer) region_read_peaks_from_c,
|
||||||
|
// "x", 0.0,
|
||||||
|
// "y", yoff,
|
||||||
|
// "height", (double) ht,
|
||||||
|
// "samples_per_unit", samples_per_unit,
|
||||||
|
// "amplitude_above_axis", _amplitude_above_axis,
|
||||||
|
// "wave_color", (guint32) (region.muted() ? color_map[cMutedWaveForm] : color_map[cWaveForm]),
|
||||||
|
// "region_start",(guint32) region.start(),
|
||||||
|
// NULL);
|
||||||
|
|
||||||
if (!(_flags & WaveformVisible)) {
|
if (!(_flags & WaveformVisible)) {
|
||||||
gnome_canvas_item_hide (wave);
|
wave->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* note: calling this function is serialized by the lock
|
/* note: calling this function is serialized by the lock
|
||||||
|
@ -1185,8 +1195,8 @@ AudioRegionView::set_waveform_shape (WaveformShape shape)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (yn != (bool) (_flags & WaveformRectified)) {
|
if (yn != (bool) (_flags & WaveformRectified)) {
|
||||||
for (vector<GnomeCanvasItem *>::iterator wave = waves.begin(); wave != waves.end() ; ++wave) {
|
for (vector<WaveView *>::iterator wave = waves.begin(); wave != waves.end() ; ++wave) {
|
||||||
gnome_canvas_item_set ((*wave), "rectified", (gboolean) yn, NULL);
|
(*wave)->property_rectified().set_value(yn);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zero_line) {
|
if (zero_line) {
|
||||||
|
@ -1243,21 +1253,35 @@ AudioRegionView::add_ghost (AutomationTimeAxisView& atv)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
GnomeCanvasItem *wave = gnome_canvas_item_new (GNOME_CANVAS_GROUP(ghost->group),
|
WaveView *wave = new WaveView(*ghost->group);
|
||||||
gnome_canvas_waveview_get_type (),
|
|
||||||
"data_src", (gpointer) ®ion,
|
wave->property_data_src().set_value( ®ion);
|
||||||
"cache", wave_caches[n],
|
wave->property_cache().set_value( wave_caches[n]);
|
||||||
"cache_updater", (gboolean) false,
|
wave->property_cache_updater().set_value(false);
|
||||||
"channel", (guint32) n,
|
wave->property_channel().set_value(n);
|
||||||
"length_function", (gpointer) region_length_from_c,
|
wave->property_length_function().set_value((gpointer)region_length_from_c);
|
||||||
"sourcefile_length_function",(gpointer) sourcefile_length_from_c,
|
wave->property_sourcefile_length_function().set_value((gpointer) sourcefile_length_from_c);
|
||||||
"peak_function", (gpointer) region_read_peaks_from_c,
|
wave->property_peak_function().set_value( (gpointer) region_read_peaks_from_c);
|
||||||
"x", 0.0,
|
wave->property_x().set_value( 0.0);
|
||||||
"samples_per_unit", samples_per_unit,
|
wave->property_samples_per_unit().set_value( samples_per_unit);
|
||||||
"amplitude_above_axis", _amplitude_above_axis,
|
wave->property_amplitude_above_axis().set_value( _amplitude_above_axis);
|
||||||
"wave_color", color_map[cGhostTrackWave],
|
wave->property_wave_color().set_value(color_map[cGhostTrackWave]);
|
||||||
"region_start", (guint32) region.start(),
|
wave->property_region_start().set_value(region.start());
|
||||||
NULL);
|
// WaveView *wave = gnome_canvas_item_new (GNOME_CANVAS_GROUP(ghost->group),
|
||||||
|
// gnome_canvas_waveview_get_type (),
|
||||||
|
// "data_src", (gpointer) ®ion,
|
||||||
|
// "cache", wave_caches[n],
|
||||||
|
// "cache_updater", (gboolean) false,
|
||||||
|
// "channel", (guint32) n,
|
||||||
|
// "length_function", (gpointer) region_length_from_c,
|
||||||
|
// "sourcefile_length_function",(gpointer) sourcefile_length_from_c,
|
||||||
|
// "peak_function", (gpointer) region_read_peaks_from_c,
|
||||||
|
// "x", 0.0,
|
||||||
|
// "samples_per_unit", samples_per_unit,
|
||||||
|
// "amplitude_above_axis", _amplitude_above_axis,
|
||||||
|
// "wave_color", color_map[cGhostTrackWave],
|
||||||
|
// "region_start", (guint32) region.start(),
|
||||||
|
// NULL);
|
||||||
|
|
||||||
|
|
||||||
ghost->waves.push_back(wave);
|
ghost->waves.push_back(wave);
|
||||||
|
@ -1335,15 +1359,15 @@ AudioRegionView::set_waveview_data_src()
|
||||||
|
|
||||||
for (uint32_t n = 0; n < waves.size(); ++n) {
|
for (uint32_t n = 0; n < waves.size(); ++n) {
|
||||||
// TODO: something else to let it know the channel
|
// TODO: something else to let it know the channel
|
||||||
gnome_canvas_item_set (waves[n], "data_src", ®ion, NULL);
|
waves[n]->property_data_src().set_value(®ion);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
||||||
|
|
||||||
(*i)->set_duration (unit_length);
|
(*i)->set_duration (unit_length);
|
||||||
|
|
||||||
for (vector<GnomeCanvasItem*>::iterator w = (*i)->waves.begin(); w != (*i)->waves.end(); ++w) {
|
for (vector<WaveView*>::iterator w = (*i)->waves.begin(); w != (*i)->waves.end(); ++w) {
|
||||||
gnome_canvas_item_set ((*w), "data_src", ®ion, NULL);
|
(*w)->property_data_src().set_value(®ion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,8 @@
|
||||||
#include "time_axis_view_item.h"
|
#include "time_axis_view_item.h"
|
||||||
#include "automation_line.h"
|
#include "automation_line.h"
|
||||||
#include "enums.h"
|
#include "enums.h"
|
||||||
#include "canvas-waveview.h"
|
#include "waveview.h"
|
||||||
|
#include "canvas.h"
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
class AudioRegion;
|
class AudioRegion;
|
||||||
|
@ -121,8 +122,8 @@ class AudioRegionView : public TimeAxisViewItem
|
||||||
WaveformRectified = 0x8
|
WaveformRectified = 0x8
|
||||||
};
|
};
|
||||||
|
|
||||||
vector<GnomeCanvasItem *> waves; /* waveviews */
|
vector<ArdourCanvas::WaveView *> waves; /* waveviews */
|
||||||
vector<GnomeCanvasItem *> tmp_waves; /* see ::create_waves()*/
|
vector<ArdourCanvas::WaveView *> tmp_waves; /* see ::create_waves()*/
|
||||||
Gnome::Canvas::Polygon* sync_mark; /* polgyon for sync position */
|
Gnome::Canvas::Polygon* sync_mark; /* polgyon for sync position */
|
||||||
Gnome::Canvas::Text* no_wave_msg; /* text */
|
Gnome::Canvas::Text* no_wave_msg; /* text */
|
||||||
Gnome::Canvas::Line* zero_line; /* simpleline */
|
Gnome::Canvas::Line* zero_line; /* simpleline */
|
||||||
|
|
|
@ -309,7 +309,7 @@ xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h)
|
||||||
return (savergb);
|
return (savergb);
|
||||||
}
|
}
|
||||||
|
|
||||||
GnomeCanvasPoints*
|
Gnome::Canvas::Points*
|
||||||
get_canvas_points (string who, uint32_t npoints)
|
get_canvas_points (string who, uint32_t npoints)
|
||||||
{
|
{
|
||||||
// cerr << who << ": wants " << npoints << " canvas points" << endl;
|
// cerr << who << ": wants " << npoints << " canvas points" << endl;
|
||||||
|
@ -318,7 +318,7 @@ get_canvas_points (string who, uint32_t npoints)
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return gnome_canvas_points_new (npoints);
|
return new Gnome::Canvas::Points (npoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -63,7 +63,7 @@ void allow_keyboard_focus (bool);
|
||||||
unsigned char* xpm2rgb (const char** xpm, uint32_t& w, uint32_t& h);
|
unsigned char* xpm2rgb (const char** xpm, uint32_t& w, uint32_t& h);
|
||||||
unsigned char* xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h);
|
unsigned char* xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h);
|
||||||
|
|
||||||
GnomeCanvasPoints* get_canvas_points (std::string who, uint32_t npoints);
|
Gnome::Canvas::Points* get_canvas_points (std::string who, uint32_t npoints);
|
||||||
|
|
||||||
int channel_combo_get_channel_count (Gtk::ComboBoxText& combo);
|
int channel_combo_get_channel_count (Gtk::ComboBoxText& combo);
|
||||||
Pango::FontDescription get_font_for_style (std::string widgetname);
|
Pango::FontDescription get_font_for_style (std::string widgetname);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user