[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/multimedia/amarok/src/analyzers
From:       Dan Meltzer <hydrogen () notyetimplemented ! com>
Date:       2007-04-28 15:28:01
Message-ID: 1177774081.650884.29306.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 658818 by dmeltzer:

Explicitly pass the paramaters of log10() as float because msvc is stupid.

 M  +2 -2      baranalyzer.cpp  
 M  +2 -2      blockanalyzer.cpp  


--- trunk/extragear/multimedia/amarok/src/analyzers/baranalyzer.cpp #658817:658818
@@ -57,7 +57,7 @@
 void BarAnalyzer::init()
 {
     const double MAX_AMPLITUDE = 1.0;
-    const double F = double(height() - 2) / (log10( 255 ) * MAX_AMPLITUDE );
+    const double F = double(height() - 2) / (log10( static_cast<double>(255) ) * \
MAX_AMPLITUDE );  
     setPaletteBackgroundColor(m_bg);
 
@@ -76,7 +76,7 @@
     //generate a list of values that express amplitudes in range 0-MAX_AMP as ints \
from 0-height() on log scale  for ( uint x = 0; x < 256; ++x )
     {
-        m_lvlMapper[x] = uint( F * log10( x+1 ) );
+        m_lvlMapper[x] = static_cast<uint>( ( F * log10( static_cast<float>(x+1) ) ) \
);  }
 
     m_pixBarGradient.resize( height()*COLUMN_WIDTH, height() );
--- trunk/extragear/multimedia/amarok/src/analyzers/blockanalyzer.cpp #658817:658818
@@ -87,7 +87,7 @@
 
       m_yscale.resize( m_rows + 1 );
 
-      const uint PRE = 1, PRO = 1; //PRE and PRO allow us to restrict the range \
somewhat +      const float PRE = 1, PRO = 1; //PRE and PRO allow us to restrict the \
range somewhat  
       for( uint z = 0; z < m_rows; ++z )
          m_yscale[z] = 1 - (log10( PRE+z ) / log10( PRE+m_rows+PRO ));
@@ -401,7 +401,7 @@
          m_fade_bars[y].fill( palette().active().background() );
          QPainter f( &m_fade_bars[y] );
          for( int z = 0; (uint)z < m_rows; ++z ) {
-            const double Y = 1.0 - (log10( FADE_SIZE - y ) / log10( FADE_SIZE ));
+            const double Y = 1.0 - (log10( static_cast<float>(FADE_SIZE) - y ) / \
                log10( static_cast<float>(FADE_SIZE) ));
             f.fillRect( 0, z*(HEIGHT+1), WIDTH, HEIGHT, QColor( r+int(dr*Y), \
g+int(dg*Y), b+int(db*Y) ) );  }
       }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic