Update of /cvsroot/audacity/audacity-src/src/effects
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6545/effects

Modified Files:
        AutoDuck.cpp Compressor.cpp Equalization.cpp 
Log Message:
Converted all wxDC::DrawLine()s to AColor::Line()s so that it can handle        
                                        
the line drawing differences among platforms.                                   
                                        
                                                                                
                                        
Hopefully fixed all 1-off drawing issues that creaped in due to the platform    
                                        
differences.  Everyone should keep an extra critical eye open for stray         
                                        
pixels or lines that seem to be longer at one of the ends.                      
                                        

Reworked much of the waveform drawing code in TrackArtist to improve
performance.

Due to the performance gains in TrackArtist, the Mac specific waveform
drawing code was removed since it was out of sync with the other platforms.

Fixed drawing and click detection within NoteTrack label area.


Index: Compressor.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Compressor.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- Compressor.cpp      29 Jan 2009 23:59:49 -0000      1.45
+++ Compressor.cpp      16 May 2009 11:13:13 -0000      1.46
@@ -404,10 +404,11 @@
 
    // Yellow line for threshold
    memDC.SetPen(wxPen(wxColour(220, 220, 0), 1, wxSOLID));
-   memDC.DrawLine(mEnvRect.x,
-                  mEnvRect.y + mEnvRect.height - kneeY,
-                  mEnvRect.x + mEnvRect.width,
-                  mEnvRect.y + mEnvRect.height - kneeY);
+   AColor::Line(memDC,
+                mEnvRect.x,
+                mEnvRect.y + mEnvRect.height - kneeY,
+                mEnvRect.x + mEnvRect.width - 1,
+                mEnvRect.y + mEnvRect.height - kneeY);
 
    // Was: Nice dark red line for the compression diagram
 //   memDC.SetPen(wxPen(wxColour(180, 40, 40), 3, wxSOLID));
@@ -415,15 +416,17 @@
    // Nice blue line for compressor, same color as used in the waveform 
envelope.
    memDC.SetPen( AColor::WideEnvelopePen) ;
 
-   memDC.DrawLine(mEnvRect.x,
-                  mEnvRect.y + mEnvRect.height,
-                  mEnvRect.x + kneeX,
-                  mEnvRect.y + mEnvRect.height - kneeY);
+   AColor::Line(memDC,
+                mEnvRect.x,
+                mEnvRect.y + mEnvRect.height,
+                mEnvRect.x + kneeX - 1,
+                mEnvRect.y + mEnvRect.height - kneeY);
 
-   memDC.DrawLine(mEnvRect.x + kneeX,
-                  mEnvRect.y + mEnvRect.height - kneeY,
-                  mEnvRect.x + mEnvRect.width,
-                  mEnvRect.y + mEnvRect.height - finalY);
+   AColor::Line(memDC,
+                mEnvRect.x + kneeX,
+                mEnvRect.y + mEnvRect.height - kneeY,
+                mEnvRect.x + mEnvRect.width - 1,
+                mEnvRect.y + mEnvRect.height - finalY);
 
    // Paint border again
    memDC.SetBrush(*wxTRANSPARENT_BRUSH);

Index: Equalization.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Equalization.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- Equalization.cpp    1 May 2009 18:26:33 -0000       1.91
+++ Equalization.cpp    16 May 2009 11:13:13 -0000      1.92
@@ -61,6 +61,7 @@
 
 #include "../Audacity.h"
 #include "Equalization.h"
+#include "../AColor.h"
 #include "../ShuttleGui.h"
 #include "../PlatformCompatibility.h"
 #include "../FileNames.h"
@@ -731,13 +732,15 @@
    memDC.DrawRectangle(border);
 
    mEnvRect = border;
-   mEnvRect.Deflate( 2, 2 );
+   mEnvRect.Deflate(2, 2);
+//   mEnvRect.height--;
 
    // Pure blue x-axis line
    memDC.SetPen(wxPen(theTheme.Colour( clrGraphLines ), 1, wxSOLID));
    int center = (int) (mEnvRect.height * dBMax/(dBMax-dBMin) + .5);
-   memDC.DrawLine(mEnvRect.x, mEnvRect.y + center,
-                  mEnvRect.x + mEnvRect.width, mEnvRect.y + center);
+   AColor::Line(memDC,
+                mEnvRect.GetLeft(), mEnvRect.y + center,
+                mEnvRect.GetRight(), mEnvRect.y + center);
 
    // Med-blue envelope line
    memDC.SetPen(wxPen(theTheme.Colour( clrGraphLines ), 3, wxSOLID));
@@ -751,9 +754,9 @@
    {
       x = mEnvRect.x + i;
       y = lrint(mEnvRect.height*((dBMax-values[i])/(dBMax-dBMin)) + .25 ); 
//needs more optimising, along with'what you get'?
-      if( y > mEnvRect.height)
+      if( y >= mEnvRect.height)
       {
-         y = mEnvRect.height;
+         y = mEnvRect.height - 1;
          off = true;
       }
       else
@@ -763,8 +766,8 @@
       }
       if ( (i != 0) & (!off1) )
       {
-         memDC.DrawLine(xlast, ylast,
-                        x, mEnvRect.y + y);
+         AColor::Line(memDC, xlast, ylast,
+                      x, mEnvRect.y + y);
       }
       off1 = off;
       xlast = x;
@@ -818,14 +821,14 @@
          yF = dBMin;
       yF = center-scale*yF;
       if(yF>mEnvRect.height)
-         yF = mEnvRect.height;
+         yF = mEnvRect.height - 1;
       if(yF<0.)
          yF=0.;
       y = (int)(yF+.5);
 
       if (i != 0)
       {
-         memDC.DrawLine(xlast, ylast, x, mEnvRect.y + y);
+         AColor::Line(memDC, xlast, ylast, x, mEnvRect.y + y);
       }
       xlast = x;
       ylast = mEnvRect.y + y;

Index: AutoDuck.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/AutoDuck.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- AutoDuck.cpp        23 Mar 2009 00:32:54 -0000      1.12
+++ AutoDuck.cpp        16 May 2009 11:13:13 -0000      1.13
@@ -740,8 +740,8 @@
       
       dc.SetPen(wxPen(*wxBLACK, 1, wxDOT));
       
-      dc.DrawLine(FADE_DOWN_START, 10, FADE_DOWN_START, clientHeight - 10);
-      dc.DrawLine(FADE_UP_START, 10, FADE_UP_START, clientHeight - 10);
+      AColor::Line(dc, FADE_DOWN_START, 10, FADE_DOWN_START, clientHeight - 
10);
+      AColor::Line(dc, FADE_UP_START, 10, FADE_UP_START, clientHeight - 10);
       
       dc.SetPen(AColor::envelopePen);
       dc.SetBrush(*wxWHITE_BRUSH);


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to