incomplete changes based on karsten's megapatch

git-svn-id: svn://localhost/trunk/ardour2@81 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2005-11-12 22:07:07 +00:00
parent bc8174cd08
commit 1a3a776077
37 changed files with 477 additions and 493 deletions

View file

@ -73,13 +73,11 @@ automation_pan_line.cc
automation_time_axis.cc automation_time_axis.cc
axis_view.cc axis_view.cc
canvas-imageframe.c canvas-imageframe.c
imageframe.cc
canvas-simpleline.c canvas-simpleline.c
simpleline.cc simpleline.cc
canvas-simplerect.c canvas-simplerect.c
simplerect.cc simplerect.cc
canvas-waveview.c canvas-waveview.c
waveview.cc
crossfade_edit.cc crossfade_edit.cc
crossfade_view.cc crossfade_view.cc
curvetest.cc curvetest.cc

View file

@ -9,7 +9,6 @@ using namespace std;
using namespace Gtk; using namespace Gtk;
using namespace Glib; using namespace Glib;
using namespace sigc; using namespace sigc;
using namespace ActionManager;
vector<Glib::RefPtr<Gtk::Action> > ActionManager::session_sensitive_actions; vector<Glib::RefPtr<Gtk::Action> > ActionManager::session_sensitive_actions;
vector<Glib::RefPtr<Gtk::Action> > ActionManager::region_list_selection_sensitive_actions; vector<Glib::RefPtr<Gtk::Action> > ActionManager::region_list_selection_sensitive_actions;
@ -19,6 +18,8 @@ vector<Glib::RefPtr<Gtk::Action> > ActionManager::plugin_selection_sensitive_act
vector<Glib::RefPtr<Gtk::Action> > ActionManager::range_sensitive_actions; vector<Glib::RefPtr<Gtk::Action> > ActionManager::range_sensitive_actions;
vector<Glib::RefPtr<Gtk::Action> > ActionManager::jack_sensitive_actions; vector<Glib::RefPtr<Gtk::Action> > ActionManager::jack_sensitive_actions;
namespace ActionManager {
static vector<Glib::RefPtr<UIManager> > ui_managers; static vector<Glib::RefPtr<UIManager> > ui_managers;
void void
@ -45,6 +46,17 @@ register_action (RefPtr<ActionGroup> group, string name, string label, slot<void
return act; return act;
} }
RefPtr<Action>
register_action (RefPtr<ActionGroup> group, string name, string label)
{
RefPtr<Action> act;
act = Action::create (name, label);
group->add (act);
return act;
}
RefPtr<Action> RefPtr<Action>
register_radio_action (RefPtr<ActionGroup> group, RadioAction::Group rgroup, string name, string label, slot<void> sl, guint key, Gdk::ModifierType mods) register_radio_action (RefPtr<ActionGroup> group, RadioAction::Group rgroup, string name, string label, slot<void> sl, guint key, Gdk::ModifierType mods)
@ -87,17 +99,6 @@ register_toggle_action (RefPtr<ActionGroup> group, string name, string label, sl
return act; return act;
} }
RefPtr<Action>
register_action (RefPtr<ActionGroup> group, string name, string label)
{
RefPtr<Action> act;
act = Action::create (name, label);
group->add (act);
return act;
}
bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key) bool lookup_entry (const Glib::ustring accel_path, Gtk::AccelKey& key)
{ {
GtkAccelKey gkey; GtkAccelKey gkey;

View file

@ -507,7 +507,7 @@ CrossfadeEditor::Point::move_to (double nx, double ny, double xfract, double yfr
} }
void void
CrossfadeEditor::canvas_allocation (GtkAllocation *alloc) CrossfadeEditor::canvas_allocation (Gtk::Allocation& alloc)
{ {
if (toplevel) { if (toplevel) {
gnome_canvas_item_set (toplevel, gnome_canvas_item_set (toplevel,

View file

@ -135,7 +135,7 @@ class CrossfadeEditor : public ArdourDialog
gint point_event (GnomeCanvasItem*, GdkEvent* event); gint point_event (GnomeCanvasItem*, GdkEvent* event);
gint curve_event (GnomeCanvasItem*, GdkEvent* event); gint curve_event (GnomeCanvasItem*, GdkEvent* event);
void canvas_allocation (GtkAllocation*); void canvas_allocation (Gtk::Allocation&);
void add_control_point (double x, double y); void add_control_point (double x, double y);
Point* make_point (); Point* make_point ();
void redraw (); void redraw ();

View file

@ -890,13 +890,13 @@ Editor::initialize_canvas ()
transport_bar_drag_rect->set_property ("outline_pixels", 0); transport_bar_drag_rect->set_property ("outline_pixels", 0);
transport_bar_drag_rect->hide (); transport_bar_drag_rect->hide ();
marker_drag_line_points->push_back(Gnome::Art::Point(0.0, 0.0)); marker_drag_line_points.push_back(Gnome::Art::Point(0.0, 0.0));
marker_drag_line_points->push_back(Gnome::Art::Point(0.0, 0.0)); marker_drag_line_points.push_back(Gnome::Art::Point(0.0, 0.0));
marker_drag_line = new Gnome::Canvas::Line (*track_canvas.root()); marker_drag_line = new Gnome::Canvas::Line (*track_canvas.root());
marker_drag_line->set_property ("width_pixels", 1); marker_drag_line->set_property ("width_pixels", 1);
marker_drag_line->set_property("fill_color_rgba", color_map[cMarkerDragLine]); marker_drag_line->set_property("fill_color_rgba", color_map[cMarkerDragLine]);
marker_drag_line->set_property("points", marker_drag_line_points); marker_drag_line->set_property("points", marker_drag_line_points.gobj());
marker_drag_line->hide(); marker_drag_line->hide();
range_marker_drag_rect = new Gnome::Canvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0); range_marker_drag_rect = new Gnome::Canvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
@ -935,7 +935,7 @@ Editor::initialize_canvas ()
zoom_rect->set_property ("outline_pixels", 1); zoom_rect->set_property ("outline_pixels", 1);
zoom_rect->hide(); zoom_rect->hide();
zoom_rect->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_zoom_rect_event)); zoom_rect->signal_event().connect (mem_fun (*this, &Editor::canvas_zoom_rect_event));
// used as rubberband rect // used as rubberband rect
rubberband_rect = new Gnome::Canvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0); rubberband_rect = new Gnome::Canvas::SimpleRect (*track_canvas.root(), 0.0, 0.0, 0.0, 0.0);
@ -944,30 +944,30 @@ Editor::initialize_canvas ()
rubberband_rect->set_property ("outline_pixels", 1); rubberband_rect->set_property ("outline_pixels", 1);
rubberband_rect->hide(); rubberband_rect->hide();
tempo_bar->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_tempo_bar_event)); tempo_bar->signal_event().connect (mem_fun (*this, &Editor::canvas_tempo_bar_event));
meter_bar->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_meter_bar_event)); meter_bar->signal_event().connect (mem_fun (*this, &Editor::canvas_meter_bar_event));
marker_bar->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_marker_bar_event)); marker_bar->signal_event().connect (mem_fun (*this, &Editor::canvas_marker_bar_event));
range_marker_bar->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_range_marker_bar_event)); range_marker_bar->signal_event().connect (mem_fun (*this, &Editor::canvas_range_marker_bar_event));
transport_marker_bar->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_transport_marker_bar_event)); transport_marker_bar->signal_event().connect (mem_fun (*this, &Editor::canvas_transport_marker_bar_event));
/* separator lines */ /* separator lines */
tempo_line_points->push_back(Gnome::Art::Point(0, timebar_height)); tempo_line_points.push_back(Gnome::Art::Point(0, timebar_height));
tempo_line_points->push_back(Gnome::Art::Point(max_canvas_coordinate, timebar_height)); tempo_line_points.push_back(Gnome::Art::Point(max_canvas_coordinate, timebar_height));
tempo_line = new Gnome::Canvas::Line (*tempo_group, *tempo_line_points); tempo_line = new Gnome::Canvas::Line (*tempo_group, *tempo_line_points);
tempo_line->set_property ("width_pixels", 0); tempo_line->set_property ("width_pixels", 0);
tempo_line->set_property ("fill_color", "#000000"); tempo_line->set_property ("fill_color", "#000000");
meter_line_points->push_back(Gnome::Art::Point (0, timebar_height)); meter_line_points.push_back(Gnome::Art::Point (0, timebar_height));
meter_line_points->push_back(Gnome::Art::Point(max_canvas_coordinate, timebar_height)); meter_line_points.push_back(Gnome::Art::Point(max_canvas_coordinate, timebar_height));
meter_line = new Gnome::Canvas::Line (*meter_group, *meter_line_points); meter_line = new Gnome::Canvas::Line (*meter_group, *meter_line_points);
meter_line->set_property ("width_pixels", 0); meter_line->set_property ("width_pixels", 0);
meter_line->set_property ("fill_color", "#000000"); meter_line->set_property ("fill_color", "#000000");
marker_line_points->push_back(Gnome::Art::Point (0, timebar_height)); marker_line_points.push_back(Gnome::Art::Point (0, timebar_height));
marker_line_points->push_back(Gnome::Art::Point(max_canvas_coordinate, timebar_height)); marker_line_points.push_back(Gnome::Art::Point(max_canvas_coordinate, timebar_height));
marker_line = new Gnome::Canvas::Line (*marker_group, *marker_line_points); marker_line = new Gnome::Canvas::Line (*marker_group, *marker_line_points);
marker_line->set_property ("width_pixels", 0); marker_line->set_property ("width_pixels", 0);
@ -988,8 +988,8 @@ Editor::initialize_canvas ()
double time_width = FLT_MAX/frames_per_unit; double time_width = FLT_MAX/frames_per_unit;
time_canvas.set_scroll_region(0.0, 0.0, time_width, time_height); time_canvas.set_scroll_region(0.0, 0.0, time_width, time_height);
edit_cursor = new Cursor (*this, "blue", (GtkSignalFunc) _canvas_edit_cursor_event); edit_cursor = new Cursor (*this, "blue", canvas_edit_cursor_event);
playhead_cursor = new Cursor (*this, "red", (GtkSignalFunc) _canvas_playhead_cursor_event); playhead_cursor = new Cursor (*this, "red", canvas_playhead_cursor_event);
track_canvas.signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate)); track_canvas.signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate));
} }
@ -1342,26 +1342,29 @@ Editor::reset_scrolling_region (GtkAllocation *alloc)
if (playhead_cursor) playhead_cursor->set_length (canvas_alloc_height); if (playhead_cursor) playhead_cursor->set_length (canvas_alloc_height);
if (marker_drag_line) { if (marker_drag_line) {
marker_drag_line_points->coords[3] = canvas_height; marker_drag_line_points[1].set_y (canvas_height);
// cerr << "set mlA points, nc = " << marker_drag_line_points->num_points << endl; marker_drag_line->set_property("points", marker_drag_line_points.gobj());
marker_drag_line->set_property("points", marker_drag_line_points);
} }
if (range_marker_drag_rect) { if (range_marker_drag_rect) {
range_marker_drag_rect->set_property("y1", 0.0); range_marker_drag_rect->set_property("y1", 0.0);
range_marker_drag_rect->set_property("y2", (double) canvas_height); range_marker_drag_rect->set_property("y2", (double) canvas_height);
} }
if (transport_loop_range_rect) { if (transport_loop_range_rect) {
transport_loop_range_rect->set_property("y1", 0.0); transport_loop_range_rect->set_property("y1", 0.0);
transport_loop_range_rect->set_property("y2", (double) canvas_height); transport_loop_range_rect->set_property("y2", (double) canvas_height);
} }
if (transport_punch_range_rect) { if (transport_punch_range_rect) {
transport_punch_range_rect->set_property("y1", 0.0); transport_punch_range_rect->set_property("y1", 0.0);
transport_punch_range_rect->set_property("y2", (double) canvas_height); transport_punch_range_rect->set_property("y2", (double) canvas_height);
} }
if (transport_punchin_line) { if (transport_punchin_line) {
transport_punchin_line->set_property("y1", 0.0); transport_punchin_line->set_property("y1", 0.0);
transport_punchin_line->set_property("y2", (double) canvas_height); transport_punchin_line->set_property("y2", (double) canvas_height);
} }
if (transport_punchout_line) { if (transport_punchout_line) {
transport_punchout_line->set_property("y1", 0.0); transport_punchout_line->set_property("y1", 0.0);
transport_punchout_line->set_property("y2", (double) canvas_height); transport_punchout_line->set_property("y2", (double) canvas_height);
@ -1644,7 +1647,8 @@ Editor::connect_to_session (Session *t)
route_display_model.clear (); route_display_model.clear ();
session->foreach_route (this, &Editor::handle_new_route); session->foreach_route (this, &Editor::handle_new_route);
// route_list.select_all (); // route_list.select_all ();
route_list.sort (); // GTK2FIX
//route_list.sort ();
route_list_reordered (); route_list_reordered ();
//route_list.thaw (); //route_list.thaw ();
@ -1709,47 +1713,52 @@ Editor::connect_to_session (Session *t)
void void
Editor::build_cursors () Editor::build_cursors ()
{ {
Glib::RefPtr <Gdk::Pixmap> source, mask;
Gdk::Color fg ("#ff0000"); /* Red. */ Gdk::Color fg ("#ff0000"); /* Red. */
Gdk::Color bg ("#0000ff"); /* Blue. */ Gdk::Color bg ("#0000ff"); /* Blue. */
Gdk::Pixmap::create_from_data (source, hand_bits, {
Glib::RefPtr <Gdk::Pixmap> source, mask;
source = Gdk::Pixmap::create_from_data (source, hand_bits,
hand_width, hand_height, 1, fg, bg); hand_width, hand_height, 1, fg, bg);
Gdk::Pixmap::create_from_data(mask, handmask_bits, Gdk::Pixmap::create_from_data(mask, handmask_bits,
handmask_width, handmask_height, 1, fg, bg); handmask_width, handmask_height, 1, fg, bg);
grabber_cursor = new Gdk::Cursor (source, mask, fg, bg, hand_x_hot, hand_y_hot); grabber_cursor = new Gdk::Cursor (source, mask, fg, bg, hand_x_hot, hand_y_hot);
source->unreference(); }
mask->unreference();
Gdk::Color mbg ("#000000" ); /* Black */ Gdk::Color mbg ("#000000" ); /* Black */
Gdk::Color mfg ("#0000ff" ); /* Blue. */ Gdk::Color mfg ("#0000ff" ); /* Blue. */
{
Glib::RefPtr <Gdk::Pixmap> source, mask;
Gdk::Pixmap::create_from_data (source, mag_bits, Gdk::Pixmap::create_from_data (source, mag_bits,
mag_width, mag_height, 1, fg, bg); mag_width, mag_height, 1, fg, bg);
Gdk::Pixmap::create_from_data (mask, magmask_bits, Gdk::Pixmap::create_from_data (mask, magmask_bits,
mag_width, mag_height, 1, fg, bg); mag_width, mag_height, 1, fg, bg);
zoom_cursor = new Gdk::Cursor (source, mask, mfg, mbg, mag_x_hot, mag_y_hot); zoom_cursor = new Gdk::Cursor (source, mask, mfg, mbg, mag_x_hot, mag_y_hot);
source->unreference(); }
mask->unreference();
Gdk::Color fbg ("#ffffff" ); Gdk::Color fbg ("#ffffff" );
Gdk::Color ffg ("#000000" ); Gdk::Color ffg ("#000000" );
{
Glib::RefPtr <Gdk::Pixmap> source, mask;
Gdk::Pixmap::create_from_data (source, fader_cursor_bits, Gdk::Pixmap::create_from_data (source, fader_cursor_bits,
fader_cursor_width, fader_cursor_height, 1, fg, bg); fader_cursor_width, fader_cursor_height, 1, fg, bg);
Gdk::Pixmap::create_from_data (mask, fader_cursor_mask_bits, Gdk::Pixmap::create_from_data (mask, fader_cursor_mask_bits,
fader_cursor_width, fader_cursor_height, 1, fg, bg); fader_cursor_width, fader_cursor_height, 1, fg, bg);
fader_cursor = new Gdk::Cursor (source, mask, ffg, fbg, fader_cursor_x_hot, fader_cursor_y_hot); fader_cursor = new Gdk::Cursor (source, mask, ffg, fbg, fader_cursor_x_hot, fader_cursor_y_hot);
source->unreference(); }
mask->unreference();
{
Glib::RefPtr <Gdk::Pixmap> source, mask;
Gdk::Pixmap::create_from_data (source,speaker_cursor_bits, Gdk::Pixmap::create_from_data (source,speaker_cursor_bits,
speaker_cursor_width, speaker_cursor_height, 1, fg, bg); speaker_cursor_width, speaker_cursor_height, 1, fg, bg);
Gdk::Pixmap::create_from_data (mask, speaker_cursor_mask_bits, Gdk::Pixmap::create_from_data (mask, speaker_cursor_mask_bits,
speaker_cursor_width, speaker_cursor_height, 1, fg, bg); speaker_cursor_width, speaker_cursor_height, 1, fg, bg);
speaker_cursor = new Gdk::Cursor (source, mask, ffg, fbg, speaker_cursor_x_hot, speaker_cursor_y_hot); speaker_cursor = new Gdk::Cursor (source, mask, ffg, fbg, speaker_cursor_x_hot, speaker_cursor_y_hot);
source->unreference(); }
mask->unreference();
cross_hair_cursor = new Gdk::Cursor (Gdk::CROSSHAIR); cross_hair_cursor = new Gdk::Cursor (Gdk::CROSSHAIR);
trimmer_cursor = new Gdk::Cursor (Gdk::SB_H_DOUBLE_ARROW); trimmer_cursor = new Gdk::Cursor (Gdk::SB_H_DOUBLE_ARROW);
@ -2489,7 +2498,8 @@ Editor::set_state (const XMLNode& node)
} }
set_default_size(width, height); set_default_size(width, height);
set_position(x, y-yoff); // GTK2FIX
// set_position(x, y-yoff);
if ((prop = node.property ("zoom-focus"))) { if ((prop = node.property ("zoom-focus"))) {
set_zoom_focus ((ZoomFocus) atoi (prop->value())); set_zoom_focus ((ZoomFocus) atoi (prop->value()));
@ -2882,9 +2892,9 @@ Editor::setup_toolbar ()
mouse_mode_tearoff->set_name ("MouseModeBase"); mouse_mode_tearoff->set_name ("MouseModeBase");
mouse_mode_tearoff->Detach.connect (bind (mem_fun(*this, &Editor::detach_tearoff), static_cast<Gtk::Box*>(&toolbar_hbox), mouse_mode_tearoff->Detach.connect (bind (mem_fun(*this, &Editor::detach_tearoff), static_cast<Gtk::Box*>(&toolbar_hbox),
static_cast<Gtk::Widget*>(&mouse_mode_button_table))); mouse_mode_tearoff->tearoff_window()));
mouse_mode_tearoff->Attach.connect (bind (mem_fun(*this, &Editor::reattach_tearoff), static_cast<Gtk::Box*> (&toolbar_hbox), mouse_mode_tearoff->Attach.connect (bind (mem_fun(*this, &Editor::reattach_tearoff), static_cast<Gtk::Box*> (&toolbar_hbox),
static_cast<Gtk::Widget*> (&mouse_mode_button_table), 1)); mmouse_mode_tearoff->tearoff_window(), 1));
mouse_move_button.set_name ("MouseModeButton"); mouse_move_button.set_name ("MouseModeButton");
mouse_select_button.set_name ("MouseModeButton"); mouse_select_button.set_name ("MouseModeButton");
@ -3070,9 +3080,10 @@ Editor::setup_toolbar ()
tools_tearoff->set_name ("MouseModeBase"); tools_tearoff->set_name ("MouseModeBase");
tools_tearoff->Detach.connect (bind (mem_fun(*this, &Editor::detach_tearoff), static_cast<Gtk::Box*>(&toolbar_hbox), tools_tearoff->Detach.connect (bind (mem_fun(*this, &Editor::detach_tearoff), static_cast<Gtk::Box*>(&toolbar_hbox),
static_cast<Gtk::Widget*>(hbox))); tools_tearoff->tearoff_window());
tools_tearoff->Attach.connect (bind (mem_fun(*this, &Editor::reattach_tearoff), static_cast<Gtk::Box*> (&toolbar_hbox), tools_tearoff->Attach.connect (bind (mem_fun(*this, &Editor::reattach_tearoff), static_cast<Gtk::Box*> (&toolbar_hbox),
static_cast<Gtk::Widget*> (hbox), 0)); tools_tearoff->tearoff_window(), 0));
toolbar_hbox.set_spacing (8); toolbar_hbox.set_spacing (8);
toolbar_hbox.set_border_width (2); toolbar_hbox.set_border_width (2);
@ -3668,7 +3679,7 @@ void
Editor::set_edit_menu (Menu& menu) Editor::set_edit_menu (Menu& menu)
{ {
edit_menu = &menu; edit_menu = &menu;
edit_menu->map_.connect (mem_fun(*this, &Editor::edit_menu_map_handler)); edit_menu->signal_map.connect (mem_fun(*this, &Editor::edit_menu_map_handler));
} }
void void
@ -3808,8 +3819,9 @@ Editor::duplicate_dialog (bool dup_region)
entry.select_region (0, entry.get_text_length()); entry.select_region (0, entry.get_text_length());
win.set_position (Gtk::WIN_POS_MOUSE); win.set_position (Gtk::WIN_POS_MOUSE);
win.realize (); // GTK2FIX
win.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)); // win.realize ();
// win.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
entry.grab_focus (); entry.grab_focus ();
@ -4151,7 +4163,7 @@ Editor::ensure_float (Window& win)
} }
void void
Editor::pane_allocation_handler (GtkAllocation *alloc, Gtk::Paned* which) Editor::pane_allocation_handler (Gtk::Allocation &alloc, Gtk::Paned* which)
{ {
/* recover or initialize pane positions. do this here rather than earlier because /* recover or initialize pane positions. do this here rather than earlier because
we don't want the positions to change the child allocations, which they seem to do. we don't want the positions to change the child allocations, which they seem to do.
@ -4244,18 +4256,18 @@ Editor::pane_allocation_handler (GtkAllocation *alloc, Gtk::Paned* which)
} }
void void
Editor::detach_tearoff (Gtk::Box* b, Gtk::Widget* w) Editor::detach_tearoff (Gtk::Box* b, Gtk::Window* w)
{ {
if (tools_tearoff->torn_off() && if (tools_tearoff->torn_off() &&
mouse_mode_tearoff->torn_off()) { mouse_mode_tearoff->torn_off()) {
top_hbox.remove (toolbar_frame); top_hbox.remove (toolbar_frame);
} }
ensure_float (*w->get_toplevel()); ensure_float (*w);
} }
void void
Editor::reattach_tearoff (Gtk::Box* b, Gtk::Widget* w, int32_t n) Editor::reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n)
{ {
if (toolbar_frame.get_parent() == 0) { if (toolbar_frame.get_parent() == 0) {
top_hbox.pack_end (toolbar_frame); top_hbox.pack_end (toolbar_frame);
@ -4310,7 +4322,8 @@ Editor::edit_xfade (Crossfade* xfade)
cew.ok_button.signal_clicked().connect (bind (mem_fun (cew, &ArdourDialog::stop), 1)); cew.ok_button.signal_clicked().connect (bind (mem_fun (cew, &ArdourDialog::stop), 1));
cew.cancel_button.signal_clicked().connect (bind (mem_fun (cew, &ArdourDialog::stop), 0)); cew.cancel_button.signal_clicked().connect (bind (mem_fun (cew, &ArdourDialog::stop), 0));
cew.signal_delete_event().connect (mem_fun (cew, &ArdourDialog::wm_doi_event_stop)); // GTK2FIX
// cew.signal_delete_event().connect (mem_fun (cew, &ArdourDialog::wm_doi_event_stop));
cew.run (); cew.run ();
@ -4377,8 +4390,9 @@ Editor::playlist_deletion_dialog (Playlist* pl)
keep_button.signal_clicked().connect (bind (mem_fun (dialog, &ArdourDialog::stop), 1)); keep_button.signal_clicked().connect (bind (mem_fun (dialog, &ArdourDialog::stop), 1));
abort_button.signal_clicked().connect (bind (mem_fun (dialog, &ArdourDialog::stop), 2)); abort_button.signal_clicked().connect (bind (mem_fun (dialog, &ArdourDialog::stop), 2));
dialog.realize (); // GTK2FIX
dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)); // dialog.realize ();
// dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
dialog.run (); dialog.run ();

View file

@ -34,9 +34,6 @@
#include <gtkmm/layout.h> #include <gtkmm/layout.h>
#include <gtkmm/comboboxtext.h> #include <gtkmm/comboboxtext.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include <libgnomecanvas/gnome-canvas-util.h>
#include <libgnomecanvasmm/canvas.h> #include <libgnomecanvasmm/canvas.h>
#include <libgnomecanvasmm/polygon.h> #include <libgnomecanvasmm/polygon.h>
#include <libgnomecanvasmm/text.h> #include <libgnomecanvasmm/text.h>
@ -379,7 +376,7 @@ class Editor : public PublicEditor
Editing::MouseMode mouse_mode; Editing::MouseMode mouse_mode;
void mouse_insert (GdkEventButton *); void mouse_insert (GdkEventButton *);
void pane_allocation_handler (GtkAllocation*, Gtk::Paned*); void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
Gtk::HPaned canvas_region_list_pane; Gtk::HPaned canvas_region_list_pane;
Gtk::HPaned track_list_canvas_pane; Gtk::HPaned track_list_canvas_pane;
@ -587,11 +584,11 @@ class Editor : public PublicEditor
Gnome::Canvas::Line* range_marker_line; Gnome::Canvas::Line* range_marker_line;
Gnome::Canvas::Line* transport_marker_line; Gnome::Canvas::Line* transport_marker_line;
Gnome::Canvas::Points* tempo_line_points; Gnome::Canvas::Points tempo_line_points;
Gnome::Canvas::Points* meter_line_points; Gnome::Canvas::Points meter_line_points;
Gnome::Canvas::Points* marker_line_points; Gnome::Canvas::Points marker_line_points;
Gnome::Canvas::Points* range_marker_line_points; Gnome::Canvas::Points range_marker_line_points;
Gnome::Canvas::Points* transport_marker_line_points; Gnome::Canvas::Points transport_marker_line_points;
Gtk::Label minsec_label; Gtk::Label minsec_label;
Gtk::Label bbt_label; Gtk::Label bbt_label;
@ -609,13 +606,12 @@ class Editor : public PublicEditor
struct Cursor { struct Cursor {
Editor& editor; Editor& editor;
Gnome::Canvas::Points* points; Gnome::Canvas::Points points;
Gnome::Canvas::Item* canvas_item; Gnome::Canvas::Item* canvas_item;
jack_nframes_t current_frame; jack_nframes_t current_frame;
GtkSignalFunc callback;
double length; double length;
Cursor (Editor&, const string& color, GtkSignalFunc callback); Cursor (Editor&, const string& color, bool (Editor::*)(GdkEvent*));
~Cursor (); ~Cursor ();
void set_position (jack_nframes_t); void set_position (jack_nframes_t);
@ -670,7 +666,7 @@ class Editor : public PublicEditor
bool edit_hscroll_dragging; bool edit_hscroll_dragging;
double edit_hscroll_drag_last; double edit_hscroll_drag_last;
void hscroll_slider_allocate (GtkAllocation *); void hscroll_slider_allocate (Gtk::Allocation &);
gint hscroll_slider_expose (GdkEventExpose*); gint hscroll_slider_expose (GdkEventExpose*);
gint hscroll_slider_button_press (GdkEventButton*); gint hscroll_slider_button_press (GdkEventButton*);
gint hscroll_slider_button_release (GdkEventButton*); gint hscroll_slider_button_release (GdkEventButton*);
@ -1454,11 +1450,11 @@ class Editor : public PublicEditor
void end_range_markerbar_op (GnomeCanvasItem* item, GdkEvent* event); void end_range_markerbar_op (GnomeCanvasItem* item, GdkEvent* event);
Gnome::Canvas::Item *range_bar_drag_rect; Gnome::Canvas::Item* range_bar_drag_rect;
Gnome::Canvas::Item *transport_bar_drag_rect; Gnome::Canvas::Item* transport_bar_drag_rect;
Gnome::Canvas::Item *marker_drag_line; Gnome::Canvas::Item* marker_drag_line;
Gnome::Canvas::Points *marker_drag_line_points; Gnome::Canvas::Points marker_drag_line_points;
Gnome::Canvas::Item *range_marker_drag_rect; Gnome::Canvas::Item* range_marker_drag_rect;
void update_marker_drag_item (ARDOUR::Location *); void update_marker_drag_item (ARDOUR::Location *);
@ -1749,8 +1745,8 @@ class Editor : public PublicEditor
void current_mixer_strip_hidden (); void current_mixer_strip_hidden ();
void current_mixer_strip_removed (); void current_mixer_strip_removed ();
void detach_tearoff (Gtk::Box* b, Gtk::Widget* w); void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
void reattach_tearoff (Gtk::Box* b, Gtk::Widget* w, int32_t n); void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
/* nudging tracks */ /* nudging tracks */

View file

@ -3,6 +3,7 @@
#include "utils.h" #include "utils.h"
#include "editor.h" #include "editor.h"
#include "editing.h" #include "editing.h"
#include "actions.h"
#include "i18n.h" #include "i18n.h"

View file

@ -317,10 +317,8 @@ gint
Editor::track_canvas_motion (GnomeCanvasItem *item, GdkEvent *ev) Editor::track_canvas_motion (GnomeCanvasItem *item, GdkEvent *ev)
{ {
if (verbose_cursor_visible) { if (verbose_cursor_visible) {
gnome_canvas_item_set (verbose_canvas_cursor, verbose_canvas_cursor->set_property ("x", ev->motion.x + 20);
"x", ev->motion.x + 20, verbose_canvas_cursor->set_property ("y", ev->motion.y + 20);
"y", ev->motion.y + 20,
NULL);
} }
return FALSE; return FALSE;
} }

View file

@ -30,38 +30,26 @@ using namespace sigc;
using namespace ARDOUR; using namespace ARDOUR;
using namespace Gtk; using namespace Gtk;
Editor::Cursor::Cursor (Editor& ed, const string& color, GtkSignalFunc callbck) Editor::Cursor::Cursor (Editor& ed, const string& color, bool (Editor::*callbck)(GdkEvent*))
: editor (ed), callback (callbck), length(1.0) : editor (ed), length(1.0)
{ {
GnomeCanvasGroup *group;
points = gnome_canvas_points_new (2);
/* "randomly" initialize coords */ /* "randomly" initialize coords */
points->coords[0] = -9383839.0; points.push_back (Gnome::Art::Point (-9383839.0, 0.0));
points->coords[1] = 0.0; points.push_back (Gnome::Art::Point (1.0, 0.0));
points->coords[2] = 1.0;
points->coords[3] = 0.0;
group = GNOME_CANVAS_GROUP (editor.cursor_group); canvas_item = new Gnome::Canvas::Line (editor.cursor_group);
canvas_item->set_property ("points", points.gobj());
canvas_item->set_property ("fill_color", color.c_str());
canvas_item->set_property ("width_pixels", 1);
canvas_item->set_property ("first_arrowhead", (gboolean) TRUE);
canvas_item->set_property ("last_arrowhead", (gboolean) TRUE);
canvas_item->set_property ("arrow_shape_a", 11.0);
canvas_item->set_property ("arrow_shape_b", 0.0);
canvas_item->set_property ("arrow_shape_c", 9.0);
// cerr << "set cursor points, nc = " << points->num_points << endl; canvas_item->set_data ("cursor", this);
canvas_item = gnome_canvas_item_new (group, canvas_item->signal_event().connect (slot (ed, callback));
gnome_canvas_line_get_type(),
"points", points,
"fill_color", color.c_str(),
"width_pixels", 1,
"first_arrowhead", (gboolean) TRUE,
"last_arrowhead", (gboolean) TRUE,
"arrow_shape_a", 11.0,
"arrow_shape_b", 0.0,
"arrow_shape_c", 9.0,
NULL);
// cerr << "cursor line @ " << canvas_item << endl;
gtk_object_set_data (GTK_OBJECT(canvas_item), "cursor", this);
gtk_signal_connect (GTK_OBJECT(canvas_item), "event", callback, &editor);
current_frame = 1; /* force redraw at 0 */ current_frame = 1; /* force redraw at 0 */
} }

View file

@ -181,7 +181,7 @@ Editor::edit_group_selection_changed ()
} else { } else {
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) { for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
if ((*j)->edit_group() == group) { if ((*j)->edit_group() == group) {
unselect_strip_in_display (*j); unselect_strip_in_display (**j);
} }
} }
} }

View file

@ -26,7 +26,7 @@ using namespace std;
using namespace ARDOUR; using namespace ARDOUR;
void void
Editor::hscroll_slider_allocate (GtkAllocation *alloc) Editor::hscroll_slider_allocate (Gtk::Allocation &alloc)
{ {
//edit_hscroll_slider_width = alloc->width; //edit_hscroll_slider_width = alloc->width;
//edit_hscroll_slider_height = alloc->height ; //edit_hscroll_slider_height = alloc->height ;

View file

@ -494,10 +494,10 @@ Editor::start_imageframe_grab(GnomeCanvasItem* item, GdkEvent* event)
so move them to the top afterwards. so move them to the top afterwards.
*/ */
gnome_canvas_item_raise_to_top(drag_info.item) ; drag_info.item->raise_to_top();
gnome_canvas_item_raise_to_top(drag_info.last_trackview->canvas_display) ; drag_info.last_trackview->canvas_display->raise_to_top();
//gnome_canvas_item_raise_to_top(time_line_group) ; //time_line_group->raise_to_top();
gnome_canvas_item_raise_to_top (cursor_group); cursor_group->raise_to_top ();
start_grab(event) ; start_grab(event) ;
@ -527,10 +527,10 @@ Editor::start_markerview_grab(GnomeCanvasItem* item, GdkEvent* event)
so move them to the top afterwards. so move them to the top afterwards.
*/ */
gnome_canvas_item_raise_to_top(drag_info.item) ; drag_info.item->raise_to_top();
gnome_canvas_item_raise_to_top(drag_info.last_trackview->canvas_display) ; drag_info.last_trackview->canvas_display->raise_to_top();
//gnome_canvas_item_raise_to_top(time_line_group) ; //time_line_group->raise_to_top();
gnome_canvas_item_raise_to_top (cursor_group); cursor_group->raise_to_top ();
start_grab(event) ; start_grab(event) ;
@ -1152,11 +1152,13 @@ Editor::handle_new_imageframe_time_axis_view(std::string track_name, void* src)
iftav = new ImageFrameTimeAxis(track_name, *this, *session, track_canvas) ; iftav = new ImageFrameTimeAxis(track_name, *this, *session, track_canvas) ;
iftav->set_time_axis_name(track_name, this) ; iftav->set_time_axis_name(track_name, this) ;
track_views.push_back(iftav) ; track_views.push_back(iftav) ;
const gchar *rowdata[1] ;
rowdata[0] = iftav->name().c_str() ; TreeModel::Row row = *(route_display_mode->append());
route_list.rows().push_back(rowdata) ;
route_list.rows().back().set_data(iftav) ; row[route_display_columns.text] = iftav->name();
route_list.rows().back().select() ; row[route_display_columns.tv] = iftav;
route_list.get_selection()->select (row);
iftav->GoingAway.connect(bind(mem_fun(*this, &Editor::remove_route), (TimeAxisView*)iftav)) ; iftav->GoingAway.connect(bind(mem_fun(*this, &Editor::remove_route), (TimeAxisView*)iftav)) ;
iftav->gui_changed.connect(mem_fun(*this, &Editor::handle_gui_changes)) ; iftav->gui_changed.connect(mem_fun(*this, &Editor::handle_gui_changes)) ;
} }
@ -1167,11 +1169,13 @@ Editor::handle_new_imageframe_marker_time_axis_view(std::string track_name, Time
MarkerTimeAxis* mta = new MarkerTimeAxis (*this, *this->current_session(), track_canvas, track_name, marked_track) ; MarkerTimeAxis* mta = new MarkerTimeAxis (*this, *this->current_session(), track_canvas, track_name, marked_track) ;
((ImageFrameTimeAxis*)marked_track)->add_marker_time_axis(mta, this) ; ((ImageFrameTimeAxis*)marked_track)->add_marker_time_axis(mta, this) ;
track_views.push_back(mta) ; track_views.push_back(mta) ;
const gchar *rowdata[1] ;
rowdata[0] = mta->name().c_str() ; TreeModel::Row row = *(route_display_mode->append());
route_list.rows().push_back(rowdata) ;
route_list.rows().back().set_data (mta) ; row[route_display_columns.text] = mta->name();
route_list.rows().back().select() ; row[route_display_columns.tv] = mta;
route_list.get_selection()->select (row);
mta->GoingAway.connect(bind(mem_fun(*this, &Editor::remove_route), (TimeAxisView*)mta)) ; mta->GoingAway.connect(bind(mem_fun(*this, &Editor::remove_route), (TimeAxisView*)mta)) ;
} }

