various tweaks to the height/sizing of audioregion views and their waveforms
This commit is contained in:
parent
8491a015e3
commit
9f0012aaaa
@ -477,19 +477,23 @@ AudioRegionView::set_height (gdouble height)
|
||||
|
||||
uint32_t wcnt = waves.size();
|
||||
|
||||
for (uint32_t n = 0; n < wcnt; ++n) {
|
||||
if (wcnt > 0) {
|
||||
|
||||
gdouble ht;
|
||||
|
||||
if (height < NAME_HIGHLIGHT_THRESH) {
|
||||
ht = ((height - 2 * wcnt) / (double) wcnt);
|
||||
|
||||
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) {
|
||||
@ -1126,12 +1130,18 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
|
||||
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 ());
|
||||
|
@ -209,24 +209,12 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
|
||||
|
||||
if (ARDOUR_UI::config()->get_show_name_highlight() && (visibility & ShowNameHighlight)) {
|
||||
|
||||
double width;
|
||||
double start = 1.0;
|
||||
|
||||
if (visibility & FullWidthNameHighlight) {
|
||||
width = trackview.editor().sample_to_pixel(item_duration);
|
||||
} else {
|
||||
width = trackview.editor().sample_to_pixel(item_duration) - 2.0;
|
||||
}
|
||||
|
||||
name_highlight = new ArdourCanvas::Rectangle (group,
|
||||
ArdourCanvas::Rect (start,
|
||||
trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE,
|
||||
width - 2.0,
|
||||
trackview.current_height() - 1.0));
|
||||
/* rectangle size will be set in ::manage_name_highlight() */
|
||||
name_highlight = new ArdourCanvas::Rectangle (group);
|
||||
CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
|
||||
name_highlight->set_data ("timeaxisviewitem", this);
|
||||
name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
|
||||
name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255));
|
||||
name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255)); // this should use a theme color
|
||||
|
||||
} else {
|
||||
name_highlight = 0;
|
||||
@ -575,7 +563,7 @@ TimeAxisViewItem::set_height (double height)
|
||||
|
||||
if (frame) {
|
||||
|
||||
frame->set_y0 (1.0);
|
||||
frame->set_y0 (0.0);
|
||||
frame->set_y1 (height);
|
||||
|
||||
if (frame_handle_start) {
|
||||
@ -589,7 +577,7 @@ TimeAxisViewItem::set_height (double height)
|
||||
}
|
||||
|
||||
if (vestigial_frame) {
|
||||
vestigial_frame->set_y0 (1.0);
|
||||
vestigial_frame->set_y0 (0.0);
|
||||
vestigial_frame->set_y1 (height);
|
||||
}
|
||||
|
||||
@ -618,7 +606,8 @@ TimeAxisViewItem::manage_name_highlight ()
|
||||
if (name_highlight && wide_enough_for_name && high_enough_for_name) {
|
||||
|
||||
name_highlight->show();
|
||||
name_highlight->set (ArdourCanvas::Rect (1.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width, (double) _height - 1.0));
|
||||
// name_highlight->set_x_position (1.0);
|
||||
name_highlight->set (ArdourCanvas::Rect (0.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width - 2.0, _height));
|
||||
|
||||
} else {
|
||||
name_highlight->hide();
|
||||
|
Loading…
Reference in New Issue
Block a user