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
axis_view.cc
canvas-imageframe.c
imageframe.cc
canvas-simpleline.c
simpleline.cc
canvas-simplerect.c
simplerect.cc
canvas-waveview.c
waveview.cc
crossfade_edit.cc
crossfade_view.cc
curvetest.cc

View File

@ -9,7 +9,6 @@ using namespace std;
using namespace Gtk;
using namespace Glib;
using namespace sigc;
using namespace ActionManager;
vector<Glib::RefPtr<Gtk::Action> > ActionManager::session_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::jack_sensitive_actions;
namespace ActionManager {
static vector<Glib::RefPtr<UIManager> > ui_managers;
void
@ -45,6 +46,17 @@ register_action (RefPtr<ActionGroup> group, string name, string label, slot<void
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>
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;
}
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)
{
GtkAccelKey gkey;

View File

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

View File

@ -135,7 +135,7 @@ class CrossfadeEditor : public ArdourDialog
gint point_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);
Point* make_point ();
void redraw ();

View File

@ -890,13 +890,13 @@ Editor::initialize_canvas ()
transport_bar_drag_rect->set_property ("outline_pixels", 0);
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->set_property ("width_pixels", 1);
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();
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->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
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->hide();
tempo_bar->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_tempo_bar_event));
meter_bar->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_meter_bar_event));
marker_bar->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_marker_bar_event));
range_marker_bar->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_range_marker_bar_event));
transport_marker_bar->signal_event().connect (mem_fun (*this, &PublicEditor::canvas_transport_marker_bar_event));
tempo_bar->signal_event().connect (mem_fun (*this, &Editor::canvas_tempo_bar_event));
meter_bar->signal_event().connect (mem_fun (*this, &Editor::canvas_meter_bar_event));
marker_bar->signal_event().connect (mem_fun (*this, &Editor::canvas_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, &Editor::canvas_transport_marker_bar_event));
/* separator lines */
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(0, 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->set_property ("width_pixels", 0);
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(max_canvas_coordinate, 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 = new Gnome::Canvas::Line (*meter_group, *meter_line_points);
meter_line->set_property ("width_pixels", 0);
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(max_canvas_coordinate, 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 = new Gnome::Canvas::Line (*marker_group, *marker_line_points);
marker_line->set_property ("width_pixels", 0);
@ -988,8 +988,8 @@ Editor::initialize_canvas ()
double time_width = FLT_MAX/frames_per_unit;
time_canvas.set_scroll_region(0.0, 0.0, time_width, time_height);
edit_cursor = new Cursor (*this, "blue", (GtkSignalFunc) _canvas_edit_cursor_event);
playhead_cursor = new Cursor (*this, "red", (GtkSignalFunc) _canvas_playhead_cursor_event);
edit_cursor = new Cursor (*this, "blue", canvas_edit_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));
}
@ -1342,29 +1342,32 @@ Editor::reset_scrolling_region (GtkAllocation *alloc)
if (playhead_cursor) playhead_cursor->set_length (canvas_alloc_height);
if (marker_drag_line) {
marker_drag_line_points->coords[3] = canvas_height;
// cerr << "set mlA points, nc = " << marker_drag_line_points->num_points << endl;
marker_drag_line->set_property("points", marker_drag_line_points);
marker_drag_line_points[1].set_y (canvas_height);
marker_drag_line->set_property("points", marker_drag_line_points.gobj());
}
if (range_marker_drag_rect) {
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("y1", 0.0);
range_marker_drag_rect->set_property("y2", (double) canvas_height);
}
if (transport_loop_range_rect) {
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("y1", 0.0);
transport_loop_range_rect->set_property("y2", (double) canvas_height);
}
if (transport_punch_range_rect) {
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("y1", 0.0);
transport_punch_range_rect->set_property("y2", (double) canvas_height);
}
if (transport_punchin_line) {
transport_punchin_line->set_property("y1", 0.0);
transport_punchin_line->set_property("y2", (double) canvas_height);
transport_punchin_line->set_property("y1", 0.0);
transport_punchin_line->set_property("y2", (double) canvas_height);
}
if (transport_punchout_line) {
transport_punchout_line->set_property("y1", 0.0);
transport_punchout_line->set_property("y2", (double) canvas_height);
transport_punchout_line->set_property("y1", 0.0);
transport_punchout_line->set_property("y2", (double) canvas_height);
}
update_fixed_rulers ();
@ -1644,7 +1647,8 @@ Editor::connect_to_session (Session *t)
route_display_model.clear ();
session->foreach_route (this, &Editor::handle_new_route);
// route_list.select_all ();
route_list.sort ();
// GTK2FIX
//route_list.sort ();
route_list_reordered ();
//route_list.thaw ();
@ -1709,48 +1713,53 @@ Editor::connect_to_session (Session *t)
void
Editor::build_cursors ()
{
Glib::RefPtr <Gdk::Pixmap> source, mask;
Gdk::Color fg ("#ff0000"); /* Red. */
Gdk::Color bg ("#0000ff"); /* Blue. */
Gdk::Pixmap::create_from_data (source, hand_bits,
hand_width, hand_height, 1, fg, bg);
Gdk::Pixmap::create_from_data(mask, handmask_bits,
handmask_width, handmask_height, 1, fg, bg);
grabber_cursor = new Gdk::Cursor (source, mask, fg, bg, hand_x_hot, hand_y_hot);
source->unreference();
mask->unreference();
{
Glib::RefPtr <Gdk::Pixmap> source, mask;
source = Gdk::Pixmap::create_from_data (source, hand_bits,
hand_width, hand_height, 1, fg, bg);
Gdk::Pixmap::create_from_data(mask, handmask_bits,
handmask_width, handmask_height, 1, fg, bg);
grabber_cursor = new Gdk::Cursor (source, mask, fg, bg, hand_x_hot, hand_y_hot);
}
Gdk::Color mbg ("#000000" ); /* Black */
Gdk::Color mfg ("#0000ff" ); /* Blue. */
Gdk::Pixmap::create_from_data (source, mag_bits,
mag_width, mag_height, 1, fg, bg);
Gdk::Pixmap::create_from_data (mask, magmask_bits,
mag_width, mag_height, 1, fg, bg);
zoom_cursor = new Gdk::Cursor (source, mask, mfg, mbg, mag_x_hot, mag_y_hot);
source->unreference();
mask->unreference();
{
Glib::RefPtr <Gdk::Pixmap> source, mask;
Gdk::Pixmap::create_from_data (source, mag_bits,
mag_width, mag_height, 1, fg, bg);
Gdk::Pixmap::create_from_data (mask, magmask_bits,
mag_width, mag_height, 1, fg, bg);
zoom_cursor = new Gdk::Cursor (source, mask, mfg, mbg, mag_x_hot, mag_y_hot);
}
Gdk::Color fbg ("#ffffff" );
Gdk::Color ffg ("#000000" );
Gdk::Pixmap::create_from_data (source, fader_cursor_bits,
fader_cursor_width, fader_cursor_height, 1, fg, bg);
Gdk::Pixmap::create_from_data (mask, fader_cursor_mask_bits,
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);
source->unreference();
mask->unreference();
{
Glib::RefPtr <Gdk::Pixmap> source, mask;
Gdk::Pixmap::create_from_data (source, fader_cursor_bits,
fader_cursor_width, fader_cursor_height, 1, fg, bg);
Gdk::Pixmap::create_from_data (mask, fader_cursor_mask_bits,
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);
}
{
Glib::RefPtr <Gdk::Pixmap> source, mask;
Gdk::Pixmap::create_from_data (source,speaker_cursor_bits,
speaker_cursor_width, speaker_cursor_height, 1, fg, bg);
Gdk::Pixmap::create_from_data (mask, speaker_cursor_mask_bits,
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);
}
Gdk::Pixmap::create_from_data (source,speaker_cursor_bits,
speaker_cursor_width, speaker_cursor_height, 1, fg, bg);
Gdk::Pixmap::create_from_data (mask, speaker_cursor_mask_bits,
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);
source->unreference();
mask->unreference();
cross_hair_cursor = new Gdk::Cursor (Gdk::CROSSHAIR);
trimmer_cursor = new Gdk::Cursor (Gdk::SB_H_DOUBLE_ARROW);
selector_cursor = new Gdk::Cursor (Gdk::XTERM);
@ -2489,7 +2498,8 @@ Editor::set_state (const XMLNode& node)
}
set_default_size(width, height);
set_position(x, y-yoff);
// GTK2FIX
// set_position(x, y-yoff);
if ((prop = node.property ("zoom-focus"))) {
set_zoom_focus ((ZoomFocus) atoi (prop->value()));
@ -2882,9 +2892,9 @@ Editor::setup_toolbar ()
mouse_mode_tearoff->set_name ("MouseModeBase");
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),
static_cast<Gtk::Widget*> (&mouse_mode_button_table), 1));
mmouse_mode_tearoff->tearoff_window(), 1));
mouse_move_button.set_name ("MouseModeButton");
mouse_select_button.set_name ("MouseModeButton");
@ -3070,9 +3080,10 @@ Editor::setup_toolbar ()
tools_tearoff->set_name ("MouseModeBase");
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),
static_cast<Gtk::Widget*> (hbox), 0));
tools_tearoff->tearoff_window(), 0));
toolbar_hbox.set_spacing (8);
toolbar_hbox.set_border_width (2);
@ -3668,7 +3679,7 @@ void
Editor::set_edit_menu (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
@ -3808,8 +3819,9 @@ Editor::duplicate_dialog (bool dup_region)
entry.select_region (0, entry.get_text_length());
win.set_position (Gtk::WIN_POS_MOUSE);
win.realize ();
win.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
// GTK2FIX
// win.realize ();
// win.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
entry.grab_focus ();
@ -4151,7 +4163,7 @@ Editor::ensure_float (Window& win)
}
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
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
Editor::detach_tearoff (Gtk::Box* b, Gtk::Widget* w)
Editor::detach_tearoff (Gtk::Box* b, Gtk::Window* w)
{
if (tools_tearoff->torn_off() &&
mouse_mode_tearoff->torn_off()) {
top_hbox.remove (toolbar_frame);
}
ensure_float (*w->get_toplevel());
ensure_float (*w);
}
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) {
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.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 ();
@ -4377,8 +4390,9 @@ Editor::playlist_deletion_dialog (Playlist* pl)
keep_button.signal_clicked().connect (bind (mem_fun (dialog, &ArdourDialog::stop), 1));
abort_button.signal_clicked().connect (bind (mem_fun (dialog, &ArdourDialog::stop), 2));
dialog.realize ();
dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
// GTK2FIX
// dialog.realize ();
// dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
dialog.run ();

View File

@ -34,9 +34,6 @@
#include <gtkmm/layout.h>
#include <gtkmm/comboboxtext.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include <libgnomecanvas/gnome-canvas-util.h>
#include <libgnomecanvasmm/canvas.h>
#include <libgnomecanvasmm/polygon.h>
#include <libgnomecanvasmm/text.h>
@ -379,7 +376,7 @@ class Editor : public PublicEditor
Editing::MouseMode mouse_mode;
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 track_list_canvas_pane;
@ -587,11 +584,11 @@ class Editor : public PublicEditor
Gnome::Canvas::Line* range_marker_line;
Gnome::Canvas::Line* transport_marker_line;
Gnome::Canvas::Points* tempo_line_points;
Gnome::Canvas::Points* meter_line_points;
Gnome::Canvas::Points* marker_line_points;
Gnome::Canvas::Points* range_marker_line_points;
Gnome::Canvas::Points* transport_marker_line_points;
Gnome::Canvas::Points tempo_line_points;
Gnome::Canvas::Points meter_line_points;
Gnome::Canvas::Points marker_line_points;
Gnome::Canvas::Points range_marker_line_points;
Gnome::Canvas::Points transport_marker_line_points;
Gtk::Label minsec_label;
Gtk::Label bbt_label;
@ -608,19 +605,18 @@ class Editor : public PublicEditor
Gtk::HBox time_button_hbox;
struct Cursor {
Editor& editor;
Gnome::Canvas::Points* points;
Gnome::Canvas::Item* canvas_item;
jack_nframes_t current_frame;
GtkSignalFunc callback;
double length;
Editor& editor;
Gnome::Canvas::Points points;
Gnome::Canvas::Item* canvas_item;
jack_nframes_t current_frame;
double length;
Cursor (Editor&, const string& color, GtkSignalFunc callback);
Cursor (Editor&, const string& color, bool (Editor::*)(GdkEvent*));
~Cursor ();
void set_position (jack_nframes_t);
void set_length (double units);
void set_y_axis (double position);
void set_y_axis (double position);
};
friend struct Cursor; /* it needs access to several private
@ -670,7 +666,7 @@ class Editor : public PublicEditor
bool edit_hscroll_dragging;
double edit_hscroll_drag_last;
void hscroll_slider_allocate (GtkAllocation *);
void hscroll_slider_allocate (Gtk::Allocation &);
gint hscroll_slider_expose (GdkEventExpose*);
gint hscroll_slider_button_press (GdkEventButton*);
gint hscroll_slider_button_release (GdkEventButton*);
@ -1454,11 +1450,11 @@ class Editor : public PublicEditor
void end_range_markerbar_op (GnomeCanvasItem* item, GdkEvent* event);
Gnome::Canvas::Item *range_bar_drag_rect;
Gnome::Canvas::Item *transport_bar_drag_rect;
Gnome::Canvas::Item *marker_drag_line;
Gnome::Canvas::Points *marker_drag_line_points;
Gnome::Canvas::Item *range_marker_drag_rect;
Gnome::Canvas::Item* range_bar_drag_rect;
Gnome::Canvas::Item* transport_bar_drag_rect;
Gnome::Canvas::Item* marker_drag_line;
Gnome::Canvas::Points marker_drag_line_points;
Gnome::Canvas::Item* range_marker_drag_rect;
void update_marker_drag_item (ARDOUR::Location *);
@ -1749,8 +1745,8 @@ class Editor : public PublicEditor
void current_mixer_strip_hidden ();
void current_mixer_strip_removed ();
void detach_tearoff (Gtk::Box* b, Gtk::Widget* w);
void reattach_tearoff (Gtk::Box* b, Gtk::Widget* w, int32_t n);
void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
/* nudging tracks */

View File

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

View File

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

View File

@ -30,38 +30,26 @@ using namespace sigc;
using namespace ARDOUR;
using namespace Gtk;
Editor::Cursor::Cursor (Editor& ed, const string& color, GtkSignalFunc callbck)
: editor (ed), callback (callbck), length(1.0)
Editor::Cursor::Cursor (Editor& ed, const string& color, bool (Editor::*callbck)(GdkEvent*))
: editor (ed), length(1.0)
{
GnomeCanvasGroup *group;
points = gnome_canvas_points_new (2);
/* "randomly" initialize coords */
points.push_back (Gnome::Art::Point (-9383839.0, 0.0));
points.push_back (Gnome::Art::Point (1.0, 0.0));
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);
points->coords[0] = -9383839.0;
points->coords[1] = 0.0;
points->coords[2] = 1.0;
points->coords[3] = 0.0;
group = GNOME_CANVAS_GROUP (editor.cursor_group);
// cerr << "set cursor points, nc = " << points->num_points << endl;
canvas_item = gnome_canvas_item_new (group,
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);
canvas_item->set_data ("cursor", this);
canvas_item->signal_event().connect (slot (ed, callback));
current_frame = 1; /* force redraw at 0 */
}

