visual tweak patch from lincoln, for time axis views
git-svn-id: svn://localhost/ardour2/branches/3.0@6857 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
9644362c92
commit
7c9c3b8f6c
@ -473,22 +473,23 @@ AudioRegionView::set_height (gdouble height)
|
|||||||
// FIXME: ick
|
// FIXME: ick
|
||||||
height -= 2;
|
height -= 2;
|
||||||
|
|
||||||
for (uint32_t n=0; n < wcnt; ++n) {
|
for (uint32_t n = 0; n < wcnt; ++n) {
|
||||||
gdouble ht;
|
gdouble ht;
|
||||||
|
|
||||||
if ((height) < NAME_HIGHLIGHT_THRESH) {
|
if ((height) < NAME_HIGHLIGHT_THRESH) {
|
||||||
ht = ((height-2*wcnt) / (double) wcnt);
|
ht = ((height - 2 * wcnt) / (double) wcnt);
|
||||||
} else {
|
} else {
|
||||||
ht = (((height-2*wcnt) - NAME_HIGHLIGHT_SIZE) / (double) wcnt);
|
ht = (((height - 2 * wcnt) - NAME_HIGHLIGHT_SIZE) / (double) wcnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
gdouble yoff = n * (ht+1);
|
gdouble yoff = n * (ht + 1);
|
||||||
|
|
||||||
waves[n]->property_height() = ht;
|
waves[n]->property_height() = ht;
|
||||||
waves[n]->property_y() = yoff + 2;
|
waves[n]->property_y() = yoff + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gain_line) {
|
if (gain_line) {
|
||||||
|
|
||||||
if ((height/wcnt) < NAME_HIGHLIGHT_THRESH) {
|
if ((height/wcnt) < NAME_HIGHLIGHT_THRESH) {
|
||||||
gain_line->hide ();
|
gain_line->hide ();
|
||||||
} else {
|
} else {
|
||||||
@ -496,11 +497,16 @@ AudioRegionView::set_height (gdouble height)
|
|||||||
gain_line->show ();
|
gain_line->show ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE - 2));
|
|
||||||
|
gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE));
|
||||||
}
|
}
|
||||||
|
|
||||||
manage_zero_line ();
|
manage_zero_line ();
|
||||||
reset_fade_shapes ();
|
reset_fade_shapes ();
|
||||||
|
|
||||||
|
if (name_pixbuf) {
|
||||||
|
name_pixbuf->raise_to_top();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -55,8 +55,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
|||||||
xf->length(), false, TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowFrame)),
|
xf->length(), false, TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowFrame)),
|
||||||
crossfade (xf),
|
crossfade (xf),
|
||||||
left_view (lview),
|
left_view (lview),
|
||||||
right_view (rview)
|
right_view (rview)
|
||||||
|
|
||||||
{
|
{
|
||||||
_valid = true;
|
_valid = true;
|
||||||
_visible = true;
|
_visible = true;
|
||||||
@ -76,7 +75,6 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
|
|||||||
frame->property_outline_what() = 0;
|
frame->property_outline_what() = 0;
|
||||||
|
|
||||||
/* never show the vestigial frame */
|
/* never show the vestigial frame */
|
||||||
|
|
||||||
vestigial_frame->hide();
|
vestigial_frame->hide();
|
||||||
show_vestigial = false;
|
show_vestigial = false;
|
||||||
|
|
||||||
@ -114,9 +112,9 @@ CrossfadeView::set_height (double height)
|
|||||||
{
|
{
|
||||||
double h = 0;
|
double h = 0;
|
||||||
if (height <= TimeAxisView::hSmaller) {
|
if (height <= TimeAxisView::hSmaller) {
|
||||||
h = height - 3;
|
TimeAxisViewItem::set_height (height);
|
||||||
} else {
|
} else {
|
||||||
h = height - NAME_HIGHLIGHT_SIZE - 3;
|
TimeAxisViewItem::set_height (height - NAME_HIGHLIGHT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeAxisViewItem::set_height (h);
|
TimeAxisViewItem::set_height (h);
|
||||||
@ -165,6 +163,20 @@ CrossfadeView::redraw_curves ()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
At "height - 3.0" the bottom of the crossfade touches the name highlight or the bottom of the track (if the
|
||||||
|
track is either Small or Smaller.
|
||||||
|
*/
|
||||||
|
|
||||||
|
double tav_height = get_time_axis_view().current_height();
|
||||||
|
|
||||||
|
if (tav_height == TimeAxisView::hSmaller ||
|
||||||
|
tav_height == TimeAxisView::hSmall) {
|
||||||
|
_height = tav_height - 3.0;
|
||||||
|
} else {
|
||||||
|
_height = tav_height - NAME_HIGHLIGHT_SIZE - 3.0;
|
||||||
|
}
|
||||||
|
|
||||||
if (_height < 0) {
|
if (_height < 0) {
|
||||||
/* no space allocated yet */
|
/* no space allocated yet */
|
||||||
return;
|
return;
|
||||||
@ -192,14 +204,17 @@ CrossfadeView::redraw_curves ()
|
|||||||
p.set_x(i);
|
p.set_x(i);
|
||||||
p.set_y(2.0 + _height - (_height * vec[i]));
|
p.set_y(2.0 + _height - (_height * vec[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
fade_in->property_points() = *points;
|
fade_in->property_points() = *points;
|
||||||
|
|
||||||
crossfade->fade_out().curve().get_vector (0, crossfade->length(), vec, npoints);
|
crossfade->fade_out().curve().get_vector (0, crossfade->length(), vec, npoints);
|
||||||
|
|
||||||
for (int i = 0, pci = 0; i < npoints; ++i) {
|
for (int i = 0, pci = 0; i < npoints; ++i) {
|
||||||
Art::Point &p = (*points)[pci++];
|
Art::Point &p = (*points)[pci++];
|
||||||
p.set_x(i);
|
p.set_x(i);
|
||||||
p.set_y(2.0 + _height - (_height * vec[i]));
|
p.set_y(2.0 + _height - (_height * vec[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
fade_out->property_points() = *points;
|
fade_out->property_points() = *points;
|
||||||
|
|
||||||
delete [] vec;
|
delete [] vec;
|
||||||
@ -266,4 +281,3 @@ CrossfadeView::fake_hide ()
|
|||||||
{
|
{
|
||||||
group->hide();
|
group->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
|
|||||||
controls_table.show_all ();
|
controls_table.show_all ();
|
||||||
controls_table.set_no_show_all ();
|
controls_table.set_no_show_all ();
|
||||||
|
|
||||||
resizer.set_size_request (10, 10);
|
resizer.set_size_request (10, 6);
|
||||||
resizer.set_name ("ResizeHandle");
|
resizer.set_name ("ResizeHandle");
|
||||||
resizer.signal_expose_event().connect (sigc::mem_fun (*this, &TimeAxisView::resizer_expose));
|
resizer.signal_expose_event().connect (sigc::mem_fun (*this, &TimeAxisView::resizer_expose));
|
||||||
resizer.signal_button_press_event().connect (sigc::mem_fun (*this, &TimeAxisView::resizer_button_press));
|
resizer.signal_button_press_event().connect (sigc::mem_fun (*this, &TimeAxisView::resizer_button_press));
|
||||||
@ -166,8 +166,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
|
|||||||
HSeparator* separator = manage (new HSeparator());
|
HSeparator* separator = manage (new HSeparator());
|
||||||
|
|
||||||
controls_vbox.pack_start (controls_table, false, false);
|
controls_vbox.pack_start (controls_table, false, false);
|
||||||
controls_vbox.pack_end (*separator, false, false);
|
controls_vbox.pack_end (resizer_box, false, false);
|
||||||
controls_vbox.pack_end (resizer_box, false, true);
|
|
||||||
controls_vbox.show ();
|
controls_vbox.show ();
|
||||||
|
|
||||||
//controls_ebox.set_name ("TimeAxisViewControlsBaseUnselected");
|
//controls_ebox.set_name ("TimeAxisViewControlsBaseUnselected");
|
||||||
@ -178,9 +177,13 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
|
|||||||
controls_ebox.signal_button_release_event().connect (sigc::mem_fun (*this, &TimeAxisView::controls_ebox_button_release));
|
controls_ebox.signal_button_release_event().connect (sigc::mem_fun (*this, &TimeAxisView::controls_ebox_button_release));
|
||||||
controls_ebox.signal_scroll_event().connect (sigc::mem_fun (*this, &TimeAxisView::controls_ebox_scroll), true);
|
controls_ebox.signal_scroll_event().connect (sigc::mem_fun (*this, &TimeAxisView::controls_ebox_scroll), true);
|
||||||
|
|
||||||
controls_hbox.pack_start (controls_ebox,true,true);
|
controls_hbox.pack_start (controls_ebox, false, false);
|
||||||
controls_hbox.show ();
|
controls_hbox.show ();
|
||||||
|
|
||||||
|
time_axis_vbox.pack_start (controls_hbox, true, true);
|
||||||
|
time_axis_vbox.pack_end (*separator, false, false);
|
||||||
|
time_axis_vbox.show();
|
||||||
|
|
||||||
ColorsChanged.connect (sigc::mem_fun (*this, &TimeAxisView::color_handler));
|
ColorsChanged.connect (sigc::mem_fun (*this, &TimeAxisView::color_handler));
|
||||||
|
|
||||||
GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&TimeAxisView::erase_ghost, this, _1), gui_context());
|
GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&TimeAxisView::erase_ghost, this, _1), gui_context());
|
||||||
@ -235,11 +238,11 @@ guint32
|
|||||||
TimeAxisView::show_at (double y, int& nth, VBox *parent)
|
TimeAxisView::show_at (double y, int& nth, VBox *parent)
|
||||||
{
|
{
|
||||||
if (control_parent) {
|
if (control_parent) {
|
||||||
control_parent->reorder_child (controls_hbox, nth);
|
control_parent->reorder_child (time_axis_vbox, nth);
|
||||||
} else {
|
} else {
|
||||||
control_parent = parent;
|
control_parent = parent;
|
||||||
parent->pack_start (controls_hbox, false, false);
|
parent->pack_start (time_axis_vbox, false, false);
|
||||||
parent->reorder_child (controls_hbox, nth);
|
parent->reorder_child (time_axis_vbox, nth);
|
||||||
}
|
}
|
||||||
|
|
||||||
_order = nth;
|
_order = nth;
|
||||||
@ -258,7 +261,7 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
|
|||||||
_canvas_display->raise_to_top ();
|
_canvas_display->raise_to_top ();
|
||||||
|
|
||||||
if (_marked_for_display) {
|
if (_marked_for_display) {
|
||||||
controls_hbox.show ();
|
time_axis_vbox.show ();
|
||||||
controls_ebox.show ();
|
controls_ebox.show ();
|
||||||
_canvas_background->show ();
|
_canvas_background->show ();
|
||||||
}
|
}
|
||||||
@ -364,7 +367,7 @@ TimeAxisView::hide ()
|
|||||||
_canvas_background->hide ();
|
_canvas_background->hide ();
|
||||||
|
|
||||||
if (control_parent) {
|
if (control_parent) {
|
||||||
control_parent->remove (controls_hbox);
|
control_parent->remove (time_axis_vbox);
|
||||||
control_parent = 0;
|
control_parent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +416,7 @@ TimeAxisView::set_heights (uint32_t h)
|
|||||||
void
|
void
|
||||||
TimeAxisView::set_height(uint32_t h)
|
TimeAxisView::set_height(uint32_t h)
|
||||||
{
|
{
|
||||||
controls_ebox.property_height_request () = h;
|
time_axis_vbox.property_height_request () = h;
|
||||||
height = h;
|
height = h;
|
||||||
|
|
||||||
for (list<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
for (list<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
|
||||||
@ -624,11 +627,11 @@ TimeAxisView::set_selected (bool yn)
|
|||||||
|
|
||||||
if (_selected) {
|
if (_selected) {
|
||||||
controls_ebox.set_name (controls_base_selected_name);
|
controls_ebox.set_name (controls_base_selected_name);
|
||||||
controls_hbox.set_name (controls_base_selected_name);
|
time_axis_vbox.set_name (controls_base_selected_name);
|
||||||
controls_vbox.set_name (controls_base_selected_name);
|
controls_vbox.set_name (controls_base_selected_name);
|
||||||
} else {
|
} else {
|
||||||
controls_ebox.set_name (controls_base_unselected_name);
|
controls_ebox.set_name (controls_base_unselected_name);
|
||||||
controls_hbox.set_name (controls_base_unselected_name);
|
time_axis_vbox.set_name (controls_base_unselected_name);
|
||||||
controls_vbox.set_name (controls_base_unselected_name);
|
controls_vbox.set_name (controls_base_unselected_name);
|
||||||
hide_selection ();
|
hide_selection ();
|
||||||
|
|
||||||
@ -1348,13 +1351,6 @@ TimeAxisView::resizer_expose (GdkEventExpose* event)
|
|||||||
win->draw_line (light, 1, 5, w - 1, 5);
|
win->draw_line (light, 1, 5, w - 1, 5);
|
||||||
win->draw_point (light, w - 1, 4);
|
win->draw_point (light, w - 1, 4);
|
||||||
|
|
||||||
/* handle/line #3 */
|
|
||||||
|
|
||||||
win->draw_line (dark, 0, 8, w - 2, 8);
|
|
||||||
win->draw_point (dark, 0, 9);
|
|
||||||
win->draw_line (light, 1, 9, w - 1, 9);
|
|
||||||
win->draw_point (light, w - 1, 8);
|
|
||||||
|
|
||||||
/* use vertical resize mouse cursor */
|
/* use vertical resize mouse cursor */
|
||||||
win->set_cursor(Gdk::Cursor(Gdk::SB_V_DOUBLE_ARROW));
|
win->set_cursor(Gdk::Cursor(Gdk::SB_V_DOUBLE_ARROW));
|
||||||
|
|
||||||
|
@ -229,6 +229,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
|||||||
Gtk::Table controls_table;
|
Gtk::Table controls_table;
|
||||||
Gtk::EventBox controls_ebox;
|
Gtk::EventBox controls_ebox;
|
||||||
Gtk::VBox controls_vbox;
|
Gtk::VBox controls_vbox;
|
||||||
|
Gtk::VBox time_axis_vbox;
|
||||||
Gtk::DrawingArea resizer;
|
Gtk::DrawingArea resizer;
|
||||||
Gtk::HBox resizer_box;
|
Gtk::HBox resizer_box;
|
||||||
Gtk::HBox name_hbox;
|
Gtk::HBox name_hbox;
|
||||||
|
Loading…
Reference in New Issue
Block a user