13
0

the ongoing story of umpteen lines of code and its love affair with GTK2

git-svn-id: svn://localhost/trunk/ardour2@57 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2005-10-12 16:28:26 +00:00
parent 2d32c7da36
commit 192c6a9c16
15 changed files with 1152 additions and 690 deletions

View File

@ -67,10 +67,13 @@ automation_pan_line.cc
automation_time_axis.cc
axis_view.cc
canvas-imageframe.c
canvas-ruler.c
imagegrame.cc
canvas-simpleline.c
simpleline.cc
canvas-simplerect.c
simplerect.cc
canvas-waveview.c
waveview.cc
connection_editor.cc
crossfade_edit.cc
crossfade_view.cc

View File

@ -70,7 +70,7 @@ gnome_canvas_simpleline_class_init (GnomeCanvasSimpleLineClass *class)
gtk_object_add_arg_type ("GnomeCanvasSimpleLine::y1", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_Y1);
gtk_object_add_arg_type ("GnomeCanvasSimpleLine::x2", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_X2);
gtk_object_add_arg_type ("GnomeCanvasSimpleLine::y2", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_Y2);
gtk_object_add_arg_type ("GnomeCanvasSimpleLine::color_rgba", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_COLOR_RGBA);
gtk_object_add_arg_type ("GnomeCanvasSimpleLine::color-rgba", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_COLOR_RGBA);
object_class->set_arg = gnome_canvas_simpleline_set_arg;
object_class->get_arg = gnome_canvas_simpleline_get_arg;

View File

@ -107,23 +107,23 @@ gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
parent_class = gtk_type_class (gnome_canvas_item_get_type ());
gtk_object_add_arg_type ("GnomeCanvasWaveView::data_src", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_DATA_SRC);
gtk_object_add_arg_type ("GnomeCanvasWaveView::data-src", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_DATA_SRC);
gtk_object_add_arg_type ("GnomeCanvasWaveView::channel", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_CHANNEL);
gtk_object_add_arg_type ("GnomeCanvasWaveView::length_function", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_LENGTH_FUNCTION);
gtk_object_add_arg_type ("GnomeCanvasWaveView::sourcefile_length_function", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_SOURCEFILE_LENGTH_FUNCTION);
gtk_object_add_arg_type ("GnomeCanvasWaveView::peak_function", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_PEAK_FUNCTION);
gtk_object_add_arg_type ("GnomeCanvasWaveView::gain_function", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_GAIN_FUNCTION);
gtk_object_add_arg_type ("GnomeCanvasWaveView::gain_src", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_GAIN_SRC);
gtk_object_add_arg_type ("GnomeCanvasWaveView::length-function", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_LENGTH_FUNCTION);
gtk_object_add_arg_type ("GnomeCanvasWaveView::sourcefile-length-function", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_SOURCEFILE_LENGTH_FUNCTION);
gtk_object_add_arg_type ("GnomeCanvasWaveView::peak-function", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_PEAK_FUNCTION);
gtk_object_add_arg_type ("GnomeCanvasWaveView::gain-function", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_GAIN_FUNCTION);
gtk_object_add_arg_type ("GnomeCanvasWaveView::gain-src", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_GAIN_SRC);
gtk_object_add_arg_type ("GnomeCanvasWaveView::cache", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_CACHE);
gtk_object_add_arg_type ("GnomeCanvasWaveView::cache_updater", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_CACHE_UPDATER);
gtk_object_add_arg_type ("GnomeCanvasWaveView::samples_per_unit", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_SAMPLES_PER_PIXEL);
gtk_object_add_arg_type ("GnomeCanvasWaveView::cache-updater", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_CACHE_UPDATER);
gtk_object_add_arg_type ("GnomeCanvasWaveView::samples-per-unit", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_SAMPLES_PER_PIXEL);
gtk_object_add_arg_type ("GnomeCanvasWaveView::amplitude_above_axis", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_AMPLITUDE_ABOVE_AXIS);
gtk_object_add_arg_type ("GnomeCanvasWaveView::x", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_X);
gtk_object_add_arg_type ("GnomeCanvasWaveView::y", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_Y);
gtk_object_add_arg_type ("GnomeCanvasWaveView::height", GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, ARG_HEIGHT);
gtk_object_add_arg_type ("GnomeCanvasWaveView::wave_color", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_WAVE_COLOR);
gtk_object_add_arg_type ("GnomeCanvasWaveView::wave-color", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_WAVE_COLOR);
gtk_object_add_arg_type ("GnomeCanvasWaveView::rectified", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_RECTIFIED);
gtk_object_add_arg_type ("GnomeCanvasWaveView::region_start", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_REGION_START);
gtk_object_add_arg_type ("GnomeCanvasWaveView::region-start", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_REGION_START);
object_class->set_arg = gnome_canvas_waveview_set_arg;
object_class->get_arg = gnome_canvas_waveview_get_arg;

View File

@ -138,19 +138,19 @@ ConnectionEditor::ConnectionEditor ()
input_connection_display.set_selection_mode (GTK_SELECTION_SINGLE);
input_connection_display.set_size_request (80, -1);
input_connection_display.set_name ("ConnectionEditorConnectionList");
input_connection_display.select_row.connect (bind (mem_fun(*this, &ConnectionEditor::connection_selected), true));
input_connection_display.signal_selection_changed().connect (bind (mem_fun(*this, &ConnectionEditor::connection_selection_changed), input_connection_display));
output_connection_display.set_shadow_type (Gtk::SHADOW_IN);
output_connection_display.set_selection_mode (GTK_SELECTION_SINGLE);
output_connection_display.set_size_request (80, -1);
output_connection_display.set_name ("ConnectionEditorConnectionList");
output_connection_display.select_row.connect (bind (mem_fun(*this, &ConnectionEditor::connection_selected), false));
output_connection_display.signal_selection_changed().connect (bind (mem_fun(*this, &ConnectionEditor::connection_selected), output_connection_display));
input_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
output_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
input_scroller.add_with_viewport (input_connection_display);
output_scroller.add_with_viewport (output_connection_display);
input_scroller.add (input_connection_display);
output_scroller.add (output_connection_display);
input_box.set_border_width (5);
input_box.set_spacing (5);
@ -250,46 +250,56 @@ ConnectionEditor::on_map (GdkEventAny *ev)
void
ConnectionEditor::add_connection (ARDOUR::Connection *connection)
{
using namespace CList_Helpers;
const char *rowtext[1];
rowtext[0] = connection->name().c_str();
TreeModel::Row row;
if (dynamic_cast<InputConnection *> (connection)) {
if (push_at_front) {
input_connection_display.rows().push_front (rowtext);
input_connection_display.rows().front().set_data (connection);
row = *(input_connection_model.prepend());
} else {
input_connection_display.rows().push_back (rowtext);
input_connection_display.rows().back().set_data (connection);
row = *(input_connection_model.append());
}
row[input_connection_columns.connection] = connection;
row[input_connection_columns.name] = connection->name();
} else {
if (push_at_front) {
output_connection_display.rows().push_front (rowtext);
output_connection_display.rows().front().set_data (connection);
row = *(output_connection_model.prepend());
} else {
output_connection_display.rows().push_back (rowtext);
output_connection_display.rows().back().set_data (connection);
row = *(output_connection_model.append());
}
row[output_connection_columns.connection] = connection;
row[output_connection_columns.name] = connection->name();
}
}
void
ConnectionEditor::remove_connection (ARDOUR::Connection *connection)
{
using namespace Gtk::CList_Helpers;
RowList::iterator i;
RowList* rlist;
TreeModel::Children rows;
TreeModel::iterator i;
if (dynamic_cast<InputConnection *> (connection)) {
rlist = &input_connection_display.rows();
TreeModel::Children rows = input_connection_model->children();
for (i = rows.begin(); i != rows.end(); ++i) {
if ((*i)[input_connection_columns.connection] == connection) {
rows.erase (i);
break;
}
}
} else {
rlist = &output_connection_display.rows();
TreeModel::Children rows = output_connection_model->children();
for (i = rows.begin(); i != rows.end(); ++i) {
if ((*i)[output_connection_columns.connection] == connection) {
rows.erase (i);
break;
}
}
}
if ((i = rlist->find_data (connection)) != rlist->end()) {
rlist->erase (i);
}
}
void
@ -319,29 +329,35 @@ ConnectionEditor::add_connection_and_select (ARDOUR::Connection *connection)
void
ConnectionEditor::refill_connection_display ()
{
input_connection_display.clear();
output_connection_display.clear();
input_connection_display.set_model (0);
output_connection_display.set_model (0);
input_connection_model.clear();
output_connection_model.clear();
current_connection = 0;
if (session) {
session->foreach_connection (this, &ConnectionEditor::add_connection);
}
input_connection_display.set_model (input_connection_model);
output_connection_display.set_model (output_connection_model);
}
void
ConnectionEditor::connection_selected (gint row, gint col, GdkEvent *ev, bool input)
ConnectionEditor::connection_selection_changed (TreeView& view, Glib::RefPtr<ListStore>& model)
{
ARDOUR::Connection *old_current = current_connection;
if (input) {
output_connection_display.unselect_all ();
current_connection = reinterpret_cast<ARDOUR::Connection*> (input_connection_display.row(row).get_data());
} else {
input_connection_display.unselect_all ();
current_connection = reinterpret_cast<ARDOUR::Connection*> (output_connection_display.row(row).get_data());
}
TreeIter iter;
TreeModel::Path path;
Glib::RefPtr<TreeView::Selection> selection = view->get_selection();
iter = model->get_iter (path);
current_connection = (*iter)[input_connection_columns.connection];
if (old_current != current_connection) {
config_connection.disconnect ();
@ -513,23 +529,25 @@ ConnectionEditor::display_connection_state (bool for_input)
snprintf(buf, sizeof(buf)-1, _("out %d"), n+1);
}
title[0] = buf;
clist = manage (new CList (1, title));
scroller = new ScrolledWindow;
tview = manage (new TreeView());
Glib::RefPtr<ListStore> port_model = ListStore::create (*port_display_columns);
scroller->add_with_viewport (*clist);
tview->set_model (port_model);
tview->append_column (_(buf), port_display_columns->name);
tview->set_selection()->set_mode (Gtk::SELECTION_SINGLE);
tview->set_data ("port", (gpointer) ((intptr_t) n));
tview->set_headers_visible (true);
tview->set_name ("ConnectionEditorPortList");
tview->signal_button_press_event().connect (bind (mem_fun(*this, &ConnectionEditor::port_column_click), clist));
scroller = manage (new ScrolledWindow);
scroller->add (*tview);
scroller->set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
port_displays.insert (port_displays.end(), scroller);
port_box.pack_start (*scroller);
clist->set_data ("port", (gpointer) ((intptr_t) n));
clist->set_name ("ConnectionEditorPortList");
clist->click_column.connect (bind (mem_fun(*this, &ConnectionEditor::port_column_click), clist));
clist->set_selection_mode (GTK_SELECTION_SINGLE);
clist->set_shadow_type (Gtk::SHADOW_IN);
scroller->set_size_request (-1, 75);
/* now fill the clist with the current connections */
@ -537,25 +555,28 @@ ConnectionEditor::display_connection_state (bool for_input)
const ARDOUR::Connection::PortList& connections = current_connection->port_connections (n);
for (ARDOUR::Connection::PortList::const_iterator i = connections.begin(); i != connections.end(); ++i) {
const gchar *data[1];
data[0] = (*i).c_str();
clist->rows().push_back (data);
}
clist->columns_autosize ();
clist->signal_button_release_event().connect (bind (mem_fun(*this, &ConnectionEditor::port_button_event), clist));
TreeModel::Row row = *(model->append());
row[port_connection_columns.name] = (*i)->name();
}
}
port_box.show_all ();
}
void
ConnectionEditor::port_selection_handler (gint row, gint col, GdkEvent *ev, Gtk::CList *clist)
ConnectionEditor::port_selection_changed (TreeView* tview)
{
using namespace CList_Helpers;
Glib::RefPtr<TreeView::Selection> sel = tview->get_selection();
TreeModel::iterator iter = sel->get_selected();
string other_port_name = (char *) clist->rows()[row].get_data();
if (iter) {
TreeModel::Row row = *iter;
string other_port_name = row[port_display_columns.name];
} else {
selected_port = -1;
}
if (current_connection && selected_port >= 0) {
current_connection->add_connection (selected_port, other_port_name);
@ -572,29 +593,24 @@ ConnectionEditor::add_port ()
}
void
ConnectionEditor::port_column_click (gint col, CList *clist)
ConnectionEditor::port_button_press_event (GdkEventButton* ev, TreeView* tview)
{
/* Gack. CList's don't respond visually to a change
in their state, so rename them to force a style
switch.
*/
LockMonitor lm (port_display_lock, __LINE__, __FILE__);
int which_port = reinterpret_cast<intptr_t> (clist->get_data ("port"));
int which_port = reinterpret_cast<intptr_t> (treeview->get_data ("port"));
if (which_port != selected_port) {
selected_port = which_port;
display_ports ();
clist->set_name ("ConnectionEditorPortListSelected");
tview->set_name ("ConnectionEditorPortListSelected");
for (slist<ScrolledWindow *>::iterator i = port_displays.begin(); i != port_displays.end(); ++i) {
Widget *child = (*i)->get_child();
if (static_cast<CList *> (child) != clist) {
if (static_cast<TreeView *> (child) != tview) {
child->set_name ("ConnectionEditorPortList");
child->queue_draw ();
}
@ -608,23 +624,25 @@ ConnectionEditor::port_column_click (gint col, CList *clist)
}
}
gint
ConnectionEditor::connection_click (GdkEventButton *ev, CList *clist)
void
ConnectionEditor::connection_selection_changed (TreeView* tview);
{
gint row, col;
Glib::RefPtr<TreeView::Selection> sel = tview->get_selection();
TreeModel::iterator iter = sel->get_selected();
if (clist->get_selection_info ((int)ev->x, (int)ev->y, &row, &col) == 0) {
return FALSE;
if (iter) {
TreeModel::Row row = *iter;
current_connection = row[XXXX_display_columns.connection];
} else {
current_connection = 0;
}
current_connection = reinterpret_cast<ARDOUR::Connection *> (clist->row(row).get_data ());
return TRUE;
}
void
ConnectionEditor::new_connection (bool for_input)
{
string name;
if (session == 0) {
return;
}
@ -632,16 +650,11 @@ ConnectionEditor::new_connection (bool for_input)
ArdourPrompter prompter (true);
prompter.set_prompt (_("Name for new connection:"));
prompter.done.connect (Gtk::Main::quit.slot());
prompter.show_all();
Gtk::Main::run();
if (prompter.status == Gtkmm2ext::Prompter::entered) {
string name;
switch (prompter.run()) {
case GTK_RESPONSE_ACCEPT:
prompter.get_result (name);
push_at_front = true;
if (name.length()) {
if (for_input) {
session->add_connection (new ARDOUR::InputConnection (name));
@ -650,6 +663,10 @@ ConnectionEditor::new_connection (bool for_input)
}
}
push_at_front = false;
break;
default:
break;
}
}

View File

@ -60,6 +60,22 @@ class ConnectionEditor : public ArdourDialog {
int selected_port;
bool push_at_front;
struct ConnectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
SnapshotDisplayModelColumns() {
add (visible_name);
add (real_name);
}
Gtk::TreeModelColumn<Glib::ustring> name;
Gtk::TreeModelColumn<ARDOUR::Connection*> connection;
};
ConnectionDisplayModelColumns input_connection_columns;
ConnectionDisplayModelColumns output_connection_columns;
Glib::RefPtr<Gtk::ListStore> input_connection_model;
Glib::RefPtr<Gtk::ListStore> output_connection_model;
Gtk::TreeView input_connection_display;
Gtk::TreeView output_connection_display;
Gtk::ScrolledWindow input_scroller;

View File

@ -236,9 +236,6 @@ Editor::Editor (AudioEngine& eng)
snap_mode_label(_("Snap Mode")),
zoom_focus_label (_("Zoom Focus")),
route_list (internationalize (route_list_titles)),
edit_group_list (internationalize (edit_group_list_titles)),
/* <CMT Additions> */
image_socket_listener(0),
/* </CMT Additions> */
@ -280,7 +277,6 @@ Editor::Editor (AudioEngine& eng)
clicked_crossfadeview = 0;
clicked_control_point = 0;
latest_regionview = 0;
region_list_display_drag_region = 0;
last_update_frame = 0;
drag_info.item = 0;
last_audition_region = 0;
@ -305,7 +301,6 @@ Editor::Editor (AudioEngine& eng)
export_dialog = 0;
show_gain_after_trim = false;
no_zoom_repos_update = false;
need_wave_cursor = 0;
ignore_route_list_reorder = false;
verbose_cursor_on = true;
route_removal = false;
@ -375,8 +370,8 @@ Editor::Editor (AudioEngine& eng)
track_canvas_scroller.get_hadjustment()->set_step_increment (20.0);
track_canvas_scroller.get_hadjustment()->signal_value_changed().connect (mem_fun(*this, &Editor::canvas_horizontally_scrolled));
edit_vscrollbar.set_adjustment(track_canvas_scroller.get_vadjustment());
edit_hscrollbar.set_adjustment(track_canvas_scroller.get_hadjustment());
edit_vscrollbar.set_adjustment(*track_canvas_scroller.get_vadjustment());
edit_hscrollbar.set_adjustment(*track_canvas_scroller.get_hadjustment());
edit_hscrollbar.signal_button_press_event().connect (mem_fun(*this, &Editor::hscroll_slider_button_press));
edit_hscrollbar.signal_button_release_event().connect (mem_fun(*this, &Editor::hscroll_slider_button_release));
@ -384,12 +379,12 @@ Editor::Editor (AudioEngine& eng)
time_canvas_scroller.add (*time_canvas);
time_canvas_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_NEVER);
time_canvas_scroller.set_hadjustment (track_canvas_scroller.get_hadjustment());
time_canvas_scroller.set_hadjustment (*track_canvas_scroller.get_hadjustment());
time_canvas_scroller.set_name ("TimeCanvasScroller");
edit_controls_vbox.set_spacing (track_spacing);
edit_controls_hbox.pack_start (edit_controls_vbox, true, true);
edit_controls_scroller.add_with_viewport (edit_controls_hbox);
edit_controls_scroller.add (edit_controls_hbox);
edit_controls_scroller.set_name ("EditControlsBase");
edit_controls_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_NEVER);
@ -806,345 +801,182 @@ Editor::initialize_canvas ()
{
gnome_canvas_init ();
track_gnome_canvas = gnome_canvas_new_aa ();
/* adjust sensitivity for "picking" items */
// GNOME_CANVAS(track_gnome_canvas)->close_enough = 2;
gtk_signal_connect (GTK_OBJECT(gnome_canvas_root (GNOME_CANVAS(track_gnome_canvas))), "event",
(GtkSignalFunc) Editor::_track_canvas_event, this);
track_canvas = Glib::wrap (track_gnome_canvas);
track_canvas->set_name ("EditorMainCanvas");
track_canvas->add_events (Gdk::POINTER_MOTION_HINT_MASK);
track_canvas->signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas));
track_canvas.signal_event().connect (slot (*this, &Editor::track_canvas_event));
track_canvas.set_name ("EditorMainCanvas");
track_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK);
track_canvas.signal_event().connect (slot (*this, &Editor::track_canvas_event));
track_canvas.signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas));
/* set up drag-n-drop */
track_canvas->drag_dest_set (GTK_DEST_DEFAULT_ALL,
track_canvas.drag_dest_set (GTK_DEST_DEFAULT_ALL,
target_table, n_targets - 1,
GdkDragAction (Gdk::ACTION_COPY|Gdk::ACTION_MOVE));
track_canvas->drag_data_received.connect (mem_fun(*this, &Editor::track_canvas_drag_data_received));
track_canvas.drag_data_received.connect (mem_fun(*this, &Editor::track_canvas_drag_data_received));
/* stuff for the verbose canvas cursor */
Pango::FontDescription font = get_font_for_style (N_("VerboseCanvasCursor"));
verbose_canvas_cursor = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(track_gnome_canvas)),
gnome_canvas_text_get_type(),
"font-desc", fontname,
"anchor", GTK_ANCHOR_NW,
"fill_color_rgba", color_map[cVerboseCanvasCursor],
NULL);
verbose_canvas_cursor = new Canvas::Text (track_canvas.root());
verbose_canvas_cursor->property_font_descr() << font;
verbose_canvas_cursor->property_anchor() << GTK_ANCHOR_NW;
verbose_canvas_cursor->property_fill_color_rgba() << color_map[cVerboseCanvasCursor];
verbose_cursor_visible = false;
/* a group to hold time (measure) lines */
time_line_group = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(track_gnome_canvas)),
gnome_canvas_group_get_type(),
"x", 0.0,
"y", 0.0,
NULL);
cursor_group = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(track_gnome_canvas)),
gnome_canvas_group_get_type(),
"x", 0.0,
"y", 0.0,
NULL);
time_line_group = new Canvas::Group (track_canvas.root(), 0.0, 0.0);
cursor_group = new Canvas::Group (track_canvas.root(), 0.0, 0.0);
time_gnome_canvas = gnome_canvas_new_aa ();
time_canvas = Glib::wrap (time_gnome_canvas);
time_canvas->set_name ("EditorTimeCanvas");
time_canvas.set_name ("EditorTimeCanvas");
time_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK);
time_canvas->add_events (Gdk::POINTER_MOTION_HINT_MASK);
meter_group = new Canvas::Group (time_canvas.root(), 0.0, 0.0);
tempo_group = new Canvas::Group (time_canvas.root(), 0.0, 0.0);
marker_group = new Canvas::Group (time_canvas.root(), 0.0, timebar_height * 2.0);
range_marker_group = new Canvas::Group (time_canvas.root(), 0.0, timebar_height * 3.0);
transport_marker_group = new Canvas::Group (time_canvas.root(), 0.0, timebar_height * 4.0);
meter_group = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(time_gnome_canvas)),
gnome_canvas_group_get_type(),
"x", 0.0,
"y", 0.0,
NULL);
tempo_group = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(time_gnome_canvas)),
gnome_canvas_group_get_type(),
"x", 0.0,
"y", timebar_height,
NULL);
marker_group = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(time_gnome_canvas)),
gnome_canvas_group_get_type(),
"x", 0.0,
"y", timebar_height * 2.0,
NULL);
range_marker_group = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(time_gnome_canvas)),
gnome_canvas_group_get_type(),
"x", 0.0,
"y", timebar_height * 3.0,
NULL);
transport_marker_group = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(time_gnome_canvas)),
gnome_canvas_group_get_type(),
"x", 0.0,
"y", timebar_height * 4.0,
NULL);
tempo_bar = Canvas::SimpleRect (*tempo_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
tempo_bar->property_fill_color_rgba() << color_map[cTempoBar];
tempo_bar->property_outline_pixels() << 0;
meter_bar = Canvas::SimpleRect (*meter_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
meter_bar->property_fill_color_rgba() << color_map[cMeterBar];
meter_bar->property_outline_pixels() << 0;
marker_bar = Canvas::SimpleRect (*marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
marker_bar->property_fill_color_rgba() << color_map[cMarkerBar];
marker_bar->property_outline_pixels() << 0;
range_marker_bar = Canvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
range_marker_bar->property_fill_color_rgba() << color_map[cRangeMarkerBar];
range_marker_bar->property_outline_pixels() << 0;
transport_marker_bar = Canvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
transport_marker_bar->property_fill_color_rgba() << color_map[cTransportMarkerBar];
transport_marker_bar->property_outline_pixels() << 0;
range_bar_drag_rect = Canvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
range_bar_drag_rect->property_fill_color_rgba() << color_map[cRangeBarDragRectFill];
range_bar_drag_rect->property_outline_color_rgba() << color_map[cRangeBarDragRect];
range_bar_drag_rect->property_outline_pixels() << 0;
range_bar_drag_rect->hide ();
transport_bar_drag_rect = Canvas::SimpleRect (*transport_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height);
transport_bar_drag_rect ->property_fill_color_rgba() << color_map[cTransportBarDragRectFill];
transport_bar_drag_rect->property_outline_color_rgba() << color_map[cTransportBarDragRect];
transport_bar_drag_rect->property_outline_pixels() << 0;
transport_bar_drag_rect->hide ();
tempo_bar = gnome_canvas_item_new (GNOME_CANVAS_GROUP(tempo_group),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", max_canvas_coordinate,
"y2", timebar_height,
"fill_color_rgba", color_map[cTempoBar],
"outline_pixels", 0,
NULL);
meter_bar = gnome_canvas_item_new (GNOME_CANVAS_GROUP(meter_group),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", max_canvas_coordinate,
"y2", timebar_height,
"fill_color_rgba", color_map[cMeterBar],
"outline_pixels", 0,
NULL);
marker_bar = gnome_canvas_item_new (GNOME_CANVAS_GROUP(marker_group),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", max_canvas_coordinate,
"y2", timebar_height,
"fill_color_rgba", color_map[cMarkerBar],
"outline_pixels", 0,
NULL);
range_marker_bar = gnome_canvas_item_new (GNOME_CANVAS_GROUP(range_marker_group),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", max_canvas_coordinate,
"y2", timebar_height,
"fill_color_rgba", color_map[cRangeMarkerBar],
"outline_pixels", 0,
NULL);
transport_marker_bar = gnome_canvas_item_new (GNOME_CANVAS_GROUP(transport_marker_group),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", max_canvas_coordinate,
"y2", timebar_height,
"fill_color_rgba", color_map[cTransportMarkerBar],
"outline_pixels", 0,
NULL);
marker_drag_line_points = new Canvas::Points (2);
marker_drag_line_points[0]->set_x (0.0);
marker_drag_line_points[0]->set_y (0.0);
marker_drag_line_points[1]->set_x (0.0);
marker_drag_line_points[1]->set_y (0.0);
marker_drag_line = Canvas::Line (track_canvas.root());
marker_drag_line->property_width_pixels() << 1;
marker_drag_line->property_fill_color_rgba() << color_map[cMarkerDragLine];
marker_drag_line->property_points() << marker_drag_line_points;
marker_drag_line->hide();
range_marker_drag_rect = new Canvas::SimpleRect (track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
range_marker_drag_rect->property_fill_color_rgba() << color_map[cRangeDragRectFill];
range_marker_drag_rect->property_outline_color_rgba() << color_map[cRangeDragRect];
range_marker_drag_rect->hide ();
range_bar_drag_rect = gnome_canvas_item_new (GNOME_CANVAS_GROUP(range_marker_group),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", 0.0,
"y2", timebar_height,
"fill_color_rgba", color_map[cRangeDragBarRectFill],
"outline_color_rgba", color_map[cRangeDragBarRect],
NULL);
gnome_canvas_item_hide (range_bar_drag_rect);
transport_bar_drag_rect = gnome_canvas_item_new (GNOME_CANVAS_GROUP(transport_marker_group),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", 0.0,
"y2", timebar_height,
"fill_color_rgba", color_map[cTransportDragRectFill],
"outline_color_rgba", color_map[cTransportDragRect],
NULL);
gnome_canvas_item_hide (transport_bar_drag_rect);
transport_loop_range_rect = new Canvas::Simplerect (group.root(), 0.0, 0.0, 0.0, 0.0);
transport_loop_range_rect->property_fill_color_rgba() << color_map[cTransportLoopRectFill];
transport_loop_range_rect->property_outline_color_rgba() << color_map[cTransportLoopRect];
transport_loop_range_rect->property_outline_pixels() << 1;
transport_loop_range_rect->hide();
transport_punch_range_rect = new Canvas::Simplerect (group.root(), 0.0, 0.0, 0.0, 0.0);
transport_punch_range_rect->property_fill_color_rgba() << color_map[cTransportPunchRectFill];
transport_punch_range_rect->property_outline_color_rgba() << color_map[cTransportPunchRect];
transport_punch_range_rect->property_outline_pixels() << 0;
transport_punch_range_rect->hide();
marker_drag_line_points = gnome_canvas_points_new (2);
marker_drag_line_points->coords[0] = 0.0;
marker_drag_line_points->coords[1] = 0.0;
marker_drag_line_points->coords[2] = 0.0;
marker_drag_line_points->coords[3] = 0.0;
//cerr << "set mdl points, nc = " << marker_drag_line_points->num_points << endl;
marker_drag_line = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(track_gnome_canvas)),
gnome_canvas_line_get_type(),
"width_pixels", 1,
"fill_color_rgba", color_map[cMarkerDragLine],
"points", marker_drag_line_points,
NULL);
gnome_canvas_item_hide (marker_drag_line);
range_marker_drag_rect = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(track_gnome_canvas)),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", 0.0,
"y2", 0.0,
"fill_color_rgba", color_map[cRangeDragRectFill],
"outline_color_rgba", color_map[cRangeDragRect],
NULL);
gnome_canvas_item_hide (range_marker_drag_rect);
transport_loop_range_rect = gnome_canvas_item_new ((GNOME_CANVAS_GROUP(time_line_group)),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", 0.0,
"y2", 0.0,
"fill_color_rgba", color_map[cTransportLoopRectFill],
"outline_color_rgba", color_map[cTransportLoopRect],
"outline_pixels", 1,
NULL);
gnome_canvas_item_hide (transport_loop_range_rect);
transport_punch_range_rect = gnome_canvas_item_new ((GNOME_CANVAS_GROUP(time_line_group)),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", 0.0,
"y2", 0.0,
"fill_color_rgba", color_map[cTransportPunchRectFill],
"outline_color_rgba", color_map[cTransportPunchRect],
"outline_pixels", 0,
NULL);
gnome_canvas_item_lower_to_bottom (transport_punch_range_rect);
gnome_canvas_item_lower_to_bottom (transport_loop_range_rect); // loop on the bottom
gnome_canvas_item_hide (transport_punch_range_rect);
transport_punchin_line = gnome_canvas_item_new ((GNOME_CANVAS_GROUP(time_line_group)),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", 0.0,
"y2", 0.0,
"outline_color_rgba", color_map[cPunchInLine],
"outline_pixels", 1,
NULL);
gnome_canvas_item_hide (transport_punchin_line);
transport_punchout_line = gnome_canvas_item_new ((GNOME_CANVAS_GROUP(time_line_group)),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", 0.0,
"y2", 0.0,
"outline_color_rgba", color_map[cPunchOutLine],
"outline_pixels", 1,
NULL);
gnome_canvas_item_hide (transport_punchout_line);
transport_loop_range_rect->lower_to_bottom (); // loop on the bottom
transport_punchin_line = new Canvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
transport_punchin_line->property_outline_color_rgba() << color_map[cPunchInLine];
transport_punchin_line->property_outline_pixels() << 1;
transport_punchin_line->hide ();
transport_punchout_line = new Canvas::Simplerect (group.root(), 0.0, 0.0, 0.0, 0.0);
transport_punchout_line->property_outline_color_rgba() << color_map[cPunchOutLine];
transport_punchout_line->property_outline_pixels() << 1;
transport_punchout_line->hide();
// used to show zoom mode active zooming
zoom_rect = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(track_gnome_canvas)),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", 0.0,
"y2", 0.0,
"fill_color_rgba", color_map[cZoomRectFill],
"outline_color_rgba", color_map[cZoomRect],
"outline_pixels", 1,
NULL);
gnome_canvas_item_hide (zoom_rect);
gtk_signal_connect (GTK_OBJECT(zoom_rect), "event",
(GtkSignalFunc) PublicEditor::canvas_zoom_rect_event,
this);
zoom_rect = new Canvas::Simplerect (track_gnome_canvas.root(), 0.0, 0.0, 0.0, 0.0);
zoom_rect->property_fill_color_rgba() << color_map[cZoomRectFill];
zoom_rect->property_outline_color_rgba() << color_map[cZoomRect];
zoom_rect->property_outline_pixels() << 1;
zoom_rect->hide();
zoom_rect.signal_event().connect (slot (*this, &PublicEditor::canvas_zoom_rect_event));
// used as rubberband rect
rubberband_rect = gnome_canvas_item_new (gnome_canvas_root(GNOME_CANVAS(track_gnome_canvas)),
gnome_canvas_simplerect_get_type(),
"x1", 0.0,
"y1", 0.0,
"x2", 0.0,
"y2", 0.0,
"outline_color_rgba", color_map[cRubberBandRect],
"fill_color_rgba", (guint32) color_map[cRubberBandRectFill],
"outline_pixels", 1,
NULL);
gnome_canvas_item_hide (rubberband_rect);
rubberband_rect = new Canvas::Simplerect (track_gnome_canvas.root(), 0.0, 0.0, 0.0, 0.0);
rubberband_rect->property_outline_color_rgba() << color_map[cRubberBandRect];
rubberband_rect->property_fill_color_rgba() << (guint32) color_map[cRubberBandRectFill];
rubberband_rect->property_outline_pixels() << 1;
rubberband_rect->hide();
tempo_bar.signal_event().connect (slot (*this, &PublicEditor::canvas_tempo_bar_event));
meter_bar.signal_event().connect (slot (*this, &PublicEditor::canvas_meter_bar_event));
marker_bar.signal_event().connect (slot (*this, &PublicEditor::canvas_marker_bar_event));
range_marker_bar.signal_event().connect (slot (*this, &PublicEditor::canvas_range_marker_bar_event));
transport_marker_bar.signal_event().connect (slot (*this, &PublicEditor::canvas_transport_marker_bar_event));
gtk_signal_connect (GTK_OBJECT(tempo_bar), "event",
(GtkSignalFunc) PublicEditor::canvas_tempo_bar_event,
this);
gtk_signal_connect (GTK_OBJECT(meter_bar), "event",
(GtkSignalFunc) PublicEditor::canvas_meter_bar_event,
this);
gtk_signal_connect (GTK_OBJECT(marker_bar), "event",
(GtkSignalFunc) PublicEditor::canvas_marker_bar_event,
this);
gtk_signal_connect (GTK_OBJECT(range_marker_bar), "event",
(GtkSignalFunc) PublicEditor::canvas_range_marker_bar_event,
this);
gtk_signal_connect (GTK_OBJECT(transport_marker_bar), "event",
(GtkSignalFunc) PublicEditor::canvas_transport_marker_bar_event,
this);
/* separator lines */
tempo_line_points = gnome_canvas_points_new (2);
tempo_line_points->coords[0] = 0;
tempo_line_points->coords[1] = timebar_height;
tempo_line_points->coords[2] = max_canvas_coordinate;
tempo_line_points->coords[3] = timebar_height;
//cerr << "set tl points, nc = " << tempo_line_points->num_points << endl;
tempo_line = gnome_canvas_item_new (GNOME_CANVAS_GROUP(tempo_group),
gnome_canvas_line_get_type(),
"width_pixels", 0,
"fill_color", "black",
"points", tempo_line_points,
NULL);
tempo_line_points = new Canvas::Points (2);
tempo_line_points[0]->set_x (0.0);
tempo_line_points[0]->set_y (timebar_height);
tempo_line_points[1]->set_x (max_canvas_coordinate);
tempo_line_points[1]->set_y (timebar_height);
// cerr << "tempo line @ " << tempo_line << endl;
tempo_line = Canvas::Line (*tempo_group, *tempo_line_points);
tempo_line->property_width_pixels() << 0;
tempo_line->property_fill_color() << "black";
meter_line_points = gnome_canvas_points_new (2);
meter_line_points->coords[0] = 0;
meter_line_points->coords[1] = timebar_height;
meter_line_points->coords[2] = max_canvas_coordinate;
meter_line_points->coords[3] = timebar_height;
// cerr << "set ml points, nc = " << tempo_line_points->num_points << endl;
meter_line = gnome_canvas_item_new (GNOME_CANVAS_GROUP(meter_group),
gnome_canvas_line_get_type(),
"width_pixels", 0,
"fill_color", "black",
"points", meter_line_points,
NULL);
meter_line_points = new Canvas::Points (2);
meter_line_points[0]->set_x (0);
meter_line_points[0]->set_y (timebar_height);
meter_line_points[1]->set_x (max_canvas_coordinate);
meter_line_points[1]->set_y (timebar_height);
// cerr << "meter line @ " << tempo_line << endl;
marker_line_points = gnome_canvas_points_new (2);
marker_line_points->coords[0] = 0;
marker_line_points->coords[1] = timebar_height;
marker_line_points->coords[2] = max_canvas_coordinate;
marker_line_points->coords[3] = timebar_height;
// cerr << "set ml2 points, nc = " << marker_line_points->num_points << endl;
marker_line = gnome_canvas_item_new (GNOME_CANVAS_GROUP(marker_group),
gnome_canvas_line_get_type(),
"width_pixels", 0,
"fill_color", "black",
"points", marker_line_points,
NULL);
// cerr << "set rml points, nc = " << marker_line_points->num_points << endl;
range_marker_line = gnome_canvas_item_new (GNOME_CANVAS_GROUP(range_marker_group),
gnome_canvas_line_get_type(),
"width_pixels", 0,
"fill_color", "black",
"points", marker_line_points,
NULL);
// cerr << "set tml2 points, nc = " << marker_line_points->num_points << endl;
transport_marker_line = gnome_canvas_item_new (GNOME_CANVAS_GROUP(transport_marker_group),
gnome_canvas_line_get_type(),
"width_pixels", 0,
"fill_color", "black",
"points", marker_line_points,
NULL);
meter_line = Canvas::Line (*meter_group, *meter_line_points);
meter_line->property_width_pixels() << 0;
meter_line->property_fill_color() << "black";
// cerr << "marker line @ " << marker_line << endl;
marker_line_points = Canvas::Points (2);
marker_line_points[0]->set_x (0);
marker_line_points[0]->set_y (timebar_height);
marker_line_points[1]->set_x (max_canvas_coordinate);
marker_line_points[1]->set_y (timebar_height);
marker_line = new Canvas::Line (*marker_group, *marker_line_points);
marker_line->property_width_pixels() << 0;
marker_line->property_fill_color() << "black";
range_marker_line = new Canvas::Line (*range_marker_group, marker_line_points);
range_marker_line->property_width_pixels() << 0;
range_marker_line->property_fill_color() << "black";
transport_marker_line = new Canvas::Line (*transport_marker_group, marker_line_points);
transport_marker_line->property_width_pixels() << 0;
transport_marker_line->property_fill_color() << "black";
ZoomChanged.connect (bind (mem_fun(*this, &Editor::update_loop_range_view), false));
ZoomChanged.connect (bind (mem_fun(*this, &Editor::update_punch_range_view), false));
@ -1155,8 +987,8 @@ Editor::initialize_canvas ()
edit_cursor = new Cursor (*this, "blue", (GtkSignalFunc) _canvas_edit_cursor_event);
playhead_cursor = new Cursor (*this, "red", (GtkSignalFunc) _canvas_playhead_cursor_event);
track_canvas->size_allocate.connect (mem_fun(*this, &Editor::track_canvas_allocate));
track_canvas.size_allocate.connect (mem_fun(*this, &Editor::track_canvas_allocate));
}
void