View File

@ -181,7 +181,7 @@ Editor::edit_group_selection_changed ()
} else {
for (TrackViewList::iterator j = track_views.begin(); j != track_views.end(); ++j) {
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;
void
Editor::hscroll_slider_allocate (GtkAllocation *alloc)
Editor::hscroll_slider_allocate (Gtk::Allocation &alloc)
{
//edit_hscroll_slider_width = alloc->width;
//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.
*/
gnome_canvas_item_raise_to_top(drag_info.item) ;
gnome_canvas_item_raise_to_top(drag_info.last_trackview->canvas_display) ;
//gnome_canvas_item_raise_to_top(time_line_group) ;
gnome_canvas_item_raise_to_top (cursor_group);
drag_info.item->raise_to_top();
drag_info.last_trackview->canvas_display->raise_to_top();
//time_line_group->raise_to_top();
cursor_group->raise_to_top ();
start_grab(event) ;
@ -527,10 +527,10 @@ Editor::start_markerview_grab(GnomeCanvasItem* item, GdkEvent* event)
so move them to the top afterwards.
*/
gnome_canvas_item_raise_to_top(drag_info.item) ;
gnome_canvas_item_raise_to_top(drag_info.last_trackview->canvas_display) ;
//gnome_canvas_item_raise_to_top(time_line_group) ;
gnome_canvas_item_raise_to_top (cursor_group);
drag_info.item->raise_to_top();
drag_info.last_trackview->canvas_display->raise_to_top();
//time_line_group->raise_to_top();
cursor_group->raise_to_top ();
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->set_time_axis_name(track_name, this) ;
track_views.push_back(iftav) ;
const gchar *rowdata[1] ;
rowdata[0] = iftav->name().c_str() ;
route_list.rows().push_back(rowdata) ;
route_list.rows().back().set_data(iftav) ;
route_list.rows().back().select() ;
TreeModel::Row row = *(route_display_mode->append());
row[route_display_columns.text] = iftav->name();
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->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) ;
((ImageFrameTimeAxis*)marked_track)->add_marker_time_axis(mta, this) ;
track_views.push_back(mta) ;
const gchar *rowdata[1] ;
rowdata[0] = mta->name().c_str() ;
route_list.rows().push_back(rowdata) ;
route_list.rows().back().set_data (mta) ;
route_list.rows().back().select() ;
TreeModel::Row row = *(route_display_mode->append());
row[route_display_columns.text] = mta->name();
row[route_display_columns.tv] = mta;
route_list.get_selection()->select (row);
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;
GdkEvent ev;
GdkModifierType mask;
GdkWindow evw (track_canvas.get_window()->get_pointer (x, y, mask));
bool doit = false;
if (use_track_canvas && gdk_window_get_pointer (track_canvas_event_box.get_window()->gobj(),
&x, &y, &mask)) {
doit = true;
/* get the pointer location */
} else if (use_time_canvas && gdk_window_get_pointer (time_canvas_event_box.get_window()->gobj(),
&x, &y, &mask)) {
RefPtr<GdkWindow> notused (track_canvas.get_window()->get_pointer (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;
}

View File

@ -926,7 +926,7 @@ Editor::button_release_handler (GnomeCanvasItem* item, GdkEvent* event, ItemType
break;
case MarkerItem:
remove_marker (item, &event);
remove_marker (item, event);
break;
case RegionItem:
@ -1941,9 +1941,9 @@ Editor::update_marker_drag_item (Location *location)
double x2 = frame_to_pixel (location->end());
if (location->is_mark()) {
marker_drag_line_points->coords[0] = x1;
marker_drag_line_points->coords[2] = x1;
marker_drag_line->set_property ("points", marker_drag_line_points);
marker_drag_line_points[0].set_x (x1);
marker_drag_line_points[1].set_x (x1);
marker_drag_line->set_property ("points", marker_drag_line_points.gobj());
}
else {
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 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())) {
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);
gnome_canvas_item_show (crect);
crect->show ();
update_marker_drag_item (temp_location);
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 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);
}

View File

@ -998,13 +998,15 @@ Editor::scroll_tracks_up ()
void
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
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 */
@ -1461,7 +1463,7 @@ Editor::clear_locations ()
void
Editor::insert_region_list_drag (AudioRegion& region)
{
gint x, y;
double x, y;
double wx, wy;
double cx, cy;
TimeAxisView *tv;
@ -1471,7 +1473,7 @@ Editor::insert_region_list_drag (AudioRegion& region)
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;
event.type = GDK_BUTTON_RELEASE;
@ -1526,13 +1528,14 @@ Editor::insert_region_list_selection (float times)
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;
}
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"));
session->add_undo (playlist->get_memento());
@ -1874,7 +1877,7 @@ Editor::import_progress_timeout (void *arg)
}
if (import_status.doing_what == "building peak files") {
interthread_progress_bar.set_activity_mode (true);
interthread_progress_bar.pulse ();
return FALSE;
} else {
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 ();
/* 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 */
Gtk::CTree_Helpers::RowList::iterator external_node;
external_node = region_list_display.rows().begin();
++external_node; /* its the second node, always */
external_node->expand_recursive ();
/* its the second node, always */
// GTK2FIX ?? is it still always the 2nd node
TreeModel::Path path ("2");
region_list_display.expand_row (path, true);
ARDOUR_UI::instance()->flush_pending ();
}
out:
track_canvas_scroller.get_window()->set_cursor (current_canvas_cursor);
track_canvas_scroller.get_window()->set_cursor (*current_canvas_cursor);
}
void
@ -2288,7 +2293,7 @@ Editor::insert_sndfile_into (string path, bool multi, AudioTimeAxisView* tv, jac
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 ();
/* 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:
track_canvas_scroller.get_window()->set_cursor (current_canvas_cursor);
track_canvas_scroller.get_window()->set_cursor (*current_canvas_cursor);
return;
}
@ -2598,13 +2603,14 @@ Editor::region_fill_selection ()
Region *region;
Gtk::CTree_Helpers::SelectionList& selected = region_list_display.selection();
if (selected.empty()) {
RefPtr<TreeSelection> selected = region_list_display.get_selection();
if (selected.count_selected_rows() != 1) {
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 end = selection->time[clicked_selection].end;
@ -2918,7 +2924,7 @@ Editor::freeze_route ()
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) {
gtk_main_iteration ();
@ -2927,7 +2933,7 @@ Editor::freeze_route ()
interthread_progress_connection.disconnect ();
interthread_progress_window->hide_all ();
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
@ -3164,11 +3170,11 @@ Editor::paste (float times)
void
Editor::mouse_paste ()
{
gint x, y;
double x, y;
double wx, wy;
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;
event.type = GDK_BUTTON_RELEASE;
@ -3215,14 +3221,17 @@ Editor::paste_internal (jack_nframes_t position, float times)
void
Editor::paste_named_selection (float times)
{
Gtk::CList_Helpers::SelectionList& selected = named_selection_display.selection();
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;
}
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 tmp;
@ -3457,7 +3466,7 @@ Editor::normalize_region ()
begin_reversible_command (_("normalize"));
track_canvas_scroller.get_window()->set_cursor (wait_cursor);
track_canvas_scroller.get_window()->set_cursor (*wait_cursor);
gdk_flush ();
for (AudioRegionSelection::iterator r = selection->audio_regions.begin(); r != selection->audio_regions.end(); ++r) {
@ -3467,7 +3476,7 @@ Editor::normalize_region ()
}
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);
track_canvas_scroller.get_window()->set_cursor (wait_cursor);
track_canvas_scroller.get_window()->set_cursor (*wait_cursor);
gdk_flush ();
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 ();
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

View File

@ -173,14 +173,14 @@ Editor::route_display_selection_changed ()
}
void
Editor::unselect_strip_in_display (TimeAxisView* tv)
Editor::unselect_strip_in_display (TimeAxisView& tv)
{
TreeModel::Children rows = route_display_model->children();
TreeModel::Children::iterator i;
Glib::RefPtr<TreeSelection> selection = route_list.get_selection();
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);
}
}

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;
if (grab_widget) {
Gtk::Main::grab_add (*grab_widget);
grab_widget->add_modal_grab ();
ruler_grabbed_widget = grab_widget;
}
@ -189,7 +189,7 @@ Editor::ruler_button_release (GdkEventButton* ev)
if (ruler_grabbed_widget) {
Gtk::Main::grab_remove (*ruler_grabbed_widget);
ruler_grabbed_widget->remove_modal_grab();
ruler_grabbed_widget = 0;
}
@ -605,8 +605,7 @@ Editor::update_ruler_visibility ()
if (ruler_shown[ruler_time_meter]) {
lab_children.push_back (Element(meter_label, PACK_SHRINK, PACK_START));
gtk_object_getv (GTK_OBJECT(meter_group), 1, args) ;
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
gtk_object_get (GTK_OBJECT(meter_group), "y", &old_unit_pos);
if (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]) {
lab_children.push_back (Element(tempo_label, PACK_SHRINK, PACK_START));
gtk_object_getv (GTK_OBJECT(tempo_group), 1, args) ;
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
gtk_object_get (GTK_OBJECT(tempo_group), "y", &old_unit_pos);
if (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));
gtk_object_getv (GTK_OBJECT(marker_group), 1, args) ;
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
gtk_object_get (GTK_OBJECT(marker_group), "y", &old_unit_pos);
if (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]) {
lab_children.push_back (Element(transport_mark_label, PACK_SHRINK, PACK_START));
gtk_object_getv (GTK_OBJECT(transport_marker_group), 1, args) ;
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
gtk_object_get (GTK_OBJECT(transport_marker_group), "y", &old_unit_pos);
if (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.set_position (Gtk::WIN_POS_MOUSE);
tempo_dialog.realize ();
tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
// GTK2FIX
// tempo_dialog.realize ();
// tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
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.set_position (Gtk::WIN_POS_MOUSE);
meter_dialog.realize ();
meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
// GTK2FIX
// meter_dialog.realize ();
// meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
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.set_position (Gtk::WIN_POS_MOUSE);
meter_dialog.realize ();
meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
// GTK2FIX
// meter_dialog.realize ();
// meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
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.set_position (Gtk::WIN_POS_MOUSE);
tempo_dialog.realize ();
tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
// GTK2FIX
// tempo_dialog.realize ();
// tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
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->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 ();
if (current_timestretch->run_status() != 1) {
current_timestretch->close ();
// GTK2FIX
// current_timestretch->close ();
return 1; /* no error, but we did nothing */
}
@ -161,8 +163,9 @@ Editor::run_timestretch (AudioRegionSelection& regions, float fraction)
}
c.disconnect ();
current_timestretch->close ();
// GTK2FIX
// current_timestretch->close ();
return current_timestretch->status;
}