View file

@ -31,15 +31,15 @@ Editor::kbd_driver (sigc::slot<void,GdkEvent*> theslot, bool use_track_canvas, b
double dx, dy; double dx, dy;
GdkEvent ev; GdkEvent ev;
GdkModifierType mask; GdkModifierType mask;
GdkWindow evw (track_canvas.get_window()->get_pointer (x, y, mask));
bool doit = false; bool doit = false;
if (use_track_canvas && gdk_window_get_pointer (track_canvas_event_box.get_window()->gobj(), /* get the pointer location */
&x, &y, &mask)) {
doit = true;
} else if (use_time_canvas && gdk_window_get_pointer (time_canvas_event_box.get_window()->gobj(), RefPtr<GdkWindow> notused (track_canvas.get_window()->get_pointer (x, y, mask));
&x, &y, &mask)) {
if (use_track_canvas && (track_canvas_event_box.get_window()->get_pointer (x, y, mask) != 0)) {
doit = true;
} else if (use_time_canvas && (time_canvas_event_box.get_window()->get_pointer (x, y, mask)) != 0) {
doit = true; doit = true;
} }

View file

@ -926,7 +926,7 @@ Editor::button_release_handler (GnomeCanvasItem* item, GdkEvent* event, ItemType
break; break;
case MarkerItem: case MarkerItem:
remove_marker (item, &event); remove_marker (item, event);
break; break;
case RegionItem: case RegionItem:
@ -1941,9 +1941,9 @@ Editor::update_marker_drag_item (Location *location)
double x2 = frame_to_pixel (location->end()); double x2 = frame_to_pixel (location->end());
if (location->is_mark()) { if (location->is_mark()) {
marker_drag_line_points->coords[0] = x1; marker_drag_line_points[0].set_x (x1);
marker_drag_line_points->coords[2] = x1; marker_drag_line_points[1].set_x (x1);
marker_drag_line->set_property ("points", marker_drag_line_points); marker_drag_line->set_property ("points", marker_drag_line_points.gobj());
} }
else { else {
range_marker_drag_rect->set_property ("x1", x1); range_marker_drag_rect->set_property ("x1", x1);
@ -4122,7 +4122,7 @@ Editor::drag_range_markerbar_op (GnomeCanvasItem* item, GdkEvent* event)
jack_nframes_t start = 0; jack_nframes_t start = 0;
jack_nframes_t end = 0; jack_nframes_t end = 0;
GnomeCanvasItem * crect = (range_marker_op == CreateRangeMarker) ? range_bar_drag_rect: transport_bar_drag_rect; Gnome::Canvas::Item* crect = (range_marker_op == CreateRangeMarker) ? range_bar_drag_rect: transport_bar_drag_rect;
if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) { if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
snap_to (drag_info.current_pointer_frame); snap_to (drag_info.current_pointer_frame);
@ -4157,7 +4157,7 @@ Editor::drag_range_markerbar_op (GnomeCanvasItem* item, GdkEvent* event)
temp_location->set (start, end); temp_location->set (start, end);
gnome_canvas_item_show (crect); crect->show ();
update_marker_drag_item (temp_location); update_marker_drag_item (temp_location);
range_marker_drag_rect->show(); range_marker_drag_rect->show();
@ -4177,7 +4177,8 @@ Editor::drag_range_markerbar_op (GnomeCanvasItem* item, GdkEvent* event)
double x1 = frame_to_pixel (start); double x1 = frame_to_pixel (start);
double x2 = frame_to_pixel (end); double x2 = frame_to_pixel (end);
gnome_canvas_item_set (crect, "x1", x1, "x2", x2, NULL); crect->set_property ("x1", x1);
crect->set_property ("x2", x2);
update_marker_drag_item (temp_location); update_marker_drag_item (temp_location);
} }

View file

@ -998,13 +998,15 @@ Editor::scroll_tracks_up ()
void void
Editor::scroll_tracks_down_line () Editor::scroll_tracks_down_line ()
{ {
edit_vscrollbar.default_vmotion (0, 10); GtkAdjustment* adj = edit_vscrollbar.get_adjustment();
adj->set_value (adj->get_value() + 10);
} }
void void
Editor::scroll_tracks_up_line () Editor::scroll_tracks_up_line ()
{ {
edit_vscrollbar.default_vmotion (0, -10); GtkAdjustment* adj = edit_vscrollbar.get_adjustment();
adj->set_value (adj->get_value() - 10);
} }
/* ZOOM */ /* ZOOM */
@ -1461,7 +1463,7 @@ Editor::clear_locations ()
void void
Editor::insert_region_list_drag (AudioRegion& region) Editor::insert_region_list_drag (AudioRegion& region)
{ {
gint x, y; double x, y;
double wx, wy; double wx, wy;
double cx, cy; double cx, cy;
TimeAxisView *tv; TimeAxisView *tv;
@ -1471,7 +1473,7 @@ Editor::insert_region_list_drag (AudioRegion& region)
track_canvas.get_pointer (x, y); track_canvas.get_pointer (x, y);
gnome_canvas_window_to_world (GNOME_CANVAS(track_canvas), x, y, &wx, &wy); track_canvas.window_to_world (x, y, wx, wy);
GdkEvent event; GdkEvent event;
event.type = GDK_BUTTON_RELEASE; event.type = GDK_BUTTON_RELEASE;
@ -1526,13 +1528,14 @@ Editor::insert_region_list_selection (float times)
return; return;
} }
Gtk::CTree_Helpers::SelectionList& selected = region_list_display.selection(); RefPtr<TreeSelection> selected = region_list_display.get_selection();
if (selected.empty()) { if (selected.count_selected_rows() != 1) {
return; return;
} }
Region* region = reinterpret_cast<Region *> (selected.front().get_data ()); TreeModel::iterator i = region_list_display.get_selection()->get_selected();
Region* region = (*i)[region_list_display_columns.region];
begin_reversible_command (_("insert region")); begin_reversible_command (_("insert region"));
session->add_undo (playlist->get_memento()); session->add_undo (playlist->get_memento());
@ -1874,7 +1877,7 @@ Editor::import_progress_timeout (void *arg)
} }
if (import_status.doing_what == "building peak files") { if (import_status.doing_what == "building peak files") {
interthread_progress_bar.set_activity_mode (true); interthread_progress_bar.pulse ();
return FALSE; return FALSE;
} else { } else {
interthread_progress_bar.set_fraction (import_status.progress/100); interthread_progress_bar.set_fraction (import_status.progress/100);
@ -2104,7 +2107,7 @@ Editor::embed_sndfile (string path, bool split, bool multiple_files, bool& check
} }
} }
track_canvas_scroller.get_window()->set_cursor (GDK_WATCH); track_canvas_scroller.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
ARDOUR_UI::instance()->flush_pending (); ARDOUR_UI::instance()->flush_pending ();
/* make the proper number of channels in the region */ /* make the proper number of channels in the region */
@ -2141,16 +2144,18 @@ Editor::embed_sndfile (string path, bool split, bool multiple_files, bool& check
/* make sure we can see it in the list */ /* make sure we can see it in the list */
Gtk::CTree_Helpers::RowList::iterator external_node; /* its the second node, always */
external_node = region_list_display.rows().begin();
++external_node; /* its the second node, always */ // GTK2FIX ?? is it still always the 2nd node
external_node->expand_recursive ();
TreeModel::Path path ("2");
region_list_display.expand_row (path, true);
ARDOUR_UI::instance()->flush_pending (); ARDOUR_UI::instance()->flush_pending ();
} }
out: out:
track_canvas_scroller.get_window()->set_cursor (current_canvas_cursor); track_canvas_scroller.get_window()->set_cursor (*current_canvas_cursor);
} }
void void
@ -2288,7 +2293,7 @@ Editor::insert_sndfile_into (string path, bool multi, AudioTimeAxisView* tv, jac
return; return;
} }
track_canvas_scroller.get_window()->set_cursor (GDK_WATCH); track_canvas_scroller.get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
ARDOUR_UI::instance()->flush_pending (); ARDOUR_UI::instance()->flush_pending ();
/* make the proper number of channels in the region */ /* make the proper number of channels in the region */
@ -2331,7 +2336,7 @@ Editor::insert_sndfile_into (string path, bool multi, AudioTimeAxisView* tv, jac
} }
out: out:
track_canvas_scroller.get_window()->set_cursor (current_canvas_cursor); track_canvas_scroller.get_window()->set_cursor (*current_canvas_cursor);
return; return;
} }
@ -2598,13 +2603,14 @@ Editor::region_fill_selection ()
Region *region; Region *region;
Gtk::CTree_Helpers::SelectionList& selected = region_list_display.selection(); RefPtr<TreeSelection> selected = region_list_display.get_selection();
if (selected.empty()) { if (selected.count_selected_rows() != 1) {
return; return;
} }
region = reinterpret_cast<Region *> (selected.front().get_data()); TreeModel::iterator i = region_list_display.get_selection()->get_selected();
region = (*i)[region_list_display_columns.region];
jack_nframes_t start = selection->time[clicked_selection].start; jack_nframes_t start = selection->time[clicked_selection].start;
jack_nframes_t end = selection->time[clicked_selection].end; jack_nframes_t end = selection->time[clicked_selection].end;
@ -2918,7 +2924,7 @@ Editor::freeze_route ()
pthread_create (&itt.thread, 0, _freeze_thread, this); pthread_create (&itt.thread, 0, _freeze_thread, this);
track_canvas_scroller.get_window()->set_cursor (Gdk::WATCH); track_canvas_scroller.get_window()->set_cursor (Cursor (WATCH));
while (!itt.done && !itt.cancel) { while (!itt.done && !itt.cancel) {
gtk_main_iteration (); gtk_main_iteration ();
@ -2927,7 +2933,7 @@ Editor::freeze_route ()
interthread_progress_connection.disconnect (); interthread_progress_connection.disconnect ();
interthread_progress_window->hide_all (); interthread_progress_window->hide_all ();
current_interthread_info = 0; current_interthread_info = 0;
track_canvas_scroller.get_window()->set_cursor (current_canvas_cursor); track_canvas_scroller.get_window()->set_cursor (*current_canvas_cursor);
} }
void void
@ -3164,11 +3170,11 @@ Editor::paste (float times)
void void
Editor::mouse_paste () Editor::mouse_paste ()
{ {
gint x, y; double x, y;
double wx, wy; double wx, wy;
track_canvas.get_pointer (x, y); track_canvas.get_pointer (x, y);
gnome_canvas_window_to_world (GNOME_CANVAS(track_canvas), x, y, &wx, &wy); track_canvas.window_to_world (x, y, wx, wy);
GdkEvent event; GdkEvent event;
event.type = GDK_BUTTON_RELEASE; event.type = GDK_BUTTON_RELEASE;
@ -3215,14 +3221,17 @@ Editor::paste_internal (jack_nframes_t position, float times)
void void
Editor::paste_named_selection (float times) Editor::paste_named_selection (float times)
{ {
Gtk::CList_Helpers::SelectionList& selected = named_selection_display.selection();
TrackSelection::iterator i; TrackSelection::iterator i;
if (selected.empty() || selection->tracks.empty()) { RefPtr<TreeSelection> selected = named_selection_display.get_selection();
if (selected.count_selected_rows() == 0 || selection->tracks.empty()) {
return; return;
} }
NamedSelection* ns = static_cast<NamedSelection*> (selected.front()->get_data ()); TreeModel::iterator i = selected->get_selected();
NamedSection* ns = (*i)[named_selection_columns.selection];
list<Playlist*>::iterator chunk; list<Playlist*>::iterator chunk;
list<Playlist*>::iterator tmp; list<Playlist*>::iterator tmp;
@ -3457,7 +3466,7 @@ Editor::normalize_region ()
begin_reversible_command (_("normalize")); begin_reversible_command (_("normalize"));
track_canvas_scroller.get_window()->set_cursor (wait_cursor); track_canvas_scroller.get_window()->set_cursor (*wait_cursor);
gdk_flush (); gdk_flush ();
for (AudioRegionSelection::iterator r = selection->audio_regions.begin(); r != selection->audio_regions.end(); ++r) { for (AudioRegionSelection::iterator r = selection->audio_regions.begin(); r != selection->audio_regions.end(); ++r) {
@ -3467,7 +3476,7 @@ Editor::normalize_region ()
} }
commit_reversible_command (); commit_reversible_command ();
gdk_window_set_cursor (track_canvas_scroller.get_window()->gobj(), current_canvas_cursor); track_canvas_scroller.get_window()->set_cursor (*current_canvas_cursor);
} }
@ -3514,7 +3523,7 @@ Editor::apply_filter (AudioFilter& filter, string command)
begin_reversible_command (command); begin_reversible_command (command);
track_canvas_scroller.get_window()->set_cursor (wait_cursor); track_canvas_scroller.get_window()->set_cursor (*wait_cursor);
gdk_flush (); gdk_flush ();
for (AudioRegionSelection::iterator r = selection->audio_regions.begin(); r != selection->audio_regions.end(); ) { for (AudioRegionSelection::iterator r = selection->audio_regions.begin(); r != selection->audio_regions.end(); ) {
@ -3543,7 +3552,7 @@ Editor::apply_filter (AudioFilter& filter, string command)
selection->audio_regions.clear (); selection->audio_regions.clear ();
out: out:
gdk_window_set_cursor (track_canvas_scroller.get_window()->gobj(), current_canvas_cursor); track_canvas_scroller.get_window()->set_cursor (*current_canvas_cursor);
} }
void void

View file

@ -173,14 +173,14 @@ Editor::route_display_selection_changed ()
} }
void void
Editor::unselect_strip_in_display (TimeAxisView* tv) Editor::unselect_strip_in_display (TimeAxisView& tv)
{ {
TreeModel::Children rows = route_display_model->children(); TreeModel::Children rows = route_display_model->children();
TreeModel::Children::iterator i; TreeModel::Children::iterator i;
Glib::RefPtr<TreeSelection> selection = route_list.get_selection(); Glib::RefPtr<TreeSelection> selection = route_list.get_selection();
for (i = rows.begin(); i != rows.end(); ++i) { for (i = rows.begin(); i != rows.end(); ++i) {
if ((*i)[route_display_columns.tv] == tv) { if ((*i)[route_display_columns.tv] == &tv) {
selection->unselect (*i); selection->unselect (*i);
} }
} }

View file

@ -133,7 +133,7 @@ Editor::ruler_button_press (GdkEventButton* ev)
else if (minsec_ruler->is_realized() && ev->window == minsec_ruler->get_window()->gobj()) grab_widget = minsec_ruler; else if (minsec_ruler->is_realized() && ev->window == minsec_ruler->get_window()->gobj()) grab_widget = minsec_ruler;
if (grab_widget) { if (grab_widget) {
Gtk::Main::grab_add (*grab_widget); grab_widget->add_modal_grab ();
ruler_grabbed_widget = grab_widget; ruler_grabbed_widget = grab_widget;
} }
@ -189,7 +189,7 @@ Editor::ruler_button_release (GdkEventButton* ev)
if (ruler_grabbed_widget) { if (ruler_grabbed_widget) {
Gtk::Main::grab_remove (*ruler_grabbed_widget); ruler_grabbed_widget->remove_modal_grab();
ruler_grabbed_widget = 0; ruler_grabbed_widget = 0;
} }
@ -605,8 +605,7 @@ Editor::update_ruler_visibility ()
if (ruler_shown[ruler_time_meter]) { if (ruler_shown[ruler_time_meter]) {
lab_children.push_back (Element(meter_label, PACK_SHRINK, PACK_START)); lab_children.push_back (Element(meter_label, PACK_SHRINK, PACK_START));
gtk_object_getv (GTK_OBJECT(meter_group), 1, args) ; gtk_object_get (GTK_OBJECT(meter_group), "y", &old_unit_pos);
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
if (tbpos != old_unit_pos) { if (tbpos != old_unit_pos) {
meter_group->move ( 0.0, tbpos - old_unit_pos); meter_group->move ( 0.0, tbpos - old_unit_pos);
} }
@ -622,8 +621,7 @@ Editor::update_ruler_visibility ()
if (ruler_shown[ruler_time_tempo]) { if (ruler_shown[ruler_time_tempo]) {
lab_children.push_back (Element(tempo_label, PACK_SHRINK, PACK_START)); lab_children.push_back (Element(tempo_label, PACK_SHRINK, PACK_START));
gtk_object_getv (GTK_OBJECT(tempo_group), 1, args) ; gtk_object_get (GTK_OBJECT(tempo_group), "y", &old_unit_pos);
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
if (tbpos != old_unit_pos) { if (tbpos != old_unit_pos) {
tempo_group->move(0.0, tbpos - old_unit_pos); tempo_group->move(0.0, tbpos - old_unit_pos);
} }
@ -640,6 +638,7 @@ Editor::update_ruler_visibility ()
lab_children.push_back (Element(mark_label, PACK_SHRINK, PACK_START)); lab_children.push_back (Element(mark_label, PACK_SHRINK, PACK_START));
gtk_object_getv (GTK_OBJECT(marker_group), 1, args) ; gtk_object_getv (GTK_OBJECT(marker_group), 1, args) ;
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ; old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
gtk_object_get (GTK_OBJECT(marker_group), "y", &old_unit_pos);
if (tbpos != old_unit_pos) { if (tbpos != old_unit_pos) {
marker_group->move ( 0.0, tbpos - old_unit_pos); marker_group->move ( 0.0, tbpos - old_unit_pos);
} }
@ -670,8 +669,7 @@ Editor::update_ruler_visibility ()
if (ruler_shown[ruler_time_transport_marker]) { if (ruler_shown[ruler_time_transport_marker]) {
lab_children.push_back (Element(transport_mark_label, PACK_SHRINK, PACK_START)); lab_children.push_back (Element(transport_mark_label, PACK_SHRINK, PACK_START));
gtk_object_getv (GTK_OBJECT(transport_marker_group), 1, args) ; gtk_object_get (GTK_OBJECT(transport_marker_group), "y", &old_unit_pos);
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
if (tbpos != old_unit_pos) { if (tbpos != old_unit_pos) {
transport_marker_group->move ( 0.0, tbpos - old_unit_pos); transport_marker_group->move ( 0.0, tbpos - old_unit_pos);
} }

View file

@ -256,8 +256,9 @@ Editor::mouse_add_new_tempo_event (jack_nframes_t frame)
tempo_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (tempo_dialog, &ArdourDialog::stop), -1)); tempo_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (tempo_dialog, &ArdourDialog::stop), -1));
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE); tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
tempo_dialog.realize (); // GTK2FIX
tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)); // tempo_dialog.realize ();
// tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
ensure_float (tempo_dialog); ensure_float (tempo_dialog);
@ -298,8 +299,9 @@ Editor::mouse_add_new_meter_event (jack_nframes_t frame)
meter_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (meter_dialog, &ArdourDialog::stop), -1)); meter_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (meter_dialog, &ArdourDialog::stop), -1));
meter_dialog.set_position (Gtk::WIN_POS_MOUSE); meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
meter_dialog.realize (); // GTK2FIX
meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)); // meter_dialog.realize ();
// meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
ensure_float (meter_dialog); ensure_float (meter_dialog);
@ -355,8 +357,9 @@ Editor::edit_meter_section (MeterSection* section)
meter_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (meter_dialog, &ArdourDialog::stop), -1)); meter_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (meter_dialog, &ArdourDialog::stop), -1));
meter_dialog.set_position (Gtk::WIN_POS_MOUSE); meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
meter_dialog.realize (); // GTK2FIX
meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)); // meter_dialog.realize ();
// meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
ensure_float (meter_dialog); ensure_float (meter_dialog);
@ -387,8 +390,9 @@ Editor::edit_tempo_section (TempoSection* section)
tempo_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (tempo_dialog, &ArdourDialog::stop), -1)); tempo_dialog.cancel_button.signal_clicked().connect (bind (mem_fun (tempo_dialog, &ArdourDialog::stop), -1));
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE); tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
tempo_dialog.realize (); // GTK2FIX
tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)); // tempo_dialog.realize ();
// tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
ensure_float (tempo_dialog); ensure_float (tempo_dialog);