View File

@ -197,14 +197,14 @@ class Editor : public PublicEditor
*/
if (pixel >= 0) {
return (jack_nframes_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_gnome_canvas)->pixels_per_unit);
return (jack_nframes_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_gnome_canvas.gobj())->pixels_per_unit);
} else {
return 0;
}
}
gulong frame_to_pixel (jack_nframes_t frame) {
return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_gnome_canvas)->pixels_per_unit)));
return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_gnome_canvas.gobj())->pixels_per_unit)));
}
/* selection */
@ -390,7 +390,7 @@ class Editor : public PublicEditor
void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
void add_new_location (ARDOUR::Location *);
void location_gone (ARDOUR::Location *);
void remove_marker (GnomeCanvasItem*, GdkEvent*);
void remove_marker (Gnome::Canvas::Polygon&, GdkEvent*);
gint really_remove_marker (ARDOUR::Location* loc);
uint32_t location_marker_color;
@ -472,20 +472,18 @@ class Editor : public PublicEditor
GdkCursor *current_canvas_cursor;
GtkWidget *track_gnome_canvas;
GtkWidget *time_gnome_canvas;
Gtk::Widget *track_canvas;
Gtk::Widget *time_canvas;
Gnome::CanvasAA track_canvas;
Gnome::CanvasAA time_canvas;
GnomeCanvasItem* first_action_message;
GnomeCanvasItem *verbose_canvas_cursor;
bool verbose_cursor_visible;
Gnome::Canvas::Text* first_action_message;
Gnome::Canvas::Text* verbose_canvas_cursor;
bool verbose_cursor_visible;
void session_control_changed (ARDOUR::Session::ControlType);
void queue_session_control_changed (ARDOUR::Session::ControlType);
gint track_canvas_motion (GnomeCanvasItem*, GdkEvent*);
gint track_canvas_motion (GdkEvent*);
void set_verbose_canvas_cursor (string, double x, double y);
void set_verbose_canvas_cursor_text (string);
void show_verbose_canvas_cursor();
@ -500,15 +498,15 @@ class Editor : public PublicEditor
Gtk::EventBox track_canvas_event_box;
Gtk::EventBox time_button_event_box;
GnomeCanvasItem *minsec_group;
GnomeCanvasItem *bbt_group;
GnomeCanvasItem *smpte_group;
GnomeCanvasItem *frame_group;
GnomeCanvasItem *tempo_group;
GnomeCanvasItem *meter_group;
GnomeCanvasItem *marker_group;
GnomeCanvasItem *range_marker_group;
GnomeCanvasItem *transport_marker_group;
Gnome::Canvas::Group *minsec_group;
Gnome::Canvas::Group *bbt_group;
Gnome::Canvas::Group *smpte_group;
Gnome::Canvas::Group *frame_group;
Gnome::Canvas::Group *tempo_group;
Gnome::Canvas::Group *meter_group;
Gnome::Canvas::Group *marker_group;
Gnome::Canvas::Group *range_marker_group;
Gnome::Canvas::Group *transport_marker_group;
enum {
ruler_metric_smpte = 0,
@ -568,27 +566,25 @@ class Editor : public PublicEditor
static const double timebar_height;
guint32 visible_timebars;
Gtk::Menu *editor_ruler_menu;
Gnome::Canvas::SimpleRect* tempo_bar;
Gnome::Canvas::SimpleRect* meter_bar;
Gnome::Canvas::SimpleRect* marker_bar;
Gnome::Canvas::SimpleRect* range_marker_bar;
Gnome::Canvas::SimpleRect* transport_marker_bar;
GnomeCanvasItem *tempo_bar;
GnomeCanvasItem *meter_bar;
GnomeCanvasItem *marker_bar;
GnomeCanvasItem *range_marker_bar;
Gnome::Canvas::Line* tempo_line;
Gnome::Canvas::Line* meter_line;
Gnome::Canvas::Line* marker_line;
Gnome::Canvas::Line* range_marker_line;
Gnome::Canvas::Line* transport_marker_line;
GnomeCanvasItem *transport_marker_bar;
GnomeCanvasItem *tempo_line;
GnomeCanvasItem *meter_line;
GnomeCanvasItem *marker_line;
GnomeCanvasItem *range_marker_line;
GnomeCanvasItem *transport_marker_line;
GnomeCanvasPoints *tempo_line_points;
GnomeCanvasPoints *meter_line_points;
GnomeCanvasPoints *marker_line_points;
GnomeCanvasPoints *range_marker_line_points;
GnomeCanvasPoints *transport_marker_line_points;
Gnome::Canvas::Points* tempo_line_points;
Gnome::Canvas::Points* meter_line_points;
Gnome::Canvas::Points* marker_line_points;
Gnome::Canvas::Points* range_marker_line_points;
Gnome::Canvas::Points* transport_marker_line_points;
Gtk::Label minsec_label;
Gtk::Label bbt_label;
@ -606,8 +602,8 @@ class Editor : public PublicEditor
struct Cursor {
Editor& editor;
GnomeCanvasPoints *points;
GnomeCanvasItem *canvas_item;
Gnome::Canvas::Points* points;
Gnome::Canvas::Item* canvas_item;
jack_nframes_t current_frame;
GtkSignalFunc callback;
double length;
@ -626,7 +622,7 @@ class Editor : public PublicEditor
Cursor* playhead_cursor;
Cursor* edit_cursor;
GnomeCanvasItem* cursor_group;
Gnome::Canvas::Group* cursor_group;
void cursor_to_next_region_point (Cursor*, ARDOUR::RegionPoint);
void cursor_to_previous_region_point (Cursor*, ARDOUR::RegionPoint);
@ -1134,43 +1130,42 @@ class Editor : public PublicEditor
void show_verbose_time_cursor (jack_nframes_t frame, double offset = 0, double xpos=-1, double ypos=-1);
void show_verbose_duration_cursor (jack_nframes_t start, jack_nframes_t end, double offset = 0, double xpos=-1, double ypos=-1);
/* static versions of these are public in PublicEditor */
gint _canvas_crossfade_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_fade_in_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_fade_in_handle_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_fade_out_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_fade_out_handle_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_region_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_region_view_name_highlight_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_region_view_name_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_stream_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_automation_track_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_zoom_rect_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_selection_rect_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_selection_start_trim_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_selection_end_trim_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_control_point_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_line_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_tempo_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_meter_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_tempo_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_meter_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_range_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_transport_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint _canvas_imageframe_item_view_event(GnomeCanvasItem *item, GdkEvent* event, gpointer data) ;
gint _canvas_imageframe_view_event(GnomeCanvasItem *item, GdkEvent* event, gpointer data) ;
gint _canvas_imageframe_start_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
gint _canvas_imageframe_end_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
gint _canvas_marker_time_axis_view_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
gint _canvas_markerview_item_view_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
gint _canvas_markerview_start_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
gint _canvas_markerview_end_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
/* Canvas event handlers */
/* now the real things */
gint canvas_crossfade_view_event (GdkEvent* event);
gint canvas_fade_in_event (GdkEvent* event);
gint canvas_fade_in_handle_event (GdkEvent* event);
gint canvas_fade_out_event (GdkEvent* event);
gint canvas_fade_out_handle_event (GdkEvent* event);
gint canvas_region_view_event (GdkEvent* event);
gint canvas_region_view_name_highlight_event (GdkEvent* event);
gint canvas_region_view_name_event (GdkEvent* event);
gint canvas_stream_view_event (GdkEvent* event);
gint canvas_marker_event (GdkEvent* event);
gint canvas_zoom_rect_event (GdkEvent* event);
gint canvas_selection_rect_event (GdkEvent* event);
gint canvas_selection_start_trim_event (GdkEvent* event);
gint canvas_selection_end_trim_event (GdkEvent* event);
gint canvas_control_point_event (GdkEvent* event);
gint canvas_line_event (GdkEvent* event);
gint canvas_tempo_marker_event (GdkEvent* event);
gint canvas_meter_marker_event (GdkEvent* event);
gint canvas_tempo_bar_event (GdkEvent* event);
gint canvas_meter_bar_event (GdkEvent* event);
gint canvas_marker_bar_event (GdkEvent* event);
gint canvas_range_marker_bar_event (GdkEvent* event);
gint canvas_transport_marker_bar_event (GdkEvent* event);
gint canvas_imageframe_item_view_event(GdkEvent* event) ;
gint canvas_imageframe_view_event(GdkEvent* event) ;
gint canvas_imageframe_start_handle_event(GdkEvent* event) ;
gint canvas_imageframe_end_handle_event(GdkEvent* event) ;
gint canvas_marker_time_axis_view_event(GdkEvent* event) ;
gint canvas_markerview_item_view_event(GdkEvent* event) ;
gint canvas_markerview_start_handle_event(GdkEvent* event) ;
gint canvas_markerview_end_handle_event(GdkEvent* event) ;
gint canvas_automation_track_event(GdkEvent* event) ;
#if 0
gint canvas_crossfade_view_event (GnomeCanvasItem* item, GdkEvent* event, CrossfadeView*);
gint canvas_fade_in_event (GnomeCanvasItem* item, GdkEvent* event, AudioRegionView*);
gint canvas_fade_in_handle_event (GnomeCanvasItem* item, GdkEvent* event, AudioRegionView*);
@ -1195,22 +1190,12 @@ class Editor : public PublicEditor
gint canvas_transport_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event);
gint canvas_region_view_name_highlight_event (GnomeCanvasItem* item, GdkEvent* event);
gint canvas_region_view_name_event (GnomeCanvasItem* item, GdkEvent* event);
#endif
/* these are not publically accessible, but we still need the static versions
till we use Gnome::Canvas.
*/
static gint _canvas_copy_region_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint canvas_copy_region_event (GnomeCanvasItem* item, GdkEvent* event);
static gint _canvas_playhead_cursor_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint canvas_playhead_cursor_event (GnomeCanvasItem* item, GdkEvent* event);
static gint _canvas_edit_cursor_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint canvas_edit_cursor_event (GnomeCanvasItem* item, GdkEvent* event);
static gint _track_canvas_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
gint track_canvas_event (GnomeCanvasItem* item, GdkEvent* event);
gint canvas_copy_region_event (GdkEvent* event);
gint canvas_playhead_cursor_event (GdkEvent* event);
gint canvas_edit_cursor_event (GdkEvent* event);
gint track_canvas_event (GdkEvent* event);
gint track_canvas_button_press_event (GdkEventButton *);
gint track_canvas_button_release_event (GdkEventButton *);

View File

@ -13,132 +13,3 @@ PublicEditor::~PublicEditor()
{
}
gint
PublicEditor::canvas_fade_in_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_fade_in_event (item, event, data);
}
gint
PublicEditor::canvas_fade_in_handle_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_fade_in_handle_event (item, event, data);
}
gint
PublicEditor::canvas_fade_out_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_fade_out_event (item, event, data);
}
gint
PublicEditor::canvas_fade_out_handle_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_fade_out_handle_event (item, event, data);
}
gint
PublicEditor::canvas_crossfade_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_crossfade_view_event (item, event, data);
}
gint
PublicEditor::canvas_region_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_region_view_event (item, event, data);
}
gint
PublicEditor::canvas_region_view_name_highlight_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_region_view_name_highlight_event (item, event, data);
}
gint
PublicEditor::canvas_region_view_name_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_region_view_name_event (item, event, data);
}
gint
PublicEditor::canvas_stream_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_stream_view_event (item, event, data);
}
gint
PublicEditor::canvas_automation_track_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_automation_track_event (item, event, data);
}
gint
PublicEditor::canvas_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_marker_event (item, event, data);
}
gint
PublicEditor::canvas_zoom_rect_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_zoom_rect_event (item, event, data);
}
gint
PublicEditor::canvas_selection_rect_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_selection_rect_event (item, event, data);
}
gint
PublicEditor::canvas_selection_start_trim_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_selection_start_trim_event (item, event, data);
}
gint
PublicEditor::canvas_selection_end_trim_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_selection_end_trim_event (item, event, data);
}
gint
PublicEditor::canvas_control_point_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_control_point_event (item, event, data);
}
gint
PublicEditor::canvas_line_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_line_event (item, event, data);
}
gint
PublicEditor::canvas_tempo_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_tempo_marker_event (item, event, data);
}
gint
PublicEditor::canvas_meter_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_meter_marker_event (item, event, data);
}
gint
PublicEditor::canvas_tempo_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_tempo_bar_event (item, event, data);
}
gint
PublicEditor::canvas_meter_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_meter_bar_event (item, event, data);
}
gint
PublicEditor::canvas_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_marker_bar_event (item, event, data);
}
gint
PublicEditor::canvas_range_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_range_marker_bar_event (item, event, data);
}
gint
PublicEditor::canvas_transport_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_transport_marker_bar_event (item, event, data);
}
gint
PublicEditor::canvas_imageframe_item_view_event(GnomeCanvasItem *item, GdkEvent* event, gpointer data) {
return instance()->canvas_imageframe_item_view_event(item, event, data);
}
gint
PublicEditor::canvas_imageframe_view_event(GnomeCanvasItem *item, GdkEvent* event, gpointer data) {
return instance()->canvas_imageframe_view_event(item, event, data);
}
gint
PublicEditor::canvas_imageframe_start_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_imageframe_start_handle_event(item, event, data);
}
gint
PublicEditor::canvas_imageframe_end_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_imageframe_end_handle_event(item, event, data);
}
gint
PublicEditor::canvas_marker_time_axis_view_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_marker_time_axis_view_event(item, event, data);
}
gint
PublicEditor::canvas_markerview_item_view_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_markerview_item_view_event(item, event, data);
}
gint
PublicEditor::canvas_markerview_start_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_markerview_start_handle_event(item, event, data);
}
gint
PublicEditor::canvas_markerview_end_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) {
return instance()->canvas_markerview_end_handle_event(item, event, data);
}

View File

@ -114,72 +114,38 @@ class PublicEditor : public Gtk::Window, public Stateful, public KeyboardTarget
sigc::signal<void> XOriginChanged;
sigc::signal<void> Resized;
static gint canvas_crossfade_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_fade_in_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_fade_in_handle_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_fade_out_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_fade_out_handle_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_region_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_region_view_name_highlight_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_region_view_name_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_stream_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_zoom_rect_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_selection_rect_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_selection_start_trim_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_selection_end_trim_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_control_point_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_line_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_tempo_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_meter_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_tempo_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_meter_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_range_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_transport_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data);
static gint canvas_imageframe_item_view_event(GnomeCanvasItem *item, GdkEvent* event, gpointer data) ;
static gint canvas_imageframe_view_event(GnomeCanvasItem *item, GdkEvent* event, gpointer data) ;
static gint canvas_imageframe_start_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
static gint canvas_imageframe_end_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
static gint canvas_marker_time_axis_view_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
static gint canvas_markerview_item_view_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
static gint canvas_markerview_start_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
static gint canvas_markerview_end_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
static gint canvas_automation_track_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) ;
protected:
virtual gint _canvas_fade_in_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_fade_in_handle_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_fade_out_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_fade_out_handle_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_crossfade_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_region_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_region_view_name_highlight_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_region_view_name_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_stream_view_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_zoom_rect_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_selection_rect_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_selection_start_trim_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_selection_end_trim_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_control_point_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_line_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_tempo_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_meter_marker_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_tempo_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_meter_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_range_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_transport_marker_bar_event (GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_imageframe_item_view_event(GnomeCanvasItem *item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_imageframe_view_event(GnomeCanvasItem *item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_imageframe_start_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_imageframe_end_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_marker_time_axis_view_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_markerview_item_view_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_markerview_start_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_markerview_end_handle_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint _canvas_automation_track_event(GnomeCanvasItem* item, GdkEvent* event, gpointer data) = 0;
virtual gint canvas_crossfade_view_event (GdkEvent* event) = 0;
virtual gint canvas_fade_in_event (GdkEvent* event) = 0;
virtual gint canvas_fade_in_handle_event (GdkEvent* event) = 0;
virtual gint canvas_fade_out_event (GdkEvent* event) = 0;
virtual gint canvas_fade_out_handle_event (GdkEvent* event) = 0;
virtual gint canvas_region_view_event (GdkEvent* event) = 0;
virtual gint canvas_region_view_name_highlight_event (GdkEvent* event) = 0;
virtual gint canvas_region_view_name_event (GdkEvent* event) = 0;
virtual gint canvas_stream_view_event (GdkEvent* event) = 0;
virtual gint canvas_marker_event (GdkEvent* event) = 0;
virtual gint canvas_zoom_rect_event (GdkEvent* event) = 0;
virtual gint canvas_selection_rect_event (GdkEvent* event) = 0;
virtual gint canvas_selection_start_trim_event (GdkEvent* event) = 0;
virtual gint canvas_selection_end_trim_event (GdkEvent* event) = 0;
virtual gint canvas_control_point_event (GdkEvent* event) = 0;
virtual gint canvas_line_event (GdkEvent* event) = 0;
virtual gint canvas_tempo_marker_event (GdkEvent* event) = 0;
virtual gint canvas_meter_marker_event (GdkEvent* event) = 0;
virtual gint canvas_tempo_bar_event (GdkEvent* event) = 0;
virtual gint canvas_meter_bar_event (GdkEvent* event) = 0;
virtual gint canvas_marker_bar_event (GdkEvent* event) = 0;
virtual gint canvas_range_marker_bar_event (GdkEvent* event) = 0;
virtual gint canvas_transport_marker_bar_event (GdkEvent* event) = 0;
virtual gint canvas_imageframe_item_view_event(GdkEvent* event) = 0;
virtual gint canvas_imageframe_view_event(GdkEvent* event) = 0;
virtual gint canvas_imageframe_start_handle_event(GdkEvent* event) = 0;
virtual gint canvas_imageframe_end_handle_event(GdkEvent* event) = 0;
virtual gint canvas_marker_time_axis_view_event(GdkEvent* event) = 0;
virtual gint canvas_markerview_item_view_event(GdkEvent* event) = 0;
virtual gint canvas_markerview_start_handle_event(GdkEvent* event) = 0;
virtual gint canvas_markerview_end_handle_event(GdkEvent* event) = 0;
virtual gint canvas_automation_track_event(GdkEvent* event) = 0;
static PublicEditor* _instance;
};

192
gtk2_ardour/simpleline.cc Normal file
View File

@ -0,0 +1,192 @@
// Generated by gtkmmproc -- DO NOT MODIFY!
#include "simpleline.h"
#include "simpleline_p.h"
/* $Id$ */
/* line.ccg
*
* 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.
*/
//#include <libgnomecanvasmm/group.h>
namespace Gnome
{
namespace Canvas
{
SimpleLine::SimpleLine(Group& parentx)
: Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
{
item_construct(parentx);
}
SimpleLine::SimpleLine(Group& parentx, double x1, double y1, double x2, double y2)
: Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
{
item_construct(parentx);
set ("x1", x1, "y1", y1, "x2", x2, "y2", y2, 0);
}
} /* namespace Canvas */
} /* namespace Gnome */
namespace Glib
{
Gnome::Canvas::SimpleLine* wrap(GnomeCanvasSimpleLine* object, bool take_copy)
{
return dynamic_cast<Gnome::Canvas::SimpleLine *> (Glib::wrap_auto ((GObject*)(object), take_copy));
}
} /* namespace Glib */
namespace Gnome
{
namespace Canvas
{
/* The *_Class implementation: */
const Glib::Class& SimpleLine_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_ = &SimpleLine_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_line_get_type());
// Add derived versions of interfaces, if the C type implements any interfaces:
}
return *this;
}
void SimpleLine_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* SimpleLine_Class::wrap_new(GObject* o)
{
return manage(new SimpleLine((GnomeCanvasSimpleLine*)(o)));
}
/* The implementation: */
SimpleLine::SimpleLine(const Glib::ConstructParams& construct_params)
:
Item(construct_params)
{
}
SimpleLine::SimpleLine(GnomeCanvasSimpleLine* castitem)
:
Item((GnomeCanvasItem*)(castitem))
{
}
SimpleLine::~SimpleLine()
{
destroy_();
}
SimpleLine::CppClassType SimpleLine::line_class_; // initialize static member
GType SimpleLine::get_type()
{
return line_class_.init().get_type();
}
GType SimpleLine::get_base_type()
{
return gnome_canvas_line_get_type();
}
Glib::PropertyProxy<guint> SimpleLine::property_color_rgba()
{
return Glib::PropertyProxy<guint>(this, "color-rgba");
}
Glib::PropertyProxy_ReadOnly<guint> SimpleLine::property_color_rgba() const
{
return Glib::PropertyProxy_ReadOnly<guint>(this, "color-rgba");
}
Glib::PropertyProxy<double> SimpleLine::property_x1()
{
return Glib::PropertyProxy<double>(this, "x1");
}
Glib::PropertyProxy_ReadOnly<double> SimpleLine::property_x1() const
{
return Glib::PropertyProxy_ReadOnly<double>(this, "x1");
}
Glib::PropertyProxy<double> SimpleLine::property_x2()
{
return Glib::PropertyProxy<double>(this, "x2");
}
Glib::PropertyProxy_ReadOnly<double> SimpleLine::property_x2() const
{
return Glib::PropertyProxy_ReadOnly<double>(this, "x2");
}
Glib::PropertyProxy<double> SimpleLine::property_y1()
{
return Glib::PropertyProxy<double>(this, "y1");
}
Glib::PropertyProxy_ReadOnly<double> SimpleLine::property_y1() const
{
return Glib::PropertyProxy_ReadOnly<double>(this, "y1");
}
Glib::PropertyProxy<double> SimpleLine::property_y2()
{
return Glib::PropertyProxy<double>(this, "y2");
}
Glib::PropertyProxy_ReadOnly<double> SimpleLine::property_y2() const
{
return Glib::PropertyProxy_ReadOnly<double>(this, "y2");
}
} // namespace Canvas
} // namespace Gnome

