|
|
@ -48,8 +48,9 @@ BlockAnalyzer::BlockAnalyzer( TQWidget *parent )
|
|
|
|
setMaximumWidth( MAX_COLUMNS*(WIDTH+1) -1 );
|
|
|
|
setMaximumWidth( MAX_COLUMNS*(WIDTH+1) -1 );
|
|
|
|
|
|
|
|
|
|
|
|
// mxcl says null pixmaps cause crashes, so let's play it safe
|
|
|
|
// mxcl says null pixmaps cause crashes, so let's play it safe
|
|
|
|
for ( uint i = 0; i < FADE_SIZE; ++i )
|
|
|
|
for ( uint i = 0; i < FADE_SIZE; ++i ) {
|
|
|
|
m_fade_bars[i].resize( 1, 1 );
|
|
|
|
m_fade_bars[i].resize( 1, 1 );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BlockAnalyzer::~BlockAnalyzer()
|
|
|
|
BlockAnalyzer::~BlockAnalyzer()
|
|
|
@ -80,23 +81,26 @@ BlockAnalyzer::resizeEvent( TQResizeEvent *e )
|
|
|
|
if( m_rows != oldRows ) {
|
|
|
|
if( m_rows != oldRows ) {
|
|
|
|
m_barPixmap.resize( WIDTH, m_rows*(HEIGHT+1) );
|
|
|
|
m_barPixmap.resize( WIDTH, m_rows*(HEIGHT+1) );
|
|
|
|
|
|
|
|
|
|
|
|
for ( uint i = 0; i < FADE_SIZE; ++i )
|
|
|
|
for ( uint i = 0; i < FADE_SIZE; ++i ) {
|
|
|
|
m_fade_bars[i].resize( WIDTH, m_rows*(HEIGHT+1) );
|
|
|
|
m_fade_bars[i].resize( WIDTH, m_rows*(HEIGHT+1) );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_yscale.resize( m_rows + 1 );
|
|
|
|
m_yscale.resize( m_rows + 1 );
|
|
|
|
|
|
|
|
|
|
|
|
const uint PRE = 1, PRO = 1; //PRE and PRO allow us to restrict the range somewhat
|
|
|
|
const uint PRE = 1, PRO = 1; //PRE and PRO allow us to restrict the range somewhat
|
|
|
|
|
|
|
|
|
|
|
|
for( uint z = 0; z < m_rows; ++z )
|
|
|
|
for( uint z = 0; z < m_rows; ++z ) {
|
|
|
|
m_yscale[z] = 1 - (log10( PRE+z ) / log10( PRE+m_rows+PRO ));
|
|
|
|
m_yscale[z] = 1 - (log10( PRE+z ) / log10( PRE+m_rows+PRO ));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_yscale[m_rows] = 0;
|
|
|
|
m_yscale[m_rows] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
determineStep();
|
|
|
|
determineStep();
|
|
|
|
paletteChange( palette() );
|
|
|
|
paletteChange( palette() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( width() > e->oldSize().width() || height() > e->oldSize().height() )
|
|
|
|
else if( width() > e->oldSize().width() || height() > e->oldSize().height() ) {
|
|
|
|
drawBackground();
|
|
|
|
drawBackground();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
analyze( m_scope );
|
|
|
|
analyze( m_scope );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -148,18 +152,25 @@ BlockAnalyzer::analyze( const Analyzer::Scope &s )
|
|
|
|
// Paint the background
|
|
|
|
// Paint the background
|
|
|
|
bitBlt( canvas(), 0, 0, background() );
|
|
|
|
bitBlt( canvas(), 0, 0, background() );
|
|
|
|
|
|
|
|
|
|
|
|
for( uint y, x = 0; x < m_scope.size(); ++x )
|
|
|
|
uint y;
|
|
|
|
|
|
|
|
for( uint x = 0; x < m_scope.size(); ++x )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (m_yscale.size() < 1) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// determine y
|
|
|
|
// determine y
|
|
|
|
for( y = 0; m_scope[x] < m_yscale[y]; ++y )
|
|
|
|
for( y = 0; m_scope[x] < m_yscale[y]; ++y )
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
// this is opposite to what you'd think, higher than y
|
|
|
|
// this is opposite to what you'd think, higher than y
|
|
|
|
// means the bar is lower than y (physically)
|
|
|
|
// means the bar is lower than y (physically)
|
|
|
|
if( (float)y > m_store[x] )
|
|
|
|
if( (float)y > m_store[x] ) {
|
|
|
|
y = int(m_store[x] += m_step);
|
|
|
|
y = int(m_store[x] += m_step);
|
|
|
|
else
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
m_store[x] = y;
|
|
|
|
m_store[x] = y;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if y is lower than m_fade_pos, then the bar has exceeded the height of the fadeout
|
|
|
|
// if y is lower than m_fade_pos, then the bar has exceeded the height of the fadeout
|
|
|
|
// if the fadeout is quite faded now, then display the new one
|
|
|
|
// if the fadeout is quite faded now, then display the new one
|
|
|
@ -174,15 +185,17 @@ BlockAnalyzer::analyze( const Analyzer::Scope &s )
|
|
|
|
bitBlt( canvas(), x*(WIDTH+1), y, &m_fade_bars[offset], 0, 0, WIDTH, height() - y );
|
|
|
|
bitBlt( canvas(), x*(WIDTH+1), y, &m_fade_bars[offset], 0, 0, WIDTH, height() - y );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if( m_fade_intensity[x] == 0 )
|
|
|
|
if( m_fade_intensity[x] == 0 ) {
|
|
|
|
m_fade_pos[x] = m_rows;
|
|
|
|
m_fade_pos[x] = m_rows;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//REMEMBER: y is a number from 0 to m_rows, 0 means all blocks are glowing, m_rows means none are
|
|
|
|
//REMEMBER: y is a number from 0 to m_rows, 0 means all blocks are glowing, m_rows means none are
|
|
|
|
bitBlt( canvas(), x*(WIDTH+1), y*(HEIGHT+1) + m_y, bar(), 0, y*(HEIGHT+1) );
|
|
|
|
bitBlt( canvas(), x*(WIDTH+1), y*(HEIGHT+1) + m_y, bar(), 0, y*(HEIGHT+1) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for( uint x = 0; x < m_store.size(); ++x )
|
|
|
|
for( uint x = 0; x < m_store.size(); ++x ) {
|
|
|
|
bitBlt( canvas(), x*(WIDTH+1), int(m_store[x])*(HEIGHT+1) + m_y, &m_topBarPixmap );
|
|
|
|
bitBlt( canvas(), x*(WIDTH+1), int(m_store[x])*(HEIGHT+1) + m_y, &m_topBarPixmap );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|