View File

@ -229,10 +229,10 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev)
double fraction;
GdkWindow win (meter_metric_area.get_window());
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));
Gdk_Font font (meter_metric_area.get_style()->get_font());
Glib::RefPtr<Gdk::Window> win (meter_metric_area.get_window());
Glib::RefPtr<Gdk::GC> fg_gc (meter_metric_area.get_style()->get_fg_gc (Gtk::STATE_NORMAL));
Glib::RefPtr<Gdk::GC> bg_gc (meter_metric_area.get_style()->get_bg_gc (Gtk::STATE_NORMAL));
Pango::FontDescription font (meter_metric_area.get_style()->get_font());
gint x, y, width, height, depth;
gint pos;
int db_points[] = { -50, -10, -3, 0, 6 };
@ -241,7 +241,7 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev)
GdkRectangle base_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.height = height;
@ -249,7 +249,7 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev)
base_rect.y = 0;
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) {
fraction = log_meter (db_points[i]);
@ -257,21 +257,9 @@ GainMeter::meter_metrics_expose (GdkEventExpose *ev)
snprintf (buf, sizeof (buf), "%d", db_points[i]);
gint twidth;
gint lbearing;
gint rbearing;
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));
Glib::RefPtr<Pango::Layout> Layout = meter_metric_area.create_pango_layout(buf);
// GTK2FIX - how to get twidth, ascent
win->draw_layout(fg_gc, width /* - twidth */, pos /* + ascent */, Layout);
}
return TRUE;
@ -434,9 +422,7 @@ GainMeter::setup_meters ()
meters[n].width = width;
meters[n].meter->add_events (Gdk::BUTTON_RELEASE_MASK);
meters[n].meter->signal_button_release_event().connect
(bind (mem_fun(*this, &GainMeter::meter_button_release), n));
meters[n].meter->signal_button_release_event().connect_after (ptr_fun (do_not_propagate));
meters[n].meter->signal_button_release_event().connect (bind (mem_fun(*this, &GainMeter::meter_button_release), n));
}
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_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_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));
@ -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_out_event().connect (ptr_fun (ARDOUR_UI::generic_focus_out_event));
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_window->add (comment_area);
@ -1153,11 +1149,11 @@ MixerStrip::comment_changed (void *src)
if (src != this) {
ignore_comment_edit = true;
comment_area.freeze ();
// comment_area.freeze ();
//comment_area.get_buffer()->delete_text (0, -1);
//comment_area.set_point (0);
comment_area.get_buffer()->set_text (_route.comment());
comment_area.thaw ();
// comment_area.thaw ();
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_position (Gtk::WIN_POS_MOUSE);
set_keyboard_input (true);
set_policy (false, true, false);
// GTK2FIX
// set_policy (false, true, false);
set_modal (true);
/* sample rate */

View File

@ -950,9 +950,6 @@ OptionEditor::setup_midi_options ()
int n;
ToggleButton* tb;
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));
@ -1012,9 +1009,9 @@ OptionEditor::setup_midi_options ()
newpair.second.push_back (rb);
rb->set_name ("OptionEditorToggleButton");
if (n == 0) {
first_mtc_button = rb;
mtc_button_group = rb->get_group();
} 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);
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);
rb->set_name ("OptionEditorToggleButton");
if (n == 0) {
first_mmc_button = rb;
mmc_button_group = rb->get_group();
} 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);
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);
rb->set_name ("OptionEditorToggleButton");
if (n == 0) {
first_midi_button = rb;
midi_button_group = rb->get_group();
} 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);
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_border_width (8);
auto_connect_output_manual_button.set_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_button_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);
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
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