210
gtk2_ardour/simpleline.h Normal file
View File

@ -0,0 +1,210 @@
// -*- c++ -*-
#ifndef _LIBGNOMECANVASMM_SIMPLELINE_H
#define _LIBGNOMECANVASMM_SIMPLELINE_H
#include <glibmm.h>
/* $Id$ */
/* line.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 <libgnomecanvas/gnome-canvas-util.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include <vector>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GnomeCanvasSimpleLine GnomeCanvasSimpleLine;
typedef struct _GnomeCanvasSimpleLineClass GnomeCanvasSimpleLineClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gnome
{
namespace Canvas
{ class SimpleLine_Class; } // namespace Canvas
} // namespace Gnome
namespace Gnome
{
namespace Canvas
{
class GnomeGroup;
class SimpleLine : public Item
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef SimpleLine CppObjectType;
typedef SimpleLine_Class CppClassType;
typedef GnomeCanvasSimpleLine BaseObjectType;
typedef GnomeCanvasSimpleLineClass BaseClassType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
virtual ~SimpleLine();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
friend class SimpleLine_Class;
static CppClassType line_class_;
// noncopyable
SimpleLine(const SimpleLine&);
SimpleLine& operator=(const SimpleLine&);
protected:
explicit SimpleLine(const Glib::ConstructParams& construct_params);
explicit SimpleLine(GnomeCanvasSimpleLine* 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.
GnomeCanvasSimpleLine* gobj() { return reinterpret_cast<GnomeCanvasSimpleLine*>(gobject_); }
///Provides access to the underlying C GtkObject.
const GnomeCanvasSimpleLine* gobj() const { return reinterpret_cast<GnomeCanvasSimpleLine*>(gobject_); }
public:
//C++ methods used to invoke GTK+ virtual functions:
protected:
//GTK+ Virtual Functions (override these to change behaviour):
//Default Signal Handlers::
private:
public:
explicit SimpleLine(Group& parent);
SimpleLine(Group& parent, double x1, double y1, double x2, double y2);
/**
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy<double> property_x1() ;
/**
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly<double> property_x1() const;
/**
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy<double> property_x2() ;
/**
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly<double> property_x2() const;
/**
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy<double> property_y1() ;
/**
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly<double> property_y1() const;
/**
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy<double> property_y2() ;
/**
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly<double> property_y2() const;
/**
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy<guint> property_color_rgba() ;
/**
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly<guint> property_color_rgba() const;
};
} /* namespace Canvas */
} /* namespace Gnome */
namespace Glib
{
/** @relates Gnome::Canvas::SimpleLine
* @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::SimpleLine* wrap(GnomeCanvasSimpleLine* object, bool take_copy = false);
}
#endif /* _LIBGNOMECANVASMM_LINE_H */

View File

@ -0,0 +1,48 @@
// -*- c++ -*-
#ifndef _LIBGNOMECANVASMM_SIMPLELINE_P_H
#define _LIBGNOMECANVASMM_SIMPLELINE_P_H
#include <libgnomecanvasmm/private/item_p.h>
#include <glibmm/class.h>
namespace Gnome
{
namespace Canvas
{
class SimpleLine_Class : public Glib::Class
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef SimpleLine CppObjectType;
typedef GnomeCanvasSimpleLine BaseObjectType;
typedef GnomeCanvasSimpleLineClass BaseClassType;
typedef Item_Class CppClassParent;
typedef GnomeCanvasItemClass BaseClassParent;
friend class SimpleLine;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
const Glib::Class& init();
static void class_init_function(void* g_class, void* class_data);
static Glib::ObjectBase* wrap_new(GObject*);
protected:
//Callbacks (default signal handlers):
//These will call the *_impl member methods, which will then call the existing default signal callbacks, if any.
//You could prevent the original default signal handlers being called by overriding the *_impl method.
//Callbacks (virtual functions):
};
} // namespace Canvas
} // namespace Gnome
#endif /* _LIBGNOMECANVASMM_SIMPLELINE_P_H */

