[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeextragear-1/amarok/amarok/analyzers (silent)
From: Enrico Ros <rosenric () dei ! unipd ! it>
Date: 2004-03-23 0:00:37
Message-ID: 20040323000037.C52B79993 () office ! kde ! org
[Download RAW message or body]
CVS commit by eros:
CVS_SILENT Some minor fix to gl analyzers.
M +3 -0 glanalyzer.cpp 1.18
M +15 -9 glanalyzer2.cpp 1.7
M +2 -2 glanalyzer3.cpp 1.3
--- kdeextragear-1/amarok/amarok/analyzers/glanalyzer.cpp #1.17:1.18
@@ -97,5 +97,8 @@ void GLAnalyzer::analyze( const Scope &s
void GLAnalyzer::initializeGL()
{
+ // Clear frame (next fading will be preferred to clearing)
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);// Set clear color to black
+ glClear( GL_COLOR_BUFFER_BIT );
+
// Set the shading model
glShadeModel(GL_SMOOTH);
--- kdeextragear-1/amarok/amarok/analyzers/glanalyzer2.cpp #1.6:1.7
@@ -134,5 +134,6 @@ void GLAnalyzer2::analyze( const Scope &
frame.energy = currentEnergy;
// printf( "%d [%f :: %f ]\t%f \n", bands, frame.energy, frame.meanBand, maxValue );
- }
+ } else
+ frame.energy = 0.0;
}
@@ -169,7 +170,11 @@ void GLAnalyzer2::paintGL()
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glEnable( GL_TEXTURE_2D );
+ float alphaN = show.paused ? 0.2 : (frame.energy / 10.0),
+ alphaP = show.paused ? 1.0 : (1 - frame.energy / 20.0);
+ if ( alphaN > 1.0 )
+ alphaN = 1.0;
+ if ( alphaP < 0.1 )
+ alphaP = 0.1;
glBindTexture( GL_TEXTURE_2D, w2Texture );
- float alphaN = 1.0 <? (frame.energy / 10.0),
- alphaP = 0.2 >? (1 - frame.energy / 20.0);
setTextureMatrix( show.rotDegrees, 0.707*alphaP );
glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
@@ -211,5 +216,7 @@ void GLAnalyzer2::paintGL()
if ( show.pauseTimer > 0.5 )
{
- show.pauseTimer -= 0.5;
+ if ( show.pauseTimer > 0.6 )
+ show.pauseTimer -= 0.6;
+ drawFullDot( 0.0f, 0.4f, 0.8f, 1.0f );
drawFullDot( 0.0f, 0.4f, 0.8f, 1.0f );
}
@@ -225,5 +232,5 @@ void GLAnalyzer2::paintGL()
glLoadIdentity();
- glRotatef( -frame.rotDegrees, 0,0,1 );
+// glRotatef( -frame.rotDegrees, 0,0,1 );
glBegin( GL_QUADS );
// Particle * particle = particleList.first();
@@ -234,7 +240,7 @@ void GLAnalyzer2::paintGL()
drawDot( 0, 0, 10 >? (10.0 * frame.energy) );
glColor4f( 1.0f, 0.0f, 0.0f, 1.0f );
- drawDot( 5, 0, 10 >? (5.0 * frame.energy) );
+ drawDot( 6, 0, 10 >? (5.0 * frame.energy) );
glColor4f( 0.0f, 0.4f, 1.0f, 1.0f );
- drawDot( -5, 0, 10 >? (5.0 * frame.energy) );
+ drawDot( -6, 0, 10 >? (5.0 * frame.energy) );
}
glEnd();
--- kdeextragear-1/amarok/amarok/analyzers/glanalyzer3.cpp #1.2:1.3
@@ -232,6 +232,6 @@ void GLAnalyzer3::paintGL()
show.dT = currentTime - show.timeStamp;
show.timeStamp = currentTime;
- if ( show.dT > 0.1 )
- show.dT = 0.1; // limit max dT to 0.1
+ if ( show.dT > 0.05 )
+ show.dT = 0.05; // limit max dT to 0.05
show.colorK += show.dT * 0.4;
if ( show.colorK > 3.0 )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic