uint32_t wcnt = waves.size();
- for (uint32_t n = 0; n < wcnt; ++n) {
- gdouble ht;
+ if (wcnt > 0) {
- if (height < NAME_HIGHLIGHT_THRESH) {
- ht = ((height - 2 * wcnt) / (double) wcnt);
+ gdouble ht;
+
+ if (!ARDOUR_UI::config()->get_show_name_highlight() || (height < NAME_HIGHLIGHT_THRESH)) {
+ ht = height / (double) wcnt;
} else {
- ht = (((height - 2 * wcnt) - NAME_HIGHLIGHT_SIZE) / (double) wcnt);
+ ht = (height - NAME_HIGHLIGHT_SIZE) / (double) wcnt;
+ }
+
+ for (uint32_t n = 0; n < wcnt; ++n) {
+
+ gdouble yoff = floor (ht * n);
+
+ waves[n]->set_height (ht);
+ waves[n]->set_y_position (yoff);
}
-
- gdouble yoff = n * (ht + 1);
-
- waves[n]->set_height (ht);
- waves[n]->set_y_position (yoff + 2);
}
if (gain_line) {
width = std::max ((framecnt_t) 64, width);
/* round here to prevent little visual glitches with sub-pixel placement */
- double const pwidth = rint (width / samples_per_pixel);
+ double const pwidth = floor (width / samples_per_pixel);
double const handle_left = pwidth;
/* Put the fade in handle so that its left side is at the end-of-fade line */
points.assign (list->size(), Duple());
for (x = list->begin(), pi = 0; x != list->end(); ++x, ++pi) {
- points[pi].x = 1.0 + (pwidth * ((*x)->when/length));
- points[pi].y = effective_height - ((*x)->value * effective_height);
+ points[pi].x = (pwidth * ((*x)->when/length));
+ points[pi].y = effective_height - ((*x)->value * (effective_height - 1.));
}
/* draw the line */
width = std::max ((framecnt_t) 64, width);
- double const pwidth = rint(trackview.editor().sample_to_pixel (width));
+ double const pwidth = floor(trackview.editor().sample_to_pixel (width));
/* the right edge should be right on the region frame is the pixel
* width is zero. Hence the additional + 1.0 at the end.
double effective_height;
- effective_height = _height - 1.0;
+ effective_height = _height;
if (ARDOUR_UI::config()->get_show_name_highlight() && effective_height >= NAME_HIGHLIGHT_THRESH) {
effective_height -= NAME_HIGHLIGHT_SIZE;
for (x = list->begin(), pi = 0; x != list->end(); ++x, ++pi) {
points[pi].x = _pixel_width - pwidth + (pwidth * ((*x)->when/length));
- points[pi].y = 1.0 + effective_height - ((*x)->value * effective_height);
+ points[pi].y = effective_height - ((*x)->value * (effective_height - 1.));
}
/* draw the line */
for (Points::size_type i = 0, pci = 0; i < npoints; ++i, ++pci) {
ArdourCanvas::Duple &p (ipoints[pci]);
/* leave x-axis alone but invert with respect to y-axis */
- p.y = 1.0 + effective_height - points[pci].y;
+ p.y = effective_height - points[pci].y;
}
} else {
for (x = inverse->begin(), pi = 0; x != inverse->end(); ++x, ++pi) {
ArdourCanvas::Duple& p (ipoints[pi]);
p.x = (rect_width * ((*x)->when/length));
- p.y = 1.0 + effective_height - ((*x)->value * effective_height);
+ p.y = effective_height - ((*x)->value * (effective_height));
}
}
const double rend = trackview.editor().sample_to_pixel (_region->length() - width);
Evoral::ControlList::const_iterator x;
- Points::size_type i;
Points::size_type pi;
double length = inverse->length();
- for (x = inverse->begin(), i = 0, pi = 0; x != inverse->end(); ++x, ++pi, ++i) {
+ for (x = inverse->begin(), pi = 0; x != inverse->end(); ++x, ++pi) {
ArdourCanvas::Duple& p (ipoints[pi]);
p.x = (rect_width * ((*x)->when/length)) + rend;
- p.y = 1.0 + effective_height - ((*x)->value * effective_height);
+ p.y = effective_height - ((*x)->value * (effective_height));
}
}
return;
}
- if (ARDOUR_UI::config()->get_show_region_gain() || trackview.editor().current_mouse_mode() == Editing::MouseDraw || trackview.editor().current_mouse_mode() == Editing::MouseRange ) {
+ if (trackview.editor().current_mouse_mode() == Editing::MouseDraw || trackview.editor().current_mouse_mode() == Editing::MouseContent ) {
gain_line->set_visibility (AutomationLine::VisibleAspects(AutomationLine::ControlPoints|AutomationLine::Line));
gain_line->canvas_group().raise_to_top ();
-
+ } else if (ARDOUR_UI::config()->get_show_region_gain() || trackview.editor().current_mouse_mode() == Editing::MouseRange ) {
+ gain_line->set_visibility (AutomationLine::VisibleAspects(AutomationLine::Line));
+ gain_line->canvas_group().raise_to_top ();
} else {
gain_line->set_visibility (AutomationLine::VisibleAspects(0));
}
uint32_t nwaves = std::min (nchans, audio_region()->n_channels());
gdouble ht;
+ /* reduce waveview height by 2.0 to account for our frame */
+
if (trackview.current_height() < NAME_HIGHLIGHT_THRESH) {
- ht = ((trackview.current_height()) / (double) nchans);
+ ht = ((trackview.current_height() - 2.0) / (double) nchans);
} else {
- ht = ((trackview.current_height() - NAME_HIGHLIGHT_SIZE) / (double) nchans);
+ ht = ((trackview.current_height() - NAME_HIGHLIGHT_SIZE - 2.0) / (double) nchans);
}
+ /* first waveview starts at 1.0, not 0.0 since that will overlap the
+ * frame
+ */
+
gdouble yoff = which * ht;
WaveView *wave = new WaveView (group, audio_region ());
fade_out_trim_handle->hide ();
}
}
+ } else { //this happens when we switch tools; if we switch away from Grab mode, hide all the fade handles
+ if (fade_in_handle) { fade_in_handle->hide(); }
+ if (fade_out_handle) { fade_out_handle->hide(); }
+ if (fade_in_trim_handle) { fade_in_trim_handle->hide(); }
+ if (fade_out_trim_handle) { fade_out_trim_handle->hide(); }
+ if (start_xfade_rect) { start_xfade_rect->set_outline (false); }
+ if (end_xfade_rect) { end_xfade_rect->set_outline (false); }
}
}
trackview.editor().set_current_trimmable (boost::shared_ptr<Trimmable>());
trackview.editor().set_current_movable (boost::shared_ptr<Movable>());
- if (gain_line) {
- gain_line->remove_visibility (AutomationLine::ControlPoints);
- }
+// if (gain_line) {
+// gain_line->remove_visibility (AutomationLine::ControlPoints);
+// }
if (fade_in_handle) { fade_in_handle->hide(); }
if (fade_out_handle) { fade_out_handle->hide(); }