143
gtk2_ardour/simplerect.cc Normal file
View File

@ -0,0 +1,143 @@
// Generated by gtkmmproc -- DO NOT MODIFY!
#include "simplerect.h"
#include "simplerect_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
{
SimpleRect::SimpleRect(Group& parentx, double x1, double y1, double x2, double y2)
: Shape(GNOME_CANVAS_SHAPE(g_object_new(get_type(),0)))
{
item_construct(parentx);
set("x1",x1,"y1",y1,"x2",x2,"y2",y2,0);
}
SimpleRect::SimpleRect(Group& parentx)
: Shape(GNOME_CANVAS_SHAPE(g_object_new(get_type(),0)))
{
item_construct(parentx);
}
} /* namespace Canvas */
} /* namespace Gnome */
namespace
{
} // anonymous namespace
namespace Glib
{
Gnome::Canvas::SimpleRect* wrap(GnomeCanvasRect* object, bool take_copy)
{
return dynamic_cast<Gnome::Canvas::SimpleRect *> (Glib::wrap_auto ((GObject*)(object), take_copy));
}
} /* namespace Glib */
namespace Gnome
{
namespace Canvas
{
/* The *_Class implementation: */
const Glib::Class& SimpleRect_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_ = &Shape_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_simplerect_get_type());
// Add derived versions of interfaces, if the C type implements any interfaces:
}
return *this;
}
void SimpleRect_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* SimpleRect_Class::wrap_new(GObject* o)
{
return manage(new SimpleRect((GnomeCanvasSimpleRect*)(o)));
}
/* The implementation: */
SimpleRect::SimpleRect(const Glib::ConstructParams& construct_params)
: Shape(construct_params)
{
}
SimpleRect::SimpleRect(GnomeCanvasSimpleRect* castitem)
: Shape ((GnomeCanvasShape*)(castitem))
{
}
SimpleRect::~SimpleRect()
{
destroy_();
}
SimpleRect::CppClassType SimpleRect::rect_class_; // initialize static member
GType SimpleRect::get_type()
{
return rect_class_.init().get_type();
}
GType SimpleRect::get_base_type()
{
return gnome_canvas_simplerect_get_type();
}
} // namespace Canvas
} // namespace Gnome