View file

@ -121,12 +121,14 @@ Editor::run_timestretch (AudioRegionSelection& regions, float fraction)
current_timestretch->progress_bar.set_fraction (0.0f); current_timestretch->progress_bar.set_fraction (0.0f);
current_timestretch->first_cancel = current_timestretch->cancel_button.signal_clicked().connect (bind (mem_fun (*current_timestretch, &ArdourDialog::stop), -1)); current_timestretch->first_cancel = current_timestretch->cancel_button.signal_clicked().connect (bind (mem_fun (*current_timestretch, &ArdourDialog::stop), -1));
current_timestretch->first_delete = current_timestretch->signal_delete_event().connect (mem_fun (*current_timestretch, &ArdourDialog::wm_close_event)); // GTK2FIX
// current_timestretch->first_delete = current_timestretch->signal_delete_event().connect (mem_fun (*current_timestretch, &ArdourDialog::wm_close_event));
current_timestretch->run (); current_timestretch->run ();
if (current_timestretch->run_status() != 1) { if (current_timestretch->run_status() != 1) {
current_timestretch->close (); // GTK2FIX
// current_timestretch->close ();
return 1; /* no error, but we did nothing */ return 1; /* no error, but we did nothing */
} }
@ -162,7 +164,8 @@ Editor::run_timestretch (AudioRegionSelection& regions, float fraction)
c.disconnect (); c.disconnect ();
current_timestretch->close (); // GTK2FIX
// current_timestretch->close ();
return current_timestretch->status; return current_timestretch->status;
} }

