summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-09-04 16:14:01 +0200
committerRobin Gareus <robin@gareus.org>2014-09-04 16:14:01 +0200
commit70358639de97e011abff786a86b712cea283c0a4 (patch)
tree8e1c5f73b2ea4e7c4bd29c325feba99b61df529c /gtk2_ardour
parentdc4ee8196f3cd5c310307152e0ff479e65a808fa (diff)
Revert "cont'd work on automation-track headers (amend ba53af1c5)"
This reverts commit beb5e3e777b0e92e8dde7ee12c324b32c679ff63.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/audio_region_view.cc4
-rw-r--r--gtk2_ardour/automation_time_axis.cc2
-rw-r--r--gtk2_ardour/editor_drag.cc2
-rw-r--r--gtk2_ardour/ghostregion.cc2
-rw-r--r--gtk2_ardour/region_view.cc12
-rw-r--r--gtk2_ardour/streamview.cc4
-rw-r--r--gtk2_ardour/time_axis_view.cc22
-rw-r--r--gtk2_ardour/time_axis_view_item.cc3
8 files changed, 25 insertions, 26 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index 8f5371adad..6c41272d93 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -486,7 +486,7 @@ AudioRegionView::set_height (gdouble height)
ht = (((height - 2 * wcnt) - NAME_HIGHLIGHT_SIZE) / (double) wcnt);
}
- gdouble yoff = 1 + n * (ht + 1);
+ gdouble yoff = n * (ht + 1);
waves[n]->set_height (ht);
waves[n]->set_y_position (yoff + 2);
@@ -1132,7 +1132,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
ht = ((trackview.current_height() - NAME_HIGHLIGHT_SIZE) / (double) nchans);
}
- gdouble yoff = 1 + which * ht;
+ gdouble yoff = which * ht;
WaveView *wave = new WaveView (group, audio_region ());
CANVAS_DEBUG_NAME (wave, string_compose ("wave view for chn %1 of %2", which, get_item_name()));
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index e22e69a9b2..cec3f3a490 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -120,7 +120,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (
CANVAS_DEBUG_NAME (_base_rect, string_compose ("base rect for %1", _name));
_base_rect->set_x1 (ArdourCanvas::COORD_MAX);
_base_rect->set_outline_color (ARDOUR_UI::config()->get_canvasvar_AutomationTrackOutline());
- _base_rect->set_outline_what (ArdourCanvas::Rectangle::TOP);
+ _base_rect->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
_base_rect->set_fill_color (ARDOUR_UI::config()->get_canvasvar_AutomationTrackFill());
_base_rect->set_data ("trackview", this);
_base_rect->Event.connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_automation_track_event), _base_rect, this));
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index c48376b4cb..eb130c5f29 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -769,7 +769,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
if (_brushing) {
_editor->mouse_brush_insert_region (rv, pending_region_position);
} else {
- Duple track_origin (0, 1);
+ Duple track_origin;
/* Get the y coordinate of the top of the track that this region is now over */
track_origin = current_tv->canvas_display()->item_to_canvas (track_origin);
diff --git a/gtk2_ardour/ghostregion.cc b/gtk2_ardour/ghostregion.cc
index 054030b14f..759ffb94d2 100644
--- a/gtk2_ardour/ghostregion.cc
+++ b/gtk2_ardour/ghostregion.cc
@@ -44,7 +44,7 @@ GhostRegion::GhostRegion (ArdourCanvas::Container* parent, TimeAxisView& tv, Tim
{
group = new ArdourCanvas::Container (parent);
CANVAS_DEBUG_NAME (group, "ghost region");
- group->set_position (ArdourCanvas::Duple (initial_pos, 1));
+ group->set_position (ArdourCanvas::Duple (initial_pos, 0));
base_rect = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (base_rect, "ghost region rect");
diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc
index 6cd0bc3a3e..d45164ee42 100644
--- a/gtk2_ardour/region_view.cc
+++ b/gtk2_ardour/region_view.cc
@@ -675,7 +675,7 @@ RegionView::region_sync_changed ()
sync_mark->set (points);
sync_mark->show ();
- sync_line->set (ArdourCanvas::Duple (offset, 0), ArdourCanvas::Duple (offset, trackview.current_height() - NAME_HIGHLIGHT_SIZE - 1));
+ sync_line->set (ArdourCanvas::Duple (offset, 0), ArdourCanvas::Duple (offset, trackview.current_height() - NAME_HIGHLIGHT_SIZE));
sync_line->show ();
}
}
@@ -748,18 +748,16 @@ RegionView::set_height (double h)
sync_line->set (
ArdourCanvas::Duple (offset, 0),
- ArdourCanvas::Duple (offset, h - NAME_HIGHLIGHT_SIZE - 1)
+ ArdourCanvas::Duple (offset, h - NAME_HIGHLIGHT_SIZE)
);
}
for (list<ArdourCanvas::Rectangle*>::iterator i = _coverage_frames.begin(); i != _coverage_frames.end(); ++i) {
- (*i)->set_y0 (1);
- (*i)->set_y1 (h);
+ (*i)->set_y1 (h + 1);
}
for (list<ArdourCanvas::Rectangle*>::iterator i = _silent_frames.begin(); i != _silent_frames.end(); ++i) {
- (*i)->set_y0 (1);
- (*i)->set_y1 (h);
+ (*i)->set_y1 (h + 1);
}
}
@@ -814,7 +812,7 @@ RegionView::update_coverage_frames (LayerDisplay d)
_coverage_frames.push_back (cr);
cr->set_x0 (trackview.editor().sample_to_pixel (t - position));
cr->set_y0 (1);
- cr->set_y1 (_height);
+ cr->set_y1 (_height + 1);
cr->set_outline (false);
cr->set_ignore_events (true);
if (new_me) {
diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc
index a6a4b5d007..9eecc80dd7 100644
--- a/gtk2_ardour/streamview.cc
+++ b/gtk2_ardour/streamview.cc
@@ -72,7 +72,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Container* canvas_g
canvas_rect = new ArdourCanvas::Rectangle (_canvas_group);
CANVAS_DEBUG_NAME (canvas_rect, string_compose ("SV canvas rectangle %1", _trackview.name()));
canvas_rect->set (ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, tv.current_height ()));
- canvas_rect->set_outline_what (ArdourCanvas::Rectangle::TOP);
+ canvas_rect->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
canvas_rect->set_outline_color (RGBA_TO_UINT (0, 0, 0, 255));
canvas_rect->set_fill (true);
canvas_rect->Event.connect (sigc::bind (sigc::mem_fun (_trackview.editor(), &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
@@ -608,7 +608,7 @@ StreamView::update_contents_height ()
case Stacked:
case Expanded:
/* In stacked displays, the recregion is always at the top */
- i->rectangle->set_y0 (1);
+ i->rectangle->set_y0 (0);
i->rectangle->set_y1 (h);
break;
}
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index a30e024f9a..ee6208b681 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -280,7 +280,9 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
_order = nth;
if (_y_position != y) {
- _canvas_display->set_y_position (y);
+ // XXX +1 is a quick hack to align the track-header with the canvas
+ // with the separator line at the top.
+ _canvas_display->set_y_position (y + 1);
_y_position = y;
}
@@ -843,9 +845,9 @@ TimeAxisView::hide_timestretch ()
void
TimeAxisView::show_selection (TimeSelection& ts)
{
- double x0;
double x1;
- double y1;
+ double x2;
+ double y2;
SelectionRect *rect; time_axis_frame.show();
@@ -877,17 +879,17 @@ TimeAxisView::show_selection (TimeSelection& ts)
rect = get_selection_rect ((*i).id);
- x0 = _editor.sample_to_pixel (start);
- x1 = _editor.sample_to_pixel (start + cnt - 1);
- y1 = current_height();
+ x1 = _editor.sample_to_pixel (start);
+ x2 = _editor.sample_to_pixel (start + cnt - 1);
+ y2 = current_height() - 1;
- rect->rect->set (ArdourCanvas::Rect (x0, 1, x1, y1));
+ rect->rect->set (ArdourCanvas::Rect (x1, 0, x2, y2));
// trim boxes are at the top for selections
- if (x1 > x0) {
- rect->start_trim->set (ArdourCanvas::Rect (x0, 1, x0 + trim_handle_size, y1));
- rect->end_trim->set (ArdourCanvas::Rect (x1 - trim_handle_size, 1, x1, y1));
+ if (x2 > x1) {
+ rect->start_trim->set (ArdourCanvas::Rect (x1, 1, x1 + trim_handle_size, y2));
+ rect->end_trim->set (ArdourCanvas::Rect (x2 - trim_handle_size, 1, x2, y2));
rect->start_trim->show();
rect->end_trim->show();
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index a2e38c1559..74651f67f6 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -166,7 +166,6 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
group = new ArdourCanvas::Container (parent);
CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
- group->set_y_position (1);
fill_color = base_color;
samples_per_pixel = fpp;
@@ -1019,7 +1018,7 @@ TimeAxisViewItem::idle_remove_this_item(TimeAxisViewItem* item, void* src)
void
TimeAxisViewItem::set_y (double y)
{
- group->set_y_position (y + 1);
+ group->set_y_position (y);
}
void