132
gtk2_ardour/simplerect.h Normal file
View File

@ -0,0 +1,132 @@
// -*- c++ -*-
#ifndef _LIBGNOMECANVASMM_SIMPLERECT_H
#define _LIBGNOMECANVASMM_SIMPLERECT_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-simplerect.h"
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GnomeCanvasSimpleRect GnomeCanvasSimpleRect;
typedef struct _GnomeCanvasSimpleRectClass GnomeCanvasSimpleRectClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gnome
{
namespace Canvas
{ class SimpleRect_Class; } // namespace Canvas
} // namespace Gnome
namespace Gnome
{
namespace Canvas
{
//class Group;
class SimpleRect : public Shape
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef SimpleRect CppObjectType;
typedef SimpleRect_Class CppClassType;
typedef GnomeCanvasSimpleRect BaseObjectType;
typedef GnomeCanvasSimpleRectClass BaseClassType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
virtual ~SimpleRect();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
friend class SimpleRect_Class;
static CppClassType rect_class_;
// noncopyable
SimpleRect(const SimpleRect&);
SimpleRect& operator=(const SimpleRect&);
protected:
explicit SimpleRect(const Glib::ConstructParams& construct_params);
explicit SimpleRect(GnomeCanvasSimpleRect* 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.
GnomeCanvasSimpleRect* gobj() { return reinterpret_cast<GnomeCanvasSimpleRect*>(gobject_); }
///Provides access to the underlying C GtkObject.
const GnomeCanvasSimpleRect* gobj() const { return reinterpret_cast<GnomeCanvasSimpleRect*>(gobject_); }
public:
//C++ methods used to invoke GTK+ virtual functions:
protected:
//GTK+ Virtual Functions (override these to change behaviour):
//Default Signal Handlers::
private:
public:
SimpleRect(Group& parent, double x1, double y1, double x2, double y2);
explicit SimpleRect(Group& parent);
};
} /* namespace Canvas */
} /* namespace Gnome */
namespace Glib
{
/** @relates Gnome::Canvas::SimpleRect
* @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::SimpleRect* wrap(GnomeCanvasSimpleRect* object, bool take_copy = false);
}
#endif /* _LIBGNOMECANVASMM_RECT_H */

View File

@ -0,0 +1,47 @@
// -*- c++ -*-
#ifndef _LIBGNOMECANVASMM_SIMPLERECT_P_H
#define _LIBGNOMECANVASMM_SIMPLERECT_P_H
#include <glibmm/class.h>
namespace Gnome
{
namespace Canvas
{
class SimpleRect_Class : public Glib::Class
{
public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef SimpleRect CppObjectType;
typedef GnomeCanvasSimpleRect BaseObjectType;
typedef GnomeCanvasSimpleRectClass BaseClassType;
typedef Shape_Class CppClassParent;
typedef GnomeCanvasItemClass BaseClassParent;
friend class SimpleRect;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
const Glib::Class& init();
static void class_init_function(void* g_class, void* class_data);
static Glib::ObjectBase* wrap_new(GObject*);
protected:
//Callbacks (default signal handlers):
//These will call the *_impl member methods, which will then call the existing default signal callbacks, if any.
//You could prevent the original default signal handlers being called by overriding the *_impl method.
//Callbacks (virtual functions):
};
} // namespace Canvas
} // namespace Gnome
#endif /* _LIBGNOMECANVASMM_SIMPLERECT_P_H */