View File

@ -169,6 +169,10 @@ class OptionEditor : public ArdourDialog
Gtk::CheckButton midi_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 mmc_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_master_button;
Gtk::RadioButton auto_connect_output_manual_button;
Gtk::RadioButton::Group auto_connect_output_button_group;
Gtk::CheckButton hw_monitor_button;
Gtk::CheckButton sw_monitor_button;

View File

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

View File

@ -85,6 +85,9 @@ static const gchar * revdblarrow_xpm[] = {
PannerUI::PannerUI (IO& io, Session& s)
: _io (io),
_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_down_arrow (Gtk::ARROW_DOWN, Gtk::SHADOW_OUT),
panning_link_button (_("link"))

View File

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

View File

@ -121,6 +121,9 @@ PluginUI::PluginUI (AudioEngine &engine, PluginInsert& pi, bool scrollable)
engine(engine),
button_table (initial_button_rows, initial_button_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),
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->set_value_in_list(true, false);
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);
plugin.ParameterChanged.connect (bind (mem_fun(*this, &PluginUI::parameter_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));
control_ui->pack_start(control_ui->label, true, 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)
{
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));
_pluginui->stop_updating(0);
_pluginui->stop_updating();
delete_when_idle (this);
}
@ -786,24 +789,22 @@ PluginUI::redirect_active_changed (Redirect* r, void* src)
bypass_button.set_active (!r->active());
}
gint
PluginUI::start_updating (GdkEventAny *ev)
void
PluginUI::start_updating ()
{
if (output_controls.size() > 0 ) {
screen_update_connection.disconnect();
screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect
(mem_fun(*this, &PluginUI::output_update));
}
return FALSE;
}
gint
PluginUI::stop_updating (GdkEventAny *ev)
void
PluginUI::stop_updating ()
{
if (output_controls.size() > 0 ) {
screen_update_connection.disconnect();
}
return FALSE;
}
void
@ -840,10 +841,10 @@ PluginUI::output_update ()
}
}
list<string>
vector<string>
PluginUI::setup_scale_values(guint32 port_index, ControlUI* cui)
{
list<string> enums;
vector<string> enums;
LadspaPlugin* lp = dynamic_cast<LadspaPlugin*> (&plugin);
cui->combo_map = new std::map<string, float>;

View File

@ -71,8 +71,8 @@ class PlugUIBase : public sigc::trackable
virtual ~PlugUIBase() {}
virtual gint get_preferred_height () = 0;
virtual gint start_updating(GdkEventAny*) = 0;
virtual gint stop_updating(GdkEventAny*) = 0;
virtual void start_updating() = 0;
virtual void stop_updating() = 0;
protected:
ARDOUR::PluginInsert& insert;
@ -94,8 +94,8 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
gint get_preferred_height () { return prefheight; }
gint start_updating(GdkEventAny*);
gint stop_updating(GdkEventAny*);
void start_updating();
void stop_updating();
private:
ARDOUR::AudioEngine &engine;
@ -108,6 +108,8 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
Gtk::Table output_table;
Gtk::ScrolledWindow scroller;
Gtk::Adjustment hAdjustment;
Gtk::Adjustment vAdjustment;
Gtk::Viewport scroller_view;
Gtk::Label nameinfo_label;
Gtk::Label paraminfo_label;
@ -179,12 +181,12 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
void build (ARDOUR::AudioEngine &);
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 parameter_changed (uint32_t, float, ControlUI* cui);
void update_control_display (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);
void redirect_active_changed (ARDOUR::Redirect*, void*);
@ -222,8 +224,8 @@ class VSTPluginUI : public PlugUIBase, public Gtk::VBox
~VSTPluginUI ();
gint get_preferred_height ();
gint start_updating(GdkEventAny*) { return 0; }
gint stop_updating(GdkEventAny*) { return 0; }
void start_updating() {}
void stop_updating() {}
int package (Gtk::Window&);

View File

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

View File

@ -294,7 +294,7 @@ RouteParams_UI::cleanup_pre_view (bool stopupdate)
PluginUI * plugui = 0;
if (stopupdate && (plugui = dynamic_cast<PluginUI*>(_active_pre_view)) != 0) {
plugui->stop_updating (0);
plugui->stop_updating ();
}
_pre_plugin_conn.disconnect();
@ -311,7 +311,7 @@ RouteParams_UI::cleanup_post_view (bool stopupdate)
PluginUI * plugui = 0;
if (stopupdate && (plugui = dynamic_cast<PluginUI*>(_active_post_view)) != 0) {
plugui->stop_updating (0);
plugui->stop_updating ();
}
_post_plugin_conn.disconnect();
post_redir_hpane.remove(*_active_post_view);
@ -573,7 +573,7 @@ RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement
if (place == PreFader) {
cleanup_pre_view();
_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;
pre_redir_hpane.add2 (*_active_pre_view);
pre_redir_hpane.show_all();
@ -581,7 +581,7 @@ RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement
else {
cleanup_post_view();
_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;
post_redir_hpane.add2 (*_active_post_view);
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)
: Shape(GNOME_CANVAS_SHAPE(g_object_new(get_type(),0)))
: Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
{
item_construct(parentx);
set("x1",x1,"y1",y1,"x2",x2,"y2",y2,0);
}
SimpleRect::SimpleRect(Group& parentx)
: Shape(GNOME_CANVAS_SHAPE(g_object_new(get_type(),0)))
: Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
{
item_construct(parentx);
}
@ -57,7 +57,7 @@ namespace
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));
}
@ -78,7 +78,7 @@ const Glib::Class& SimpleRect_Class::init()
if(!gtype_) // create the GType if necessary
{
// Glib::Class has to know the class init function to clone custom types.
class_init_func_ = &Shape_Class::class_init_function;
class_init_func_ = &SimpleRect_Class::class_init_function;
// This is actually just optimized away, apparently with no harm.
// Make sure that the parent type has been created.
@ -109,14 +109,14 @@ Glib::ObjectBase* SimpleRect_Class::wrap_new(GObject* o)
/* The implementation: */
SimpleRect::SimpleRect(const Glib::ConstructParams& construct_params)
: Shape(construct_params)
: Item(construct_params)
{
}
SimpleRect::SimpleRect(GnomeCanvasSimpleRect* castitem)
: Shape ((GnomeCanvasShape*)(castitem))
: Item ((GnomeCanvasItem*)(castitem))
{
}
}
SimpleRect::~SimpleRect()
{

View File

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

View File

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

View File

@ -195,14 +195,14 @@ class TimeAxisView : public virtual AxisView
*
* @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.
*
*@ 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.

View File

@ -26,8 +26,7 @@
#include "public_editor.h"
#include "time_axis_view_item.h"
#include "time_axis_view.h"
#include "canvas-simplerect.h"
#include "canvas-imageframe.h"
#include "simplerect.h"
#include "utils.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 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,
Visibility visibility)
: trackview (tv)
@ -87,57 +86,53 @@ TimeAxisViewItem::TimeAxisViewItem(std::string it_name, GnomeCanvasGroup* parent
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),
gnome_canvas_simplerect_get_type(),
"x1", (double) 0.0,
"y1", (double) 1.0,
"x2", 2.0,
"y2", (double) trackview.height,
"outline_color_rgba", color_map[cVestigialFrameOutline],
"fill_color_rgba", color_map[cVestigialFrameFill],
NULL);
gnome_canvas_item_hide (vestigial_frame);
vestigial_frame = new Gnome::Canvas::SimpleRect (*group);
vestigial_frame->set_property ("x1", (double) 0.0);
vestigial_frame->set_property ("y1", (double) 1.0);
vestigial_frame->set_property ("x2", 2.0);
vestigial_frame->set_property ("y2", (double) trackview.height);
vestigial_frame->set_property ("outline_color_rgba", color_map[cVestigialFrameOutline]);
vestigial_frame->set_property ("fill_color_rgba", color_map[cVestigialFrameFill]);
vestigial_frame->hide ();
if (visibility & ShowFrame) {
frame = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group),
gnome_canvas_simplerect_get_type(),
"x1", (double) 0.0,
"y1", (double) 1.0,
"x2", (double) trackview.editor.frame_to_pixel(duration),
"y2", (double) trackview.height,
"outline_color_rgba", color_map[cTimeAxisFrameOutline],
"fill_color_rgba", color_map[cTimeAxisFrameFill],
NULL);
frame = new Gnome::Canvas::SimpleRect (*group);
frame->set_property ("x1", (double) 0.0);
frame->set_property ("y1", (double) 1.0);
frame->set_property ("x2", (double) trackview.editor.frame_to_pixel(duration));
frame->set_property ("y2", (double) trackview.height);
frame->set_property ("outline_color_rgba", color_map[cTimeAxisFrameOutline]);
frame->set_property ("fill_color_rgba", color_map[cTimeAxisFrameFill]);
} else {
frame = 0;
}
if (visibility & ShowNameHighlight) {
name_highlight = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group),
gnome_canvas_simplerect_get_type(),
"x1", (double) 1.0,
"x2", (double) (trackview.editor.frame_to_pixel(item_duration)) - 1,
"y1", (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE),
"y2", (double) (trackview.height - 1),
"outline_color_rgba", color_map[cNameHighlightFill],
"fill_color_rgba", color_map[cNameHighlightOutline],
NULL) ;
gtk_object_set_data(GTK_OBJECT(name_highlight), "timeaxisviewitem", this) ;
name_highlight = new Gnome::Canvas::SimpleRect (*group);
name_highlight->set_property ("x1", (double) 1.0);
name_highlight->set_property ("x2", (double) (trackview.editor.frame_to_pixel(item_duration)) - 1);
name_highlight->set_property ("y1", (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE));
name_highlight->set_property ("y2", (double) (trackview.height - 1));
name_highlight->set_property ("outline_color_rgba", color_map[cNameHighlightFill]);
name_highlight->set_property ("fill_color_rgba", color_map[cNameHighlightOutline]);
name_highlight->set_data ("timeaxisviewitem", this);
} else {
name_highlight = 0;
}
if (visibility & ShowNameText) {
name_text = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group),
gnome_canvas_text_get_type(),
"x", (double) TimeAxisViewItem::NAME_X_OFFSET,
"y", (double) trackview.height + 1.0 - TimeAxisViewItem::NAME_Y_OFFSET,
"font", NAME_FONT.c_str(),
"anchor", GTK_ANCHOR_NW,
NULL) ;
gtk_object_set_data(GTK_OBJECT(name_text), "timeaxisviewitem", this) ;
name_text = new Gnome::Canvas::Text (*group);
name_text->set_property ("x", (double) TimeAxisViewItem::NAME_X_OFFSET);
name_text->set_property ("y", (double) trackview.height + 1.0 - TimeAxisViewItem::NAME_Y_OFFSET);
name_text->set_property ("font", NAME_FONT);
name_text->set_property ("anchor", GTK_ANCHOR_NW);
name_text->set_data ("timeaxisviewitem", this);
} else {
name_text = 0;
@ -146,25 +141,22 @@ TimeAxisViewItem::TimeAxisViewItem(std::string it_name, GnomeCanvasGroup* parent
/* create our grab handles used for trimming/duration etc */
if (visibility & ShowHandles) {
frame_handle_start = gnome_canvas_item_new(GNOME_CANVAS_GROUP(group),
gnome_canvas_simplerect_get_type(),
"x1", (double) 0.0,
"x2", (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH,
"y1", (double) 1.0,
"y2", (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH+1,
"outline_color_rgba", color_map[cFrameHandleStartOutline],
"fill_color_rgba", color_map[cFrameHandleStartFill],
NULL) ;
frame_handle_start = new Gnome::Canvas::SimpleRect (*group);
frame_handle_start->set_property ("x1", (double) 0.0);
frame_handle_start->set_property ("x2", (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH);
frame_handle_start->set_property ("y1", (double) 1.0);
frame_handle_start->set_property ("y2", (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH+1);
frame_handle_start->set_property ("outline_color_rgba", color_map[cFrameHandleStartOutline]);
frame_handle_start->set_property ("fill_color_rgba", color_map[cFrameHandleStartFill]);
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) ;
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]);
} else {
frame_handle_start = 0;
frame_handle_end = 0;
@ -182,7 +174,7 @@ TimeAxisViewItem::TimeAxisViewItem(std::string it_name, GnomeCanvasGroup* parent
*/
TimeAxisViewItem::~TimeAxisViewItem()
{
gtk_object_destroy (GTK_OBJECT(group));
delete group;
}
@ -214,23 +206,20 @@ TimeAxisViewItem::set_position(jack_nframes_t pos, void* src, double* delta)
version of GNOME Canvas rectifies this issue cleanly.
*/
GtkArg args[1] ;
double old_unit_pos ;
double new_unit_pos = pos / samples_per_unit ;
args[0].name = "x" ;
gtk_object_getv (GTK_OBJECT(group), 1, args) ;
old_unit_pos = GTK_VALUE_DOUBLE (args[0]) ;
group->get_property ("x", &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) {
(*delta) = new_unit_pos - old_unit_pos;
}
PositionChanged (frame_position, src) ; /* EMIT_SIGNAL */
PositionChanged (frame_position, src) ; /* EMIT_SIGNAL */
return true;
}
@ -263,7 +252,7 @@ TimeAxisViewItem::set_duration (jack_nframes_t dur, void* src)
}
if (dur == 0) {
gnome_canvas_item_hide (group);
group->hide();
}
item_duration = dur;
@ -272,7 +261,7 @@ TimeAxisViewItem::set_duration (jack_nframes_t dur, void* src)
reset_width_dependent_items (pixel_width);
DurationChanged (dur, src) ; /* EMIT_SIGNAL */
DurationChanged (dur, src) ; /* EMIT_SIGNAL */
return true;
}
@ -296,7 +285,7 @@ void
TimeAxisViewItem::set_max_duration(jack_nframes_t dur, void* src)
{
max_item_duration = dur ;
MaxDurationChanged(max_item_duration, src) ; /* EMIT_SIGNAL */
MaxDurationChanged(max_item_duration, src) ; /* EMIT_SIGNAL */
}
/**
@ -307,7 +296,7 @@ TimeAxisViewItem::set_max_duration(jack_nframes_t dur, void* src)
jack_nframes_t
TimeAxisViewItem::get_max_duration() const
{
return(max_item_duration) ;
return (max_item_duration) ;
}
/**
@ -320,7 +309,7 @@ void
TimeAxisViewItem::set_min_duration(jack_nframes_t dur, void* src)
{
min_item_duration = dur ;
MinDurationChanged(max_item_duration, src) ; /* EMIT_SIGNAL */
MinDurationChanged(max_item_duration, src) ; /* EMIT_SIGNAL */
}
/**
@ -502,7 +491,7 @@ void
TimeAxisViewItem::set_name_text(std::string new_name)
{
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 (height < NAME_HIGHLIGHT_THRESH) {
gnome_canvas_item_hide (name_highlight);
gnome_canvas_item_hide (name_text);
name_highlight->hide();
name_text->hide();
} else {
gnome_canvas_item_show (name_highlight);
gnome_canvas_item_show (name_text);
name_highlight->show();
name_text->show();
}
if (height > NAME_HIGHLIGHT_SIZE) {
gnome_canvas_item_set (name_highlight,
"y1", (double) height+1 - NAME_HIGHLIGHT_SIZE,
"y2", (double) height,
NULL);
name_highlight->set_property ("y1", (double) height+1 - NAME_HIGHLIGHT_SIZE);
name_highlight->set_property ("y2", (double) height);
}
else {
/* it gets hidden now anyway */
gnome_canvas_item_set (name_highlight,
"y1", (double) 1.0,
"y2", (double) height,
NULL);
name_highlight->set_property ("y1", (double) 1.0);
name_highlight->set_property ("y2", (double) height);
}
}
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) {
gnome_canvas_item_set(name_text, "fill_color_rgba", fill_color, NULL) ;
name_text->set_property ("fill_color_rgba", fill_color, NULL) ;
}
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) {
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;
if (frame) {
GtkArg args[1] ;
args[0].name = "y2" ;
gtk_object_getv (GTK_OBJECT(frame), 1, args);
height = GTK_VALUE_DOUBLE (args[0]);
frame->get_property ("y2", &height);
}
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 {
gnome_canvas_item_set(name_text, "fill_color_rgba", label_color, NULL) ;
name_text->set_property ("fill_color_rgba", label_color);
}
}
if (name_highlight) {
gnome_canvas_item_set(name_highlight, "fill_color_rgba", fill_color, NULL) ;
gnome_canvas_item_set(name_highlight, "outline_color_rgba", fill_color, NULL) ;
name_highlight->set_property ("fill_color_rgba", fill_color);
name_highlight->set_property ("outline_color_rgba", fill_color);
}
set_trim_handle_colors() ;
}
@ -738,10 +720,10 @@ TimeAxisViewItem::set_frame_color()
if (_selected && should_show_selection) {
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 {
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 (position_locked) {
gnome_canvas_item_set(frame_handle_start, "fill_color_rgba", color_map[cTrimHandleLockedStart], NULL);
gnome_canvas_item_set(frame_handle_end, "fill_color_rgba", color_map[cTrimHandleLockedEnd], NULL) ;
frame_handle_start->set_property ("fill_color_rgba", color_map[cTrimHandleLockedStart]);
frame_handle_end->set_property ("fill_color_rgba", color_map[cTrimHandleLockedEnd]);
} else {
gnome_canvas_item_set(frame_handle_start, "fill_color_rgba", color_map[cTrimHandleStart], NULL) ;
gnome_canvas_item_set(frame_handle_end, "fill_color_rgba", color_map[cTrimHandleEnd], NULL) ;
frame_handle_start->set_property ("fill_color_rgba", color_map[cTrimHandleStart]);
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 (frame_handle_start) {
gnome_canvas_item_hide (frame_handle_start);
gnome_canvas_item_hide (frame_handle_end);
frame_handle_start->hide();
frame_handle_end->hide();
}
} if (pixel_width < 2.0) {
if (show_vestigial) {
gnome_canvas_item_show (vestigial_frame);
vestigial_frame->hide ();
}
if (name_highlight) {
gnome_canvas_item_hide (name_highlight);
gnome_canvas_item_hide (name_text);
name_highlight->hide();
name_text->hide();
}
if (frame) {
gnome_canvas_item_hide (frame);
frame->hide ();
}
if (frame_handle_start) {
gnome_canvas_item_hide (frame_handle_start);
gnome_canvas_item_hide (frame_handle_end);
frame_handle_start->hide();
frame_handle_end->hide();
}
} else {
gnome_canvas_item_hide (vestigial_frame);
vestigial_frame->hide();
if (name_highlight) {
GtkArg args[1] ;
args[0].name = "y2" ;
gtk_object_getv (GTK_OBJECT(name_highlight), 1, args);
double height = GTK_VALUE_DOUBLE (args[0]);
name_highlight->get_property ("y2", &height);
if (height < NAME_HIGHLIGHT_THRESH) {
gnome_canvas_item_hide (name_highlight);
gnome_canvas_item_hide (name_text);
name_highlight->hide();
name_text->hide();
} else {
gnome_canvas_item_show (name_highlight);
gnome_canvas_item_show (name_text);
name_highlight->show();
name_text->show();
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) {
gnome_canvas_item_show (frame);
gnome_canvas_item_set (frame, "x2", pixel_width, NULL);
frame->show();
frame->set_property ("x2", pixel_width, NULL);
}
if (frame_handle_start) {
if (pixel_width < (2*TimeAxisViewItem::GRAB_HANDLE_LENGTH)) {
gnome_canvas_item_hide (frame_handle_start);
gnome_canvas_item_hide (frame_handle_end);
frame_handle_start->hide();
frame_handle_end->hide();
}
gnome_canvas_item_show (frame_handle_start);
gnome_canvas_item_set(GNOME_CANVAS_ITEM(frame_handle_end), "x1", pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH ), NULL) ;
gnome_canvas_item_show (frame_handle_end);
gnome_canvas_item_set(GNOME_CANVAS_ITEM(frame_handle_end), "x2", pixel_width, NULL) ;
frame_handle_end->set_property ("x1", pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH ), NULL) ;
frame_handle_end->show();
frame_handle_end->set_property ("x2", pixel_width, NULL) ;
}
}
}
@ -851,12 +829,9 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
void
TimeAxisViewItem::reset_name_width (double pixel_width)
{
gint width;
gint lbearing;
gint rbearing;
gint ascent;
gint descent;
Gdk_Font font (NAME_FONT);
int width;
int height;
FontDescription fd (NAME_FONT);
if (name_text == 0) {
return;
@ -866,15 +841,13 @@ TimeAxisViewItem::reset_name_width (double pixel_width)
char cstr[namelen+1];
strcpy (cstr, item_name.c_str());
RefPtr<Pango::Layout> layout = group.get_canvas()->create_pango_layout();
layout->set_font_description (fd);
while (namelen) {
gdk_string_extents (font,
cstr,
&lbearing,
&rbearing,
&width,
&ascent,
&descent);
layout->set_text (cstr);
layout->get_pixel_size (width, height);
if (width < (pixel_width - NAME_X_OFFSET)) {
break;
@ -887,7 +860,7 @@ TimeAxisViewItem::reset_name_width (double pixel_width)
if (namelen == 0) {
gnome_canvas_item_hide (name_text);
name_text->hide ();
} else {
@ -905,8 +878,8 @@ TimeAxisViewItem::reset_name_width (double pixel_width)
}
}
gnome_canvas_item_set (name_text, "text", cstr, NULL);
gnome_canvas_item_show (name_text);
name_text->set_property ("text", cstr);
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
* method
*
* @param item the ImageFrameTimeAxisGroup to remove
* @param item the TimeAxisViewItem to remove
* @param src the identity of the object that initiated the change
*/
gint

View File

@ -22,11 +22,13 @@
#define __gtk_ardour_time_axis_view_item_h__
#include <sigc++/signal.h>
#include <libgnomecanvas/libgnomecanvas.h>
#include <jack/jack.h>
#include <string>
#include <libgnomecanvasmm/text.h>
#include "selectable.h"
#include "simplerect.h"
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.
@ -335,7 +337,7 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable
* @param start the start point 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));
/**
@ -441,13 +443,13 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable
uint32_t lock_handle_color_g ;
uint32_t lock_handle_color_b ;
GnomeCanvasItem* group ; /* the group */
GnomeCanvasItem* vestigial_frame ; /* simplerect */
GnomeCanvasItem* frame ; /* simplerect */
GnomeCanvasItem* name_text ; /* text */
GnomeCanvasItem* name_highlight ; /* simplerect */
GnomeCanvasItem* frame_handle_start ; /* simplerect */
GnomeCanvasItem* frame_handle_end ; /* simplerect */
Gnome::Canvas::Group* group;
Gnome::Canvas::SimpleRect* vestigial_frame;
Gnome::Canvas::SimpleRect* frame;
Gnome::Canvas::Text* name_text;
Gnome::Canvas::SimpleRect* name_highlight;
Gnome::Canvas::SimpleRect* frame_handle_start;
Gnome::Canvas::SimpleRect* frame_handle_end;
}; /* class TimeAxisViewItem */