|
|
|
@ -265,7 +265,6 @@ KMixDockWidget::getAvgVolume()
|
|
|
|
|
if ( md == 0 || md->maxVolume() == 0 )
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
kdDebug() << "Volume % is " << (md->getVolume().getAvgVolume(Volume::MMAIN)*100 )/( md->maxVolume() ) << endl;
|
|
|
|
|
return (md->getVolume().getAvgVolume(Volume::MMAIN)*100 )/( md->maxVolume() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -329,7 +328,13 @@ KMixDockWidget::updatePixmap(bool force)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
newPixmapType = 'd';
|
|
|
|
|
long avgVol = getAvgVolume();
|
|
|
|
|
if ( avgVol <= 35 )
|
|
|
|
|
newPixmapType = 'L';
|
|
|
|
|
else if ( avgVol <= 70 )
|
|
|
|
|
newPixmapType = 'M';
|
|
|
|
|
else
|
|
|
|
|
newPixmapType = 'H';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (( newPixmapType != _oldPixmapType ) || (force == true)) {
|
|
|
|
@ -339,9 +344,12 @@ KMixDockWidget::updatePixmap(bool force)
|
|
|
|
|
TQPixmap scaledpixmap;
|
|
|
|
|
TQImage newIcon;
|
|
|
|
|
switch ( newPixmapType ) {
|
|
|
|
|
case 'e': origpixmap = isShown() ? loadSizedIcon( "kmixdocked_error", width() ) : loadIcon( "kmixdocked_error"); break;
|
|
|
|
|
case 'm': origpixmap = isShown() ? loadSizedIcon( "kmixdocked_mute" , width() ) : loadIcon( "kmixdocked_mute"); break;
|
|
|
|
|
case 'd': origpixmap = isShown() ? loadSizedIcon( "kmixdocked" , width() ) : loadIcon( "kmixdocked "); break;
|
|
|
|
|
// AFAIK no icon theme has an icon analogous to kmixdocked_error
|
|
|
|
|
case 'e': origpixmap = isShown() ? loadSizedIcon( "kmixdocked_error" , width() ) : loadIcon( "kmixdocked_error" ); break;
|
|
|
|
|
case 'm': origpixmap = isShown() ? loadSizedIcon( "audio-volume-muted" , width() ) : loadIcon( "audio-volume-muted" ); break;
|
|
|
|
|
case 'L': origpixmap = isShown() ? loadSizedIcon( "audio-volume-low" , width() ) : loadIcon( "audio-volume-low" ); break;
|
|
|
|
|
case 'M': origpixmap = isShown() ? loadSizedIcon( "audio-volume-medium", width() ) : loadIcon( "audio-volume-medium" ); break;
|
|
|
|
|
case 'H': origpixmap = isShown() ? loadSizedIcon( "audio-volume-high" , width() ) : loadIcon( "audio-volume-high" ); break;
|
|
|
|
|
}
|
|
|
|
|
newIcon = origpixmap;
|
|
|
|
|
if (isShown()) {
|
|
|
|
|