traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/sheetcanvas AudioClipView.cpp


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/sheetcanvas AudioClipView.cpp
Date: Wed, 25 Feb 2009 17:45:57 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       09/02/25 17:45:57

Modified files:
        src/sheetcanvas: AudioClipView.cpp 

Log message:
        * only repaint the exposed area for dB line painting. (fixes cpu 
hogging)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/sheetcanvas/AudioClipView.cpp?cvsroot=traverso&r1=1.20&r2=1.21

Patches:
Index: AudioClipView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/sheetcanvas/AudioClipView.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- AudioClipView.cpp   24 Feb 2009 21:45:41 -0000      1.20
+++ AudioClipView.cpp   25 Feb 2009 17:45:57 -0000      1.21
@@ -534,6 +534,8 @@
        int height;
        int channels = m_clip->get_channels();
        bool microView = m_sheet->get_hzoom() < 64 ? 1 : 0;
+       int linestartpos = xstart;
+       if (xstart < m_lineOffset) linestartpos = m_lineOffset;
 
        if (m_mergedView) {
                channels = 1;
@@ -562,10 +564,10 @@
                // draw the lines above and below the center line, then 
translate
                // the painter to the next channel
                for (int i = 0; i < channels; ++i) {
-                       p->drawLine(m_lineOffset, zeroDb, xstart+pixelcount, 
zeroDb);
-                       p->drawLine(m_lineOffset, -zeroDb, xstart+pixelcount, 
-zeroDb);
-                       p->drawLine(m_lineOffset, msixDb, xstart+pixelcount, 
msixDb);
-                       p->drawLine(m_lineOffset, -msixDb + 1, 
xstart+pixelcount, -msixDb + 1);
+                       p->drawLine(linestartpos, zeroDb, xstart+pixelcount, 
zeroDb);
+                       p->drawLine(linestartpos, -zeroDb, xstart+pixelcount, 
-zeroDb);
+                       p->drawLine(linestartpos, msixDb, xstart+pixelcount, 
msixDb);
+                       p->drawLine(linestartpos, -msixDb + 1, 
xstart+pixelcount, -msixDb + 1);
 
                        if (xstart < m_lineOffset) {
                                p->drawText(0.0, zeroDb - 1 + m_lineVOffset, "  
0 dB");
@@ -574,6 +576,7 @@
                                p->drawText(0.0, -msixDb + m_lineVOffset, " -6 
dB");
                        }
 
+
                        p->setMatrix(matrix().translate(0, height), true);
                }
        } else {  // rectified
@@ -588,8 +591,8 @@
                // draw the lines above the center line, then translate
                // the painter to the next channel
                for (int i = 0; i < channels; ++i) {
-                       p->drawLine(m_lineOffset, -zeroDb, xstart+pixelcount, 
-zeroDb);
-                       p->drawLine(m_lineOffset, -msixDb + 1, 
xstart+pixelcount, -msixDb + 1);
+                       p->drawLine(linestartpos, -zeroDb, xstart+pixelcount, 
-zeroDb);
+                       p->drawLine(linestartpos, -msixDb + 1, 
xstart+pixelcount, -msixDb + 1);
 
                        if (xstart < m_lineOffset) {
                                p->drawText(0.0, -zeroDb + m_lineVOffset, "  0 
dB");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]