[Ardour-Dev] test tarball for 2.8 / Crossfade editor gain bounds
Markus Schwarzenberg
schwarzb at ipms.fraunhofer.de
Fri Mar 27 16:16:56 PDT 2009
found a minor bug in my favourite crossfade editor:
dragging curve handles in the crossfade editor is currently not limited
to relative levels in the range [ 0 .. 1 ]. More precisely, the handle
itself stops at the border, but the gain value is always taken from the
mouse position w/o clipping. This results in completely unintended gain
values. A way to fix this is:
--- gtk2_ardour/crossfade_edit.cc (Revision 4919)
+++ gtk2_ardour/crossfade_edit.cc (Arbeitskopie)
@@ -496,6 +496,19 @@
void
CrossfadeEditor::Point::move_to (double nx, double ny, double xfract,
double yfract)
{
+ if ( xfract < 0.0 ) {
+ xfract = 0.0;
+ } else if ( xfract > 1.0 ) {
+ xfract = 1.0;
+ }
+
+ if ( yfract < 0.0 ) {
+ yfract = 0.0;
+ } else if ( yfract > 1.0 ) {
+ yfract = 1.0;
+ }
+
+
const double half_size = rint(size/2.0);
double x1 = nx - half_size;
double x2 = nx + half_size;
--
Markus Schwarzenberg
More information about the Ardour-Dev
mailing list