projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modified patch from drmoore to fix mantis 2808 (drag rectangle left behind after...
[ardour.git]
/
gtk2_ardour
/
crossfade_view.cc
diff --git
a/gtk2_ardour/crossfade_view.cc
b/gtk2_ardour/crossfade_view.cc
index ef43ee987346bbf4b174641bd6a370f041d8a775..63c2115b87427842865f217bf9985fdec173d538 100644
(file)
--- a/
gtk2_ardour/crossfade_view.cc
+++ b/
gtk2_ardour/crossfade_view.cc
@@
-19,7
+19,7
@@
#include <algorithm>
#include <algorithm>
-#include
<ardour/region.h>
+#include
"ardour/region.h"
#include <gtkmm2ext/doi.h>
#include "canvas-simplerect.h"
#include <gtkmm2ext/doi.h>
#include "canvas-simplerect.h"
@@
-31,6
+31,7
@@
#include "audio_region_view.h"
#include "utils.h"
#include "canvas_impl.h"
#include "audio_region_view.h"
#include "utils.h"
#include "canvas_impl.h"
+#include "ardour_ui.h"
using namespace sigc;
using namespace ARDOUR;
using namespace sigc;
using namespace ARDOUR;
@@
-51,7
+52,7
@@
CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
: TimeAxisViewItem ("xfade" /*xf.name()*/, *parent, tv, spu, basic_color, xf->position(),
: TimeAxisViewItem ("xfade" /*xf.name()*/, *parent, tv, spu, basic_color, xf->position(),
- xf->length(), TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowFrame)),
+ xf->length(),
false,
TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowFrame)),
crossfade (xf),
left_view (lview),
right_view (rview)
crossfade (xf),
left_view (lview),
right_view (rview)
@@
-61,14
+62,14
@@
CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
_visible = true;
fade_in = new Line (*group);
_visible = true;
fade_in = new Line (*group);
- fade_in->property_fill_color_rgba() =
color_map[cCrossfadeLine]
;
+ fade_in->property_fill_color_rgba() =
ARDOUR_UI::config()->canvasvar_CrossfadeLine.get()
;
fade_in->property_width_pixels() = 1;
fade_out = new Line (*group);
fade_in->property_width_pixels() = 1;
fade_out = new Line (*group);
- fade_out->property_fill_color_rgba() =
color_map[cCrossfadeLine]
;
+ fade_out->property_fill_color_rgba() =
ARDOUR_UI::config()->canvasvar_CrossfadeLine.get()
;
fade_out->property_width_pixels() = 1;
fade_out->property_width_pixels() = 1;
- set_height (get_time_axis_view().
height
);
+ set_height (get_time_axis_view().
current_height()
);
/* no frame around the xfade or overlap rects */
/* no frame around the xfade or overlap rects */
@@
-79,11
+80,12
@@
CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
vestigial_frame->hide();
show_vestigial = false;
vestigial_frame->hide();
show_vestigial = false;
- group->signal_event().connect (bind (mem_fun (tv.editor, &PublicEditor::canvas_crossfade_view_event), group, this));
+ group->signal_event().connect (bind (mem_fun (tv.editor
()
, &PublicEditor::canvas_crossfade_view_event), group, this));
crossfade_changed (Change (~0));
crossfade->StateChanged.connect (mem_fun(*this, &CrossfadeView::crossfade_changed));
crossfade_changed (Change (~0));
crossfade->StateChanged.connect (mem_fun(*this, &CrossfadeView::crossfade_changed));
+ ColorsChanged.connect (mem_fun (*this, &CrossfadeView::color_handler));
}
CrossfadeView::~CrossfadeView ()
}
CrossfadeView::~CrossfadeView ()
@@
-107,11
+109,11
@@
CrossfadeView::reset_width_dependent_items (double pixel_width)
void
CrossfadeView::set_height (double height)
{
void
CrossfadeView::set_height (double height)
{
- if (height == TimeAxisView::hSmaller ||
- height == TimeAxisView::hSmall)
- TimeAxisViewItem::set_height (height - 3 );
- else
+ if (height <= TimeAxisView::hSmaller) {
+ TimeAxisViewItem::set_height (height - 3);
+ } else {
TimeAxisViewItem::set_height (height - NAME_HIGHLIGHT_SIZE - 3 );
TimeAxisViewItem::set_height (height - NAME_HIGHLIGHT_SIZE - 3 );
+ }
redraw_curves ();
}
redraw_curves ();
}
@@
-158,7
+160,8
@@
CrossfadeView::redraw_curves ()
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.
*/
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().height;
+
+ double tav_height = get_time_axis_view().current_height();
if (tav_height == TimeAxisView::hSmaller ||
tav_height == TimeAxisView::hSmall) {
h = tav_height - 3.0;
if (tav_height == TimeAxisView::hSmaller ||
tav_height == TimeAxisView::hSmall) {
h = tav_height - 3.0;
@@
-171,8
+174,8
@@
CrossfadeView::redraw_curves ()
return;
}
return;
}
- npoints = get_time_axis_view().editor.frame_to_pixel (crossfade->length());
- npoints = std::min (gdk_screen_width(), npoints);
+ npoints = get_time_axis_view().editor
()
.frame_to_pixel (crossfade->length());
+
//
npoints = std::min (gdk_screen_width(), npoints);
if (!_visible || !crossfade->active() || npoints < 3) {
fade_in->hide();
if (!_visible || !crossfade->active() || npoints < 3) {
fade_in->hide();
@@
-186,7
+189,8
@@
CrossfadeView::redraw_curves ()
points = get_canvas_points ("xfade edit redraw", npoints);
vec = new float[npoints];
points = get_canvas_points ("xfade edit redraw", npoints);
vec = new float[npoints];
- crossfade->fade_in().get_vector (0, crossfade->length(), vec, npoints);
+ crossfade->fade_in().curve().get_vector (0, crossfade->length(), vec, npoints);
+
for (int i = 0, pci = 0; i < npoints; ++i) {
Art::Point &p = (*points)[pci++];
p.set_x(i);
for (int i = 0, pci = 0; i < npoints; ++i) {
Art::Point &p = (*points)[pci++];
p.set_x(i);
@@
-194,7
+198,7
@@
CrossfadeView::redraw_curves ()
}
fade_in->property_points() = *points;
}
fade_in->property_points() = *points;
- crossfade->fade_out().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) {
Art::Point &p = (*points)[pci++];
p.set_x(i);
for (int i = 0, pci = 0; i < npoints; ++i) {
Art::Point &p = (*points)[pci++];
p.set_x(i);
@@
-217,14
+221,20
@@
void
CrossfadeView::active_changed ()
{
if (crossfade->active()) {
CrossfadeView::active_changed ()
{
if (crossfade->active()) {
- frame->property_fill_color_rgba() =
color_map[cActiveCrossfade]
;
+ frame->property_fill_color_rgba() =
ARDOUR_UI::config()->canvasvar_ActiveCrossfade.get()
;
} else {
} else {
- frame->property_fill_color_rgba() =
color_map[cInactiveCrossfade]
;
+ frame->property_fill_color_rgba() =
ARDOUR_UI::config()->canvasvar_InactiveCrossfade.get()
;
}
redraw_curves ();
}
}
redraw_curves ();
}
+void
+CrossfadeView::color_handler ()
+{
+ active_changed ();
+}
+
void
CrossfadeView::set_valid (bool yn)
{
void
CrossfadeView::set_valid (bool yn)
{
@@
-260,3
+270,4
@@
CrossfadeView::fake_hide ()
{
group->hide();
}
{
group->hide();
}
+