View file

@ -229,10 +229,10 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev)
double fraction; double fraction;
GdkWindow win (meter_metric_area.get_window()); Glib::RefPtr<Gdk::Window> win (meter_metric_area.get_window());
Gdk_GC fg_gc (meter_metric_area.get_style()->get_fg_gc (Gtk::STATE_NORMAL)); Glib::RefPtr<Gdk::GC> fg_gc (meter_metric_area.get_style()->get_fg_gc (Gtk::STATE_NORMAL));
Gdk_GC bg_gc (meter_metric_area.get_style()->get_bg_gc (Gtk::STATE_NORMAL)); Glib::RefPtr<Gdk::GC> bg_gc (meter_metric_area.get_style()->get_bg_gc (Gtk::STATE_NORMAL));
Gdk_Font font (meter_metric_area.get_style()->get_font()); Pango::FontDescription font (meter_metric_area.get_style()->get_font());
gint x, y, width, height, depth; gint x, y, width, height, depth;
gint pos; gint pos;
int db_points[] = { -50, -10, -3, 0, 6 }; int db_points[] = { -50, -10, -3, 0, 6 };
@ -241,7 +241,7 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev)
GdkRectangle base_rect; GdkRectangle base_rect;
GdkRectangle draw_rect; GdkRectangle draw_rect;
win.get_geometry (x, y, width, height, depth); win->get_geometry (x, y, width, height, depth);
base_rect.width = width; base_rect.width = width;
base_rect.height = height; base_rect.height = height;
@ -249,7 +249,7 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev)
base_rect.y = 0; base_rect.y = 0;
gdk_rectangle_intersect (&ev->area, &base_rect, &draw_rect); gdk_rectangle_intersect (&ev->area, &base_rect, &draw_rect);
win.draw_rectangle (bg_gc, true, draw_rect.x, draw_rect.y, draw_rect.width, draw_rect.height); win->draw_rectangle (bg_gc, true, draw_rect.x, draw_rect.y, draw_rect.width, draw_rect.height);
for (i = 0; i < sizeof (db_points)/sizeof (db_points[0]); ++i) { for (i = 0; i < sizeof (db_points)/sizeof (db_points[0]); ++i) {
fraction = log_meter (db_points[i]); fraction = log_meter (db_points[i]);
@ -257,21 +257,9 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev)
snprintf (buf, sizeof (buf), "%d", db_points[i]); snprintf (buf, sizeof (buf), "%d", db_points[i]);
gint twidth; Glib::RefPtr<Pango::Layout> Layout = meter_metric_area.create_pango_layout(buf);
gint lbearing; // GTK2FIX - how to get twidth, ascent
gint rbearing; win->draw_layout(fg_gc, width /* - twidth */, pos /* + ascent */, Layout);
gint ascent;
gint descent;
gdk_string_extents (font,
buf,
&lbearing,
&rbearing,
&twidth,
&ascent,
&descent);
win.draw_text (font, fg_gc, width - twidth, pos + ascent, buf, strlen (buf));
} }
return TRUE; return TRUE;
@ -434,9 +422,7 @@ GainMeter::setup_meters ()
meters[n].width = width; meters[n].width = width;
meters[n].meter->add_events (Gdk::BUTTON_RELEASE_MASK); meters[n].meter->add_events (Gdk::BUTTON_RELEASE_MASK);
meters[n].meter->signal_button_release_event().connect meters[n].meter->signal_button_release_event().connect (bind (mem_fun(*this, &GainMeter::meter_button_release), n));
(bind (mem_fun(*this, &GainMeter::meter_button_release), n));
meters[n].meter->signal_button_release_event().connect_after (ptr_fun (do_not_propagate));
} }
meter_packer.pack_start (*meters[n].meter, false, false); meter_packer.pack_start (*meters[n].meter, false, false);

View file

@ -373,11 +373,6 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press)); mute_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::mute_press));
mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release)); mute_button->signal_button_release_event().connect (mem_fun(*this, &RouteUI::mute_release));
gain_automation_style_button.signal_button_press_event().connect_after (ptr_fun (do_not_propagate));
pan_automation_style_button.signal_button_press_event().connect_after (ptr_fun (do_not_propagate));
gain_automation_state_button.signal_button_press_event().connect_after (ptr_fun (do_not_propagate));
pan_automation_state_button.signal_button_press_event().connect_after (ptr_fun (do_not_propagate));
gain_automation_style_button.signal_button_press_event().connect (mem_fun(*this, &MixerStrip::gain_automation_style_button_event)); gain_automation_style_button.signal_button_press_event().connect (mem_fun(*this, &MixerStrip::gain_automation_style_button_event));
gain_automation_style_button.signal_button_release_event().connect (mem_fun(*this, &MixerStrip::gain_automation_style_button_event)); gain_automation_style_button.signal_button_release_event().connect (mem_fun(*this, &MixerStrip::gain_automation_style_button_event));
pan_automation_style_button.signal_button_press_event().connect (mem_fun(*this, &MixerStrip::pan_automation_style_button_event)); pan_automation_style_button.signal_button_press_event().connect (mem_fun(*this, &MixerStrip::pan_automation_style_button_event));
@ -1139,7 +1134,8 @@ MixerStrip::setup_comment_editor ()
comment_area.signal_focus_in_event().connect (ptr_fun (ARDOUR_UI::generic_focus_in_event)); comment_area.signal_focus_in_event().connect (ptr_fun (ARDOUR_UI::generic_focus_in_event));
comment_area.signal_focus_out_event().connect (ptr_fun (ARDOUR_UI::generic_focus_out_event)); comment_area.signal_focus_out_event().connect (ptr_fun (ARDOUR_UI::generic_focus_out_event));
comment_area.changed.connect (mem_fun(*this, &MixerStrip::comment_edited)); comment_area.changed.connect (mem_fun(*this, &MixerStrip::comment_edited));
comment_area.signal_button_release_event().connect_after (ptr_fun (do_not_propagate)); // GTK2FIX
// comment_area.signal_button_release_event().connect_after (ptr_fun (do_not_propagate));
comment_area.show (); comment_area.show ();
comment_window->add (comment_area); comment_window->add (comment_area);
@ -1153,11 +1149,11 @@ MixerStrip::comment_changed (void *src)
if (src != this) { if (src != this) {
ignore_comment_edit = true; ignore_comment_edit = true;
comment_area.freeze (); // comment_area.freeze ();
//comment_area.get_buffer()->delete_text (0, -1); //comment_area.get_buffer()->delete_text (0, -1);
//comment_area.set_point (0); //comment_area.set_point (0);
comment_area.get_buffer()->set_text (_route.comment()); comment_area.get_buffer()->set_text (_route.comment());
comment_area.thaw (); // comment_area.thaw ();
ignore_comment_edit = false; ignore_comment_edit = false;
} }
} }

View file

@ -63,7 +63,8 @@ NewSessionDialog::NewSessionDialog (ARDOUR::AudioEngine& engine, bool startup, s
set_wmclass (_("ardour_new_session"), "Ardour"); set_wmclass (_("ardour_new_session"), "Ardour");
set_position (Gtk::WIN_POS_MOUSE); set_position (Gtk::WIN_POS_MOUSE);
set_keyboard_input (true); set_keyboard_input (true);
set_policy (false, true, false); // GTK2FIX
// set_policy (false, true, false);
set_modal (true); set_modal (true);
/* sample rate */ /* sample rate */

View file

@ -950,9 +950,6 @@ OptionEditor::setup_midi_options ()
int n; int n;
ToggleButton* tb; ToggleButton* tb;
RadioButton* rb; RadioButton* rb;
RadioButton* first_mtc_button = 0;
RadioButton* first_mmc_button = 0;
RadioButton* first_midi_button = 0;
Gtk::Table* table = manage (new Table (ports.size() + 4, 9)); Gtk::Table* table = manage (new Table (ports.size() + 4, 9));
@ -1012,9 +1009,9 @@ OptionEditor::setup_midi_options ()
newpair.second.push_back (rb); newpair.second.push_back (rb);
rb->set_name ("OptionEditorToggleButton"); rb->set_name ("OptionEditorToggleButton");
if (n == 0) { if (n == 0) {
first_mtc_button = rb; mtc_button_group = rb->get_group();
} else { } else {
rb->set_group (first_mtc_button->get_group()); rb->set_group (mtc_button_group);
} }
table->attach (*rb, 4, 5, n+2, n+3, FILL|EXPAND, FILL); table->attach (*rb, 4, 5, n+2, n+3, FILL|EXPAND, FILL);
rb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::mtc_port_chosen), (*i).second, rb)); rb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::mtc_port_chosen), (*i).second, rb));
@ -1027,9 +1024,9 @@ OptionEditor::setup_midi_options ()
newpair.second.push_back (rb); newpair.second.push_back (rb);
rb->set_name ("OptionEditorToggleButton"); rb->set_name ("OptionEditorToggleButton");
if (n == 0) { if (n == 0) {
first_mmc_button = rb; mmc_button_group = rb->get_group();
} else { } else {
rb->set_group (first_mmc_button->get_group()); rb->set_group (mmc_button_group);
} }
table->attach (*rb, 6, 7, n+2, n+3, FILL|EXPAND, FILL); table->attach (*rb, 6, 7, n+2, n+3, FILL|EXPAND, FILL);
rb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::mmc_port_chosen), (*i).second, rb)); rb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::mmc_port_chosen), (*i).second, rb));
@ -1042,9 +1039,9 @@ OptionEditor::setup_midi_options ()
newpair.second.push_back (rb); newpair.second.push_back (rb);
rb->set_name ("OptionEditorToggleButton"); rb->set_name ("OptionEditorToggleButton");
if (n == 0) { if (n == 0) {
first_midi_button = rb; midi_button_group = rb->get_group();
} else { } else {
rb->set_group (first_midi_button->get_group()); rb->set_group (midi_button_group);
} }
table->attach (*rb, 8, 9, n+2, n+3, FILL|EXPAND, FILL); table->attach (*rb, 8, 9, n+2, n+3, FILL|EXPAND, FILL);
rb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::midi_port_chosen), (*i).second, rb)); rb->signal_button_press_event().connect (bind (mem_fun(*this, &OptionEditor::midi_port_chosen), (*i).second, rb));
@ -1651,8 +1648,9 @@ OptionEditor::setup_misc_options()
connect_box->set_spacing (3); connect_box->set_spacing (3);
connect_box->set_border_width (8); connect_box->set_border_width (8);
auto_connect_output_manual_button.set_group (auto_connect_output_master_button.get_group()); auto_connect_output_button_group = auto_connect_output_master_button.get_group();
auto_connect_output_physical_button.set_group (auto_connect_output_master_button.get_group()); auto_connect_output_manual_button.set_group (auto_connect_output_button_group);
auto_connect_output_physical_button.set_group (auto_connect_output_button_group);
Gtk::HBox* useless_box = manage (new HBox); Gtk::HBox* useless_box = manage (new HBox);
useless_box->pack_start (auto_connect_inputs_button, false, false); useless_box->pack_start (auto_connect_inputs_button, false, false);
@ -1991,7 +1989,7 @@ OptionEditor::fixup_combo_size (Gtk::Combo& combo, vector<string>& strings)
const guint32 FUDGE = 10; // Combo's are stupid - they steal space from the entry for the button const guint32 FUDGE = 10; // Combo's are stupid - they steal space from the entry for the button
set_size_request_to_display_given_text (*combo.get_entry(), maxstring.c_str(), 10 + FUDGE, 10); set_size_request_to_display_given_text (combo, maxstring.c_str(), 10 + FUDGE, 10);
} }
void void

View file

