summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/audiowidget.cpp
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/audiowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp
index 54e7ceb..b96b1ef 100644
--- a/core/multimedia/opieplayer/audiowidget.cpp
+++ b/core/multimedia/opieplayer/audiowidget.cpp
@@ -67,31 +67,31 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
{
setCaption( tr("OpiePlayer") );
Config cfg("OpiePlayer");
cfg.setGroup("AudioWidget");
// QGridLayout *layout = new QGridLayout( this );
// layout->setSpacing( 2);
// layout->setMargin( 2);
QString backgroundPix, buttonsAllPix, buttonsBigPix, controlsPix, animatedPix;
backgroundPix=cfg.readEntry( " backgroundPix", "opieplayer/metalFinish");
buttonsAllPix=cfg.readEntry( "buttonsAllPix","opieplayer/mediaButtonsAll");
buttonsBigPix=cfg.readEntry( "buttonsBigPix","opieplayer/mediaButtonsBig");
controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls");
- animatedPix=cfg.readEntry( "animatedPix", "opieplayer/animatedButton");
+// animatedPix=cfg.readEntry( "animatedPix", "opieplayer/animatedButton");
setBackgroundPixmap( Resource::loadPixmap( backgroundPix) );
pixmaps[0] = new QPixmap( Resource::loadPixmap( buttonsAllPix ) );
pixmaps[1] = new QPixmap( Resource::loadPixmap( buttonsBigPix ) );
pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix ) );
- pixmaps[3] = new QPixmap( Resource::loadPixmap( animatedPix) );
+// pixmaps[3] = new QPixmap( Resource::loadPixmap( animatedPix) );
songInfo = new Ticker( this );
songInfo->setFocusPolicy( QWidget::NoFocus );
songInfo->setGeometry( QRect( 7, 3, 220, 20 ) );
// layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 );
slider = new QSlider( Qt::Horizontal, this );
slider->setFixedWidth( 220 );
slider->setFixedHeight( 20 );
slider->setMinValue( 0 );
slider->setMaxValue( 1 );
slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) );
@@ -111,25 +111,25 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
// Intialise state
setLength( mediaPlayerState->length() );
setPosition( mediaPlayerState->position() );
setLooping( mediaPlayerState->fullscreen() );
setPaused( mediaPlayerState->paused() );
setPlaying( mediaPlayerState->playing() );
}
AudioWidget::~AudioWidget() {
mediaPlayerState->isStreaming = FALSE;
- for ( int i = 0; i < 4; i++ )
+ for ( int i = 0; i < 3; i++ )
delete pixmaps[i];
}
static bool audioSliderBeingMoved = FALSE;
void AudioWidget::sliderPressed() {
audioSliderBeingMoved = TRUE;
}
@@ -211,30 +211,30 @@ void AudioWidget::paintButton( QPainter *p, int i ) {
int y = audioButtons[i].yPos;
int offset = 22 + 14 * audioButtons[i].isBig + audioButtons[i].isDown;
int buttonSize = 64 + audioButtons[i].isBig * (90 - 64);
p->drawPixmap( x, y, *pixmaps[audioButtons[i].isBig], buttonSize * (audioButtons[i].isDown + 2 * audioButtons[i].color), 0, buttonSize, buttonSize );
p->drawPixmap( x + offset, y + offset, *pixmaps[2], 18 * i, 0, 18, 18 );
}
void AudioWidget::timerEvent( QTimerEvent * ) {
static int frame = 0;
if ( !mediaPlayerState->paused() && audioButtons[ AudioPlay ].isDown ) {
frame = frame >= 7 ? 0 : frame + 1;
- int x = audioButtons[AudioPlay].xPos;
- int y = audioButtons[AudioPlay].yPos;
- QPainter p( this );
- // Optimize to only draw the little bit of the changing images which is different
- p.drawPixmap( x + 14, y + 8, *pixmaps[3], 32 * frame, 0, 32, 32 );
- p.drawPixmap( x + 37, y + 37, *pixmaps[2], 18 * AudioPlay, 0, 6, 3 );
+// int x = audioButtons[AudioPlay].xPos;
+// int y = audioButtons[AudioPlay].yPos;
+// QPainter p( this );
+// // Optimize to only draw the little bit of the changing images which is different
+// p.drawPixmap( x + 14, y + 8, *pixmaps[3], 32 * frame, 0, 32, 32 );
+// p.drawPixmap( x + 37, y + 37, *pixmaps[2], 18 * AudioPlay, 0, 6, 3 );
}
}
void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
for ( int i = 0; i < numButtons; i++ ) {
int size = audioButtons[i].isBig;
int x = audioButtons[i].xPos;
int y = audioButtons[i].yPos;
if ( event->state() == QMouseEvent::LeftButton ) {
// The test to see if the mouse click is inside the circular button or not
// (compared with the radius squared to avoid a square-root of our distance)