@ -169,6 +169,10 @@ class OptionEditor : public ArdourDialog
Gtk::CheckButton midi_control_button; Gtk::CheckButton midi_control_button;
Gtk::CheckButton mmc_control_button; Gtk::CheckButton mmc_control_button;
Gtk::RadioButton::Group mtc_button_group;
Gtk::RadioButton::Group mmc_button_group;
Gtk::RadioButton::Group midi_button_group;
void send_mmc_toggled (Gtk::CheckButton*); void send_mmc_toggled (Gtk::CheckButton*);
void mmc_control_toggled (Gtk::CheckButton*); void mmc_control_toggled (Gtk::CheckButton*);
void midi_control_toggled (Gtk::CheckButton*); void midi_control_toggled (Gtk::CheckButton*);
@ -258,6 +262,7 @@ class OptionEditor : public ArdourDialog
Gtk::RadioButton auto_connect_output_physical_button; Gtk::RadioButton auto_connect_output_physical_button;
Gtk::RadioButton auto_connect_output_master_button; Gtk::RadioButton auto_connect_output_master_button;
Gtk::RadioButton auto_connect_output_manual_button; Gtk::RadioButton auto_connect_output_manual_button;
Gtk::RadioButton::Group auto_connect_output_button_group;
Gtk::CheckButton hw_monitor_button; Gtk::CheckButton hw_monitor_button;
Gtk::CheckButton sw_monitor_button; Gtk::CheckButton sw_monitor_button;

View file

@ -455,11 +455,12 @@ Panner2d::on_expose_event (GdkEventExpose *event)
x, y, x, y,
8, 8, 8, 8,
0, 360 * 64); 0, 360 * 64);
get_window().draw_text (get_style()->get_font(), // GTK2FIX : needs a pango layout
get_style()->get_fg_gc(Gtk::STATE_NORMAL), // get_window().draw_text (get_style()->get_font(),
x + 6, y + 6, // get_style()->get_fg_gc(Gtk::STATE_NORMAL),
puck->text, // x + 6, y + 6,
puck->textlen); // puck->text,
// puck->textlen);
} }
} }

View file

@ -85,6 +85,9 @@ static const gchar * revdblarrow_xpm[] = {
PannerUI::PannerUI (IO& io, Session& s) PannerUI::PannerUI (IO& io, Session& s)
: _io (io), : _io (io),
_session (s), _session (s),
hAdjustment(0.0, 0.0, 0.0),
vAdjustment(0.0, 0.0, 0.0),
panning_viewport(hAdjustment, vAdjustment),
panning_up_arrow (Gtk::ARROW_UP, Gtk::SHADOW_OUT), panning_up_arrow (Gtk::ARROW_UP, Gtk::SHADOW_OUT),
panning_down_arrow (Gtk::ARROW_DOWN, Gtk::SHADOW_OUT), panning_down_arrow (Gtk::ARROW_DOWN, Gtk::SHADOW_OUT),
panning_link_button (_("link")) panning_link_button (_("link"))

View file

@ -67,6 +67,8 @@ class PannerUI : public Gtk::HBox
Panner2d* panner; Panner2d* panner;
Gtk::VBox pan_bar_packer; Gtk::VBox pan_bar_packer;
Gtk::Adjustment hAdjustment;
Gtk::Adjustment vAdjustment;
Gtk::Viewport panning_viewport; Gtk::Viewport panning_viewport;
Gtk::EventBox panning_up; Gtk::EventBox panning_up;
Gtk::Arrow panning_up_arrow; Gtk::Arrow panning_up_arrow;

View file

@ -121,6 +121,9 @@ PluginUI::PluginUI (AudioEngine &engine, PluginInsert& pi, bool scrollable)
engine(engine), engine(engine),
button_table (initial_button_rows, initial_button_cols), button_table (initial_button_rows, initial_button_cols),
output_table (initial_output_rows, initial_output_cols), output_table (initial_output_rows, initial_output_cols),
hAdjustment(0.0, 0.0, 0.0),
vAdjustment(0.0, 0.0, 0.0),
scroller_view(hAdjustment, vAdjustment),
automation_menu (0), automation_menu (0),
is_scrollable(scrollable) is_scrollable(scrollable)
{ {
@ -476,8 +479,8 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, MIDI::Contr
control_ui->combo = new Gtk::ComboBoxText; control_ui->combo = new Gtk::ComboBoxText;
//control_ui->combo->set_value_in_list(true, false); //control_ui->combo->set_value_in_list(true, false);
set_popdown_strings (*control_ui->combo, setup_scale_values(port_index, control_ui)); set_popdown_strings (*control_ui->combo, setup_scale_values(port_index, control_ui));
control_ui->combo->signal_unmap_event().connect( mem_fun(*this, &PluginUI::control_combo_changed), control_ui); control_ui->combo->signal_unmap_event().connect (bind (mem_fun(*this, &PluginUI::control_combo_changed), control_ui));
plugin.ParameterChanged.connect (bind (mem_fun(*this, &PluginUI::parameter_changed), control_ui)); plugin.ParameterChanged.connect (bind (mem_fun (*this, &PluginUI::parameter_changed), control_ui));
control_ui->pack_start(control_ui->label, true, true); control_ui->pack_start(control_ui->label, true, true);
control_ui->pack_start(*control_ui->combo, false, true); control_ui->pack_start(*control_ui->combo, false, true);
@ -746,7 +749,7 @@ PluginUI::control_port_toggled (ControlUI* cui)
} }
} }
gint bool
PluginUI::control_combo_changed (GdkEventAny* ignored, ControlUI* cui) PluginUI::control_combo_changed (GdkEventAny* ignored, ControlUI* cui)
{ {
if (!cui->ignore_change) { if (!cui->ignore_change) {
@ -763,7 +766,7 @@ PluginUIWindow::plugin_going_away (ARDOUR::Redirect* ignored)
{ {
ENSURE_GUI_THREAD(bind (mem_fun(*this, &PluginUIWindow::plugin_going_away), ignored)); ENSURE_GUI_THREAD(bind (mem_fun(*this, &PluginUIWindow::plugin_going_away), ignored));
_pluginui->stop_updating(0); _pluginui->stop_updating();
delete_when_idle (this); delete_when_idle (this);
} }
@ -786,24 +789,22 @@ PluginUI::redirect_active_changed (Redirect* r, void* src)
bypass_button.set_active (!r->active()); bypass_button.set_active (!r->active());
} }
gint void
PluginUI::start_updating (GdkEventAny *ev) PluginUI::start_updating ()
{ {
if (output_controls.size() > 0 ) { if (output_controls.size() > 0 ) {
screen_update_connection.disconnect(); screen_update_connection.disconnect();
screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect
(mem_fun(*this, &PluginUI::output_update)); (mem_fun(*this, &PluginUI::output_update));
} }
return FALSE;
} }
gint void
PluginUI::stop_updating (GdkEventAny *ev) PluginUI::stop_updating ()
{ {
if (output_controls.size() > 0 ) { if (output_controls.size() > 0 ) {
screen_update_connection.disconnect(); screen_update_connection.disconnect();
} }
return FALSE;
} }
void void
@ -840,10 +841,10 @@ PluginUI::output_update ()
} }
} }
list<string> vector<string>
PluginUI::setup_scale_values(guint32 port_index, ControlUI* cui) PluginUI::setup_scale_values(guint32 port_index, ControlUI* cui)
{ {
list<string> enums; vector<string> enums;
LadspaPlugin* lp = dynamic_cast<LadspaPlugin*> (&plugin); LadspaPlugin* lp = dynamic_cast<LadspaPlugin*> (&plugin);
cui->combo_map = new std::map<string, float>; cui->combo_map = new std::map<string, float>;

View file

@ -71,8 +71,8 @@ class PlugUIBase : public sigc::trackable
virtual ~PlugUIBase() {} virtual ~PlugUIBase() {}
virtual gint get_preferred_height () = 0; virtual gint get_preferred_height () = 0;
virtual gint start_updating(GdkEventAny*) = 0; virtual void start_updating() = 0;
virtual gint stop_updating(GdkEventAny*) = 0; virtual void stop_updating() = 0;
protected: protected:
ARDOUR::PluginInsert& insert; ARDOUR::PluginInsert& insert;
@ -94,8 +94,8 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
gint get_preferred_height () { return prefheight; } gint get_preferred_height () { return prefheight; }
gint start_updating(GdkEventAny*); void start_updating();
gint stop_updating(GdkEventAny*); void stop_updating();
private: private:
ARDOUR::AudioEngine &engine; ARDOUR::AudioEngine &engine;
@ -108,6 +108,8 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
Gtk::Table output_table; Gtk::Table output_table;
Gtk::ScrolledWindow scroller; Gtk::ScrolledWindow scroller;
Gtk::Adjustment hAdjustment;
Gtk::Adjustment vAdjustment;
Gtk::Viewport scroller_view; Gtk::Viewport scroller_view;
Gtk::Label nameinfo_label; Gtk::Label nameinfo_label;
Gtk::Label paraminfo_label; Gtk::Label paraminfo_label;
@ -179,12 +181,12 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
void build (ARDOUR::AudioEngine &); void build (ARDOUR::AudioEngine &);
ControlUI* build_control_ui (ARDOUR::AudioEngine &, guint32 port_index, MIDI::Controllable *); ControlUI* build_control_ui (ARDOUR::AudioEngine &, guint32 port_index, MIDI::Controllable *);
std::list<string> setup_scale_values(guint32 port_index, ControlUI* cui); std::vector<string> setup_scale_values(guint32 port_index, ControlUI* cui);
void control_adjustment_changed (ControlUI* cui); void control_adjustment_changed (ControlUI* cui);
void parameter_changed (uint32_t, float, ControlUI* cui); void parameter_changed (uint32_t, float, ControlUI* cui);
void update_control_display (ControlUI* cui); void update_control_display (ControlUI* cui);
void control_port_toggled (ControlUI* cui); void control_port_toggled (ControlUI* cui);
gint control_combo_changed (GdkEventAny* ignored, ControlUI* cui); bool control_combo_changed (GdkEventAny* ignored, ControlUI* cui);
gint entry_focus_event (GdkEventFocus* ev); gint entry_focus_event (GdkEventFocus* ev);
void redirect_active_changed (ARDOUR::Redirect*, void*); void redirect_active_changed (ARDOUR::Redirect*, void*);
@ -222,8 +224,8 @@ class VSTPluginUI : public PlugUIBase, public Gtk::VBox
~VSTPluginUI (); ~VSTPluginUI ();
gint get_preferred_height (); gint get_preferred_height ();
gint start_updating(GdkEventAny*) { return 0; } void start_updating() {}
gint stop_updating(GdkEventAny*) { return 0; } void stop_updating() {}
int package (Gtk::Window&); int package (Gtk::Window&);

View file

@ -862,8 +862,9 @@ AudioRegionView::show_region_editor ()
{ {
if (editor == 0) { if (editor == 0) {
editor = new AudioRegionEditor (trackview.session(), region, *this); editor = new AudioRegionEditor (trackview.session(), region, *this);
editor->realize (); // GTK2FIX : how to ensure float without realizing
trackview.editor.ensure_float (*editor); // editor->realize ();
// trackview.editor.ensure_float (*editor);
} }
editor->show_all (); editor->show_all ();
@ -934,8 +935,7 @@ AudioRegionView::region_sync_changed ()
args[0].name = X_("points"); args[0].name = X_("points");
gtk_object_getv (GTK_OBJECT(sync_mark), 1, args); sync_mark->get (X_("points"), &points);
points = static_cast<GnomeCanvasPoints *> (GTK_VALUE_POINTER(args[0]));
double offset = sync_offset / samples_per_unit; double offset = sync_offset / samples_per_unit;

View file

@ -294,7 +294,7 @@ RouteParams_UI::cleanup_pre_view (bool stopupdate)
PluginUI * plugui = 0; PluginUI * plugui = 0;
if (stopupdate && (plugui = dynamic_cast<PluginUI*>(_active_pre_view)) != 0) { if (stopupdate && (plugui = dynamic_cast<PluginUI*>(_active_pre_view)) != 0) {
plugui->stop_updating (0); plugui->stop_updating ();
} }
_pre_plugin_conn.disconnect(); _pre_plugin_conn.disconnect();
@ -311,7 +311,7 @@ RouteParams_UI::cleanup_post_view (bool stopupdate)
PluginUI * plugui = 0; PluginUI * plugui = 0;
if (stopupdate && (plugui = dynamic_cast<PluginUI*>(_active_post_view)) != 0) { if (stopupdate && (plugui = dynamic_cast<PluginUI*>(_active_post_view)) != 0) {
plugui->stop_updating (0); plugui->stop_updating ();
} }
_post_plugin_conn.disconnect(); _post_plugin_conn.disconnect();
post_redir_hpane.remove(*_active_post_view); post_redir_hpane.remove(*_active_post_view);
@ -573,7 +573,7 @@ RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement
if (place == PreFader) { if (place == PreFader) {
cleanup_pre_view(); cleanup_pre_view();
_pre_plugin_conn = plugin_insert->plugin().GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader)); _pre_plugin_conn = plugin_insert->plugin().GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader));
plugin_ui->start_updating (0); plugin_ui->start_updating ();
_active_pre_view = plugin_ui; _active_pre_view = plugin_ui;
pre_redir_hpane.add2 (*_active_pre_view); pre_redir_hpane.add2 (*_active_pre_view);
pre_redir_hpane.show_all(); pre_redir_hpane.show_all();
@ -581,7 +581,7 @@ RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement
else { else {
cleanup_post_view(); cleanup_post_view();
_post_plugin_conn = plugin_insert->plugin().GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader)); _post_plugin_conn = plugin_insert->plugin().GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader));
plugin_ui->start_updating (0); plugin_ui->start_updating ();
_active_post_view = plugin_ui; _active_post_view = plugin_ui;
post_redir_hpane.add2 (*_active_post_view); post_redir_hpane.add2 (*_active_post_view);
post_redir_hpane.show_all(); post_redir_hpane.show_all();

View file

@ -33,14 +33,14 @@ namespace Canvas
{ {
SimpleRect::SimpleRect(Group& parentx, double x1, double y1, double x2, double y2) SimpleRect::SimpleRect(Group& parentx, double x1, double y1, double x2, double y2)
: Shape(GNOME_CANVAS_SHAPE(g_object_new(get_type(),0))) : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
{ {
item_construct(parentx); item_construct(parentx);
set("x1",x1,"y1",y1,"x2",x2,"y2",y2,0); set("x1",x1,"y1",y1,"x2",x2,"y2",y2,0);
} }
SimpleRect::SimpleRect(Group& parentx) SimpleRect::SimpleRect(Group& parentx)
: Shape(GNOME_CANVAS_SHAPE(g_object_new(get_type(),0))) : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
{ {
item_construct(parentx); item_construct(parentx);
} }
@ -57,7 +57,7 @@ namespace
namespace Glib namespace Glib
{ {
Gnome::Canvas::SimpleRect* wrap(GnomeCanvasRect* object, bool take_copy) Gnome::Canvas::SimpleRect* wrap(GnomeCanvasSimpleRect* object, bool take_copy)
{ {
return dynamic_cast<Gnome::Canvas::SimpleRect *> (Glib::wrap_auto ((GObject*)(object), take_copy)); return dynamic_cast<Gnome::Canvas::SimpleRect *> (Glib::wrap_auto ((GObject*)(object), take_copy));
} }
@ -78,7 +78,7 @@ const Glib::Class& SimpleRect_Class::init()
if(!gtype_) // create the GType if necessary if(!gtype_) // create the GType if necessary
{ {
// Glib::Class has to know the class init function to clone custom types. // Glib::Class has to know the class init function to clone custom types.
class_init_func_ = &Shape_Class::class_init_function; class_init_func_ = &SimpleRect_Class::class_init_function;
// This is actually just optimized away, apparently with no harm. // This is actually just optimized away, apparently with no harm.
// Make sure that the parent type has been created. // Make sure that the parent type has been created.
@ -109,14 +109,14 @@ Glib::ObjectBase* SimpleRect_Class::wrap_new(GObject* o)
/* The implementation: */ /* The implementation: */
SimpleRect::SimpleRect(const Glib::ConstructParams& construct_params) SimpleRect::SimpleRect(const Glib::ConstructParams& construct_params)
: Shape(construct_params) : Item(construct_params)
{ {
} }
SimpleRect::SimpleRect(GnomeCanvasSimpleRect* castitem) SimpleRect::SimpleRect(GnomeCanvasSimpleRect* castitem)
: Shape ((GnomeCanvasShape*)(castitem)) : Item ((GnomeCanvasItem*)(castitem))
{ {
} }
SimpleRect::~SimpleRect() SimpleRect::~SimpleRect()
{ {

View file

@ -56,7 +56,7 @@ namespace Canvas
//class Group; //class Group;
class SimpleRect : public Shape class SimpleRect : public Item
{ {
public: public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS #ifndef DOXYGEN_SHOULD_SKIP_THIS

View file

@ -356,24 +356,23 @@ TimeAxisView::set_height (TrackHeight h)
} }
bool
gint
TimeAxisView::name_entry_button_press (GdkEventButton *ev) TimeAxisView::name_entry_button_press (GdkEventButton *ev)
{ {
if (ev->button == 3) { if (ev->button == 3) {
return do_not_propagate (ev); return true;
} }
return FALSE; return false
} }
gint bool
TimeAxisView::name_entry_button_release (GdkEventButton *ev) TimeAxisView::name_entry_button_release (GdkEventButton *ev)
{ {
if (ev->button == 3) { if (ev->button == 3) {
popup_display_menu (ev->time); popup_display_menu (ev->time);
return stop_signal (name_entry, "button_release_event"); return true;
} }
return FALSE; return false;
} }
void void

View file

@ -195,14 +195,14 @@ class TimeAxisView : public virtual AxisView
* *
* @param ev the event * @param ev the event
*/ */
virtual gint name_entry_button_press (GdkEventButton *ev); virtual bool name_entry_button_press (GdkEventButton *ev);
/** /**
* Handle mouse relaese on our LHS control name entry. * Handle mouse relaese on our LHS control name entry.
* *
*@ param ev the event *@ param ev the event
*/ */
virtual gint name_entry_button_release (GdkEventButton *ev); virtual bool name_entry_button_release (GdkEventButton *ev);
/** /**
* Handle mouse relaese on our LHS control name ebox. * Handle mouse relaese on our LHS control name ebox.

View file

@ -26,8 +26,7 @@
#include "public_editor.h" #include "public_editor.h"
#include "time_axis_view_item.h" #include "time_axis_view_item.h"
#include "time_axis_view.h" #include "time_axis_view.h"
#include "canvas-simplerect.h" #include "simplerect.h"
#include "canvas-imageframe.h"
#include "utils.h" #include "utils.h"
#include "rgb_macros.h" #include "rgb_macros.h"
@ -61,7 +60,7 @@ const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6 ;
* @param start the start point of this item * @param start the start point of this item
* @param duration the duration of this item * @param duration the duration of this item
*/ */
TimeAxisViewItem::TimeAxisViewItem(std::string it_name, GnomeCanvasGroup* parent, TimeAxisView& tv, double spu, Gdk::Color& base_color, TimeAxisViewItem::TimeAxisViewItem(std::string it_name, Gnome::Canvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color,
jack_nframes_t start, jack_nframes_t duration, jack_nframes_t start, jack_nframes_t duration,
Visibility visibility) Visibility visibility)
: trackview (tv) : trackview (tv)
@ -87,57 +86,53 @@ TimeAxisViewItem::TimeAxisViewItem(std::string it_name, GnomeCanvasGroup* parent
warning << "Time Axis Item Duration == 0" << endl ; warning << "Time Axis Item Duration == 0" << endl ;
} }
group = gnome_canvas_item_new(GNOME_CANVAS_GROUP(parent),gnome_canvas_group_get_type(),NULL) ; group = new Gnome::Canvas::Group (parent);
vestigial_frame = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group), vestigial_frame = new Gnome::Canvas::SimpleRect (*group);
gnome_canvas_simplerect_get_type(), vestigial_frame->set_property ("x1", (double) 0.0);
"x1", (double) 0.0, vestigial_frame->set_property ("y1", (double) 1.0);
"y1", (double) 1.0, vestigial_frame->set_property ("x2", 2.0);
"x2", 2.0, vestigial_frame->set_property ("y2", (double) trackview.height);
"y2", (double) trackview.height, vestigial_frame->set_property ("outline_color_rgba", color_map[cVestigialFrameOutline]);
"outline_color_rgba", color_map[cVestigialFrameOutline], vestigial_frame->set_property ("fill_color_rgba", color_map[cVestigialFrameFill]);
"fill_color_rgba", color_map[cVestigialFrameFill], vestigial_frame->hide ();
NULL);
gnome_canvas_item_hide (vestigial_frame);
if (visibility & ShowFrame) { if (visibility & ShowFrame) {
frame = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group), frame = new Gnome::Canvas::SimpleRect (*group);
gnome_canvas_simplerect_get_type(), frame->set_property ("x1", (double) 0.0);
"x1", (double) 0.0, frame->set_property ("y1", (double) 1.0);
"y1", (double) 1.0, frame->set_property ("x2", (double) trackview.editor.frame_to_pixel(duration));
"x2", (double) trackview.editor.frame_to_pixel(duration), frame->set_property ("y2", (double) trackview.height);
"y2", (double) trackview.height, frame->set_property ("outline_color_rgba", color_map[cTimeAxisFrameOutline]);
"outline_color_rgba", color_map[cTimeAxisFrameOutline], frame->set_property ("fill_color_rgba", color_map[cTimeAxisFrameFill]);
"fill_color_rgba", color_map[cTimeAxisFrameFill],
NULL);
} else { } else {
frame = 0; frame = 0;
} }
if (visibility & ShowNameHighlight) { if (visibility & ShowNameHighlight) {
name_highlight = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group), name_highlight = new Gnome::Canvas::SimpleRect (*group);
gnome_canvas_simplerect_get_type(), name_highlight->set_property ("x1", (double) 1.0);
"x1", (double) 1.0, name_highlight->set_property ("x2", (double) (trackview.editor.frame_to_pixel(item_duration)) - 1);
"x2", (double) (trackview.editor.frame_to_pixel(item_duration)) - 1, name_highlight->set_property ("y1", (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE));
"y1", (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE), name_highlight->set_property ("y2", (double) (trackview.height - 1));
"y2", (double) (trackview.height - 1), name_highlight->set_property ("outline_color_rgba", color_map[cNameHighlightFill]);
"outline_color_rgba", color_map[cNameHighlightFill], name_highlight->set_property ("fill_color_rgba", color_map[cNameHighlightOutline]);
"fill_color_rgba", color_map[cNameHighlightOutline],
NULL) ; name_highlight->set_data ("timeaxisviewitem", this);
gtk_object_set_data(GTK_OBJECT(name_highlight), "timeaxisviewitem", this) ;
} else { } else {
name_highlight = 0; name_highlight = 0;
} }
if (visibility & ShowNameText) { if (visibility & ShowNameText) {
name_text = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group), name_text = new Gnome::Canvas::Text (*group);
gnome_canvas_text_get_type(), name_text->set_property ("x", (double) TimeAxisViewItem::NAME_X_OFFSET);
"x", (double) TimeAxisViewItem::NAME_X_OFFSET, name_text->set_property ("y", (double) trackview.height + 1.0 - TimeAxisViewItem::NAME_Y_OFFSET);
"y", (double) trackview.height + 1.0 - TimeAxisViewItem::NAME_Y_OFFSET, name_text->set_property ("font", NAME_FONT);
"font", NAME_FONT.c_str(), name_text->set_property ("anchor", GTK_ANCHOR_NW);
"anchor", GTK_ANCHOR_NW,
NULL) ; name_text->set_data ("timeaxisviewitem", this);
gtk_object_set_data(GTK_OBJECT(name_text), "timeaxisviewitem", this) ;
} else { } else {
name_text = 0; name_text = 0;
@ -146,25 +141,22 @@ TimeAxisViewItem::TimeAxisViewItem(std::string it_name, GnomeCanvasGroup* parent
/* create our grab handles used for trimming/duration etc */ /* create our grab handles used for trimming/duration etc */
if (visibility & ShowHandles) { if (visibility & ShowHandles) {
frame_handle_start = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group), frame_handle_start = new Gnome::Canvas::SimpleRect (*group);
gnome_canvas_simplerect_get_type(), frame_handle_start->set_property ("x1", (double) 0.0);
"x1", (double) 0.0, frame_handle_start->set_property ("x2", (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH);
"x2", (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH, frame_handle_start->set_property ("y1", (double) 1.0);
"y1", (double) 1.0, frame_handle_start->set_property ("y2", (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH+1);
"y2", (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH+1, frame_handle_start->set_property ("outline_color_rgba", color_map[cFrameHandleStartOutline]);
"outline_color_rgba", color_map[cFrameHandleStartOutline], frame_handle_start->set_property ("fill_color_rgba", color_map[cFrameHandleStartFill]);
"fill_color_rgba", color_map[cFrameHandleStartFill],
NULL) ; frame_handle_end = new Gnome::Canvas::SimpleRect (*group);
frame_handle_end->set_property ("x1", (double) (trackview.editor.frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH));
frame_handle_end->set_property ("x2", (double) trackview.editor.frame_to_pixel(get_duration()));
frame_handle_end->set_property ("y1", (double) 1);
frame_handle_end->set_property ("y2", (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1);
frame_handle_end->set_property ("outline_color_rgba", color_map[cFrameHandleEndOutline]);
frame_handle_end->set_property ("fill_color_rgba", color_map[cFrameHandleEndFill]);
frame_handle_end = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group),
gnome_canvas_simplerect_get_type(),
"x1", (double) (trackview.editor.frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH),
"x2", (double) trackview.editor.frame_to_pixel(get_duration()),
"y1", (double) 1,
"y2", (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1,
"outline_color_rgba", color_map[cFrameHandleEndOutline],
"fill_color_rgba", color_map[cFrameHandleEndFill],
NULL) ;
} else { } else {
frame_handle_start = 0; frame_handle_start = 0;
frame_handle_end = 0; frame_handle_end = 0;
@ -182,7 +174,7 @@ TimeAxisViewItem::TimeAxisViewItem(std::string it_name, GnomeCanvasGroup* parent
*/ */
TimeAxisViewItem::~TimeAxisViewItem() TimeAxisViewItem::~TimeAxisViewItem()
{ {
gtk_object_destroy (GTK_OBJECT(group)); delete group;
} }
@ -214,16 +206,13 @@ TimeAxisViewItem::set_position(jack_nframes_t pos, void* src, double* delta)
version of GNOME Canvas rectifies this issue cleanly. version of GNOME Canvas rectifies this issue cleanly.
*/ */
GtkArg args[1] ;
double old_unit_pos ; double old_unit_pos ;
double new_unit_pos = pos / samples_per_unit ; double new_unit_pos = pos / samples_per_unit ;
args[0].name = "x" ; group->get_property ("x", &old_unit_pos);
gtk_object_getv (GTK_OBJECT(group), 1, args) ;
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
if (new_unit_pos != old_unit_pos) { if (new_unit_pos != old_unit_pos) {
gnome_canvas_item_move (group, new_unit_pos - old_unit_pos, 0.0) ; group->move (new_unit_pos - old_unit_pos, 0.0);
} }
if (delta) { if (delta) {
@ -263,7 +252,7 @@ TimeAxisViewItem::set_duration (jack_nframes_t dur, void* src)
} }
if (dur == 0) { if (dur == 0) {
gnome_canvas_item_hide (group); group->hide();
} }
item_duration = dur; item_duration = dur;
@ -307,7 +296,7 @@ TimeAxisViewItem::set_max_duration(jack_nframes_t dur, void* src)
jack_nframes_t jack_nframes_t
TimeAxisViewItem::get_max_duration() const TimeAxisViewItem::get_max_duration() const
{ {
return(max_item_duration) ; return (max_item_duration) ;
} }
/** /**
@ -502,7 +491,7 @@ void
TimeAxisViewItem::set_name_text(std::string new_name) TimeAxisViewItem::set_name_text(std::string new_name)
{ {
if (name_text) { if (name_text) {
gnome_canvas_item_set (name_text, "text", new_name.c_str(), NULL); name_text->set_property ("text", new_name.c_str());
} }
} }
@ -516,43 +505,39 @@ TimeAxisViewItem::set_height(double height)
{ {
if (name_highlight) { if (name_highlight) {
if (height < NAME_HIGHLIGHT_THRESH) { if (height < NAME_HIGHLIGHT_THRESH) {
gnome_canvas_item_hide (name_highlight); name_highlight->hide();
gnome_canvas_item_hide (name_text); name_text->hide();
} else { } else {
gnome_canvas_item_show (name_highlight); name_highlight->show();
gnome_canvas_item_show (name_text); name_text->show();
} }
if (height > NAME_HIGHLIGHT_SIZE) { if (height > NAME_HIGHLIGHT_SIZE) {
gnome_canvas_item_set (name_highlight, name_highlight->set_property ("y1", (double) height+1 - NAME_HIGHLIGHT_SIZE);
"y1", (double) height+1 - NAME_HIGHLIGHT_SIZE, name_highlight->set_property ("y2", (double) height);
"y2", (double) height,
NULL);
} }
else { else {
/* it gets hidden now anyway */ /* it gets hidden now anyway */
gnome_canvas_item_set (name_highlight, name_highlight->set_property ("y1", (double) 1.0);
"y1", (double) 1.0, name_highlight->set_property ("y2", (double) height);
"y2", (double) height,
NULL);
} }
} }
if (name_text) { if (name_text) {
gnome_canvas_item_set (name_text, "y", height+1 - NAME_Y_OFFSET, NULL); name_text->set ("y", height+1 - NAME_Y_OFFSET, NULL);
if (height < NAME_HIGHLIGHT_THRESH) { if (height < NAME_HIGHLIGHT_THRESH) {
gnome_canvas_item_set(name_text, "fill_color_rgba", fill_color, NULL) ; name_text->set_property ("fill_color_rgba", fill_color, NULL) ;
} }
else { else {
gnome_canvas_item_set(name_text, "fill_color_rgba", label_color, NULL) ; name_text->set_property ("fill_color_rgba", label_color, NULL) ;
} }
} }
if (frame) { if (frame) {
gnome_canvas_item_set (frame, "y2", height+1, NULL) ; frame->set_property ("y2", height+1, NULL) ;
} }
gnome_canvas_item_set (vestigial_frame, "y2", height+1, NULL) ; vestigial_frame->set_property ("y2", height+1, NULL) ;
} }
/** /**
@ -706,23 +691,20 @@ TimeAxisViewItem::set_colors()
double height = NAME_HIGHLIGHT_THRESH; double height = NAME_HIGHLIGHT_THRESH;
if (frame) { if (frame) {
GtkArg args[1] ; frame->get_property ("y2", &height);
args[0].name = "y2" ;
gtk_object_getv (GTK_OBJECT(frame), 1, args);
height = GTK_VALUE_DOUBLE (args[0]);
} }
if (height < NAME_HIGHLIGHT_THRESH) { if (height < NAME_HIGHLIGHT_THRESH) {
gnome_canvas_item_set(name_text, "fill_color_rgba", fill_color, NULL) ; name_text->set_property ("fill_color_rgba", fill_color);
} }
else { else {
gnome_canvas_item_set(name_text, "fill_color_rgba", label_color, NULL) ; name_text->set_property ("fill_color_rgba", label_color);
} }
} }
if (name_highlight) { if (name_highlight) {
gnome_canvas_item_set(name_highlight, "fill_color_rgba", fill_color, NULL) ; name_highlight->set_property ("fill_color_rgba", fill_color);
gnome_canvas_item_set(name_highlight, "outline_color_rgba", fill_color, NULL) ; name_highlight->set_property ("outline_color_rgba", fill_color);
} }
set_trim_handle_colors() ; set_trim_handle_colors() ;
} }
@ -738,10 +720,10 @@ TimeAxisViewItem::set_frame_color()
if (_selected && should_show_selection) { if (_selected && should_show_selection) {
UINT_TO_RGBA(color_map[cSelectedFrameBase], &r, &g, &b, &a); UINT_TO_RGBA(color_map[cSelectedFrameBase], &r, &g, &b, &a);
gnome_canvas_item_set(frame, "fill_color_rgba", RGBA_TO_UINT(r, g, b, fill_opacity), NULL) ; frame->set_property ("fill_color_rgba", RGBA_TO_UINT(r, g, b, fill_opacity));
} else { } else {
UINT_TO_RGBA(color_map[cFrameBase], &r, &g, &b, &a); UINT_TO_RGBA(color_map[cFrameBase], &r, &g, &b, &a);
gnome_canvas_item_set(frame, "fill_color_rgba", RGBA_TO_UINT(r, g, b, fill_opacity), NULL) ; frame->set_property ("fill_color_rgba", RGBA_TO_UINT(r, g, b, fill_opacity));
} }
} }
} }
@ -755,11 +737,11 @@ TimeAxisViewItem::set_trim_handle_colors()
{ {
if (frame_handle_start) { if (frame_handle_start) {
if (position_locked) { if (position_locked) {
gnome_canvas_item_set(frame_handle_start, "fill_color_rgba", color_map[cTrimHandleLockedStart], NULL); frame_handle_start->set_property ("fill_color_rgba", color_map[cTrimHandleLockedStart]);
gnome_canvas_item_set(frame_handle_end, "fill_color_rgba", color_map[cTrimHandleLockedEnd], NULL) ; frame_handle_end->set_property ("fill_color_rgba", color_map[cTrimHandleLockedEnd]);
} else { } else {
gnome_canvas_item_set(frame_handle_start, "fill_color_rgba", color_map[cTrimHandleStart], NULL) ; frame_handle_start->set_property ("fill_color_rgba", color_map[cTrimHandleStart]);
gnome_canvas_item_set(frame_handle_end, "fill_color_rgba", color_map[cTrimHandleEnd], NULL) ; frame_handle_end->set_property ("fill_color_rgba", color_map[cTrimHandleEnd]);
} }
} }
} }
@ -784,66 +766,62 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
if (pixel_width < GRAB_HANDLE_LENGTH * 2) { if (pixel_width < GRAB_HANDLE_LENGTH * 2) {
if (frame_handle_start) { if (frame_handle_start) {
gnome_canvas_item_hide (frame_handle_start); frame_handle_start->hide();
gnome_canvas_item_hide (frame_handle_end); frame_handle_end->hide();
} }
} if (pixel_width < 2.0) { } if (pixel_width < 2.0) {
if (show_vestigial) { if (show_vestigial) {
gnome_canvas_item_show (vestigial_frame); vestigial_frame->hide ();
} }
if (name_highlight) { if (name_highlight) {
gnome_canvas_item_hide (name_highlight); name_highlight->hide();
gnome_canvas_item_hide (name_text); name_text->hide();
} }
if (frame) { if (frame) {
gnome_canvas_item_hide (frame); frame->hide ();
} }
if (frame_handle_start) { if (frame_handle_start) {
gnome_canvas_item_hide (frame_handle_start); frame_handle_start->hide();
gnome_canvas_item_hide (frame_handle_end); frame_handle_end->hide();
} }
} else { } else {
gnome_canvas_item_hide (vestigial_frame); vestigial_frame->hide();
if (name_highlight) { if (name_highlight) {
GtkArg args[1] ; name_highlight->get_property ("y2", &height);
args[0].name = "y2" ;
gtk_object_getv (GTK_OBJECT(name_highlight), 1, args);
double height = GTK_VALUE_DOUBLE (args[0]);
if (height < NAME_HIGHLIGHT_THRESH) { if (height < NAME_HIGHLIGHT_THRESH) {
gnome_canvas_item_hide (name_highlight); name_highlight->hide();
gnome_canvas_item_hide (name_text); name_text->hide();
} else { } else {
gnome_canvas_item_show (name_highlight); name_highlight->show();
gnome_canvas_item_show (name_text); name_text->show();
reset_name_width (pixel_width); reset_name_width (pixel_width);
} }
gnome_canvas_item_set (name_highlight, "x2", pixel_width - 1.0, NULL); name_highlight->set_property ("x1", pixel_width - 1.0, NULL);
} }
if (frame) { if (frame) {
gnome_canvas_item_show (frame); frame->show();
gnome_canvas_item_set (frame, "x2", pixel_width, NULL); frame->set_property ("x2", pixel_width, NULL);
} }
if (frame_handle_start) { if (frame_handle_start) {
if (pixel_width < (2*TimeAxisViewItem::GRAB_HANDLE_LENGTH)) { if (pixel_width < (2*TimeAxisViewItem::GRAB_HANDLE_LENGTH)) {
gnome_canvas_item_hide (frame_handle_start); frame_handle_start->hide();
gnome_canvas_item_hide (frame_handle_end); frame_handle_end->hide();
} }
gnome_canvas_item_show (frame_handle_start); frame_handle_end->set_property ("x1", pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH ), NULL) ;
gnome_canvas_item_set(GNOME_CANVAS_ITEM(frame_handle_end), "x1", pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH ), NULL) ; frame_handle_end->show();
gnome_canvas_item_show (frame_handle_end); frame_handle_end->set_property ("x2", pixel_width, NULL) ;
gnome_canvas_item_set(GNOME_CANVAS_ITEM(frame_handle_end), "x2", pixel_width, NULL) ;
} }
} }
} }
@ -851,12 +829,9 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
void void
TimeAxisViewItem::reset_name_width (double pixel_width) TimeAxisViewItem::reset_name_width (double pixel_width)
{ {
gint width; int width;
gint lbearing; int height;
gint rbearing; FontDescription fd (NAME_FONT);
gint ascent;
gint descent;
Gdk_Font font (NAME_FONT);
if (name_text == 0) { if (name_text == 0) {
return; return;
@ -866,15 +841,13 @@ TimeAxisViewItem::reset_name_width (double pixel_width)
char cstr[namelen+1]; char cstr[namelen+1];
strcpy (cstr, item_name.c_str()); strcpy (cstr, item_name.c_str());
RefPtr<Pango::Layout> layout = group.get_canvas()->create_pango_layout();
layout->set_font_description (fd);
while (namelen) { while (namelen) {
gdk_string_extents (font, layout->set_text (cstr);
cstr, layout->get_pixel_size (width, height);
&lbearing,
&rbearing,
&width,
&ascent,
&descent);
if (width < (pixel_width - NAME_X_OFFSET)) { if (width < (pixel_width - NAME_X_OFFSET)) {
break; break;
@ -887,7 +860,7 @@ TimeAxisViewItem::reset_name_width (double pixel_width)
if (namelen == 0) { if (namelen == 0) {
gnome_canvas_item_hide (name_text); name_text->hide ();
} else { } else {
@ -905,8 +878,8 @@ TimeAxisViewItem::reset_name_width (double pixel_width)
} }
} }
gnome_canvas_item_set (name_text, "text", cstr, NULL); name_text->set_property ("text", cstr);
gnome_canvas_item_show (name_text); name_text->show();
} }
} }
@ -939,7 +912,7 @@ TimeAxisViewItem::remove_this_item(void* src)
* This is used to avoid deleting the obejct while inside the remove_this_item * This is used to avoid deleting the obejct while inside the remove_this_item
* method * method
* *
* @param item the ImageFrameTimeAxisGroup to remove * @param item the TimeAxisViewItem to remove
* @param src the identity of the object that initiated the change * @param src the identity of the object that initiated the change
*/ */
gint gint

View file

@ -22,11 +22,13 @@
#define __gtk_ardour_time_axis_view_item_h__ #define __gtk_ardour_time_axis_view_item_h__
#include <sigc++/signal.h> #include <sigc++/signal.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include <jack/jack.h> #include <jack/jack.h>
#include <string> #include <string>
#include <libgnomecanvasmm/text.h>
#include "selectable.h" #include "selectable.h"
#include "simplerect.h"
class TimeAxisView; class TimeAxisView;
@ -220,22 +222,22 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable
/** /**
* *
*/ */
GnomeCanvasItem* get_canvas_frame() ; Gnome::Canvas::Item* get_canvas_frame() ;
/** /**
* *
*/ */
GnomeCanvasItem* get_canvas_group(); Gnome::Canvas::Item* get_canvas_group();
/** /**
* *
*/ */
GnomeCanvasItem* get_name_highlight(); Gnome::Canvas::Item* get_name_highlight();
/** /**
* *
*/ */
GnomeCanvasItem* get_name_text(); Gnome::Canvas::Item* get_name_text();
/** /**
* Sets the samples per unit of this item. * Sets the samples per unit of this item.
@ -335,7 +337,7 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable
* @param start the start point of this item * @param start the start point of this item
* @param duration the duration of this item * @param duration the duration of this item
*/ */
TimeAxisViewItem(std::string it_name, GnomeCanvasGroup* parent, TimeAxisView& tv, double spu, Gdk::Color& base_color, TimeAxisViewItem(std::string it_name, Gnome::Canvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color,
jack_nframes_t start, jack_nframes_t duration, Visibility v = Visibility (0)); jack_nframes_t start, jack_nframes_t duration, Visibility v = Visibility (0));
/** /**
@ -441,13 +443,13 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable
uint32_t lock_handle_color_g ; uint32_t lock_handle_color_g ;
uint32_t lock_handle_color_b ; uint32_t lock_handle_color_b ;
GnomeCanvasItem* group ; /* the group */ Gnome::Canvas::Group* group;
GnomeCanvasItem* vestigial_frame ; /* simplerect */ Gnome::Canvas::SimpleRect* vestigial_frame;
GnomeCanvasItem* frame ; /* simplerect */ Gnome::Canvas::SimpleRect* frame;
GnomeCanvasItem* name_text ; /* text */ Gnome::Canvas::Text* name_text;
GnomeCanvasItem* name_highlight ; /* simplerect */ Gnome::Canvas::SimpleRect* name_highlight;
GnomeCanvasItem* frame_handle_start ; /* simplerect */ Gnome::Canvas::SimpleRect* frame_handle_start;
GnomeCanvasItem* frame_handle_end ; /* simplerect */ Gnome::Canvas::SimpleRect* frame_handle_end;
}; /* class TimeAxisViewItem */ }; /* class TimeAxisViewItem */