summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/audiowidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp45
1 files changed, 0 insertions, 45 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 37c565b..dda039c 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -324,69 +324,24 @@ void AudioWidget::stopSkip() {
324 killTimers(); 324 killTimers();
325} 325}
326 326
327 327
328void AudioWidget::timerEvent( QTimerEvent * ) { 328void AudioWidget::timerEvent( QTimerEvent * ) {
329 if ( skipDirection == +1 ) { 329 if ( skipDirection == +1 ) {
330 mediaPlayerState.setPosition( mediaPlayerState.position() + 2 ); 330 mediaPlayerState.setPosition( mediaPlayerState.position() + 2 );
331 } else if ( skipDirection == -1 ) { 331 } else if ( skipDirection == -1 ) {
332 mediaPlayerState.setPosition( mediaPlayerState.position() - 2 ); 332 mediaPlayerState.setPosition( mediaPlayerState.position() - 2 );
333 } 333 }
334} 334}
335 335
336
337void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
338 for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) {
339 Button &button = *it;
340 Command command = button.command;
341
342 if ( event->state() == QMouseEvent::LeftButton ) {
343 // The test to see if the mouse click is inside the button or not
344 bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command );
345
346 if ( isOnButton && !button.isHeld ) {
347 button.isHeld = TRUE;
348 toggleButton( button );
349 switch ( command ) {
350 case VolumeUp:
351 emit moreClicked();
352 return;
353 case VolumeDown:
354 emit lessClicked();
355 return;
356 case Forward:
357 emit forwardClicked();
358 return;
359 case Back:
360 emit backClicked();
361 return;
362 default: break;
363 }
364 } else if ( !isOnButton && button.isHeld ) {
365 button.isHeld = FALSE;
366 toggleButton( button );
367 }
368 } else {
369 if ( button.isHeld ) {
370 button.isHeld = FALSE;
371 if ( button.type != ToggleButton ) {
372 setToggleButton( button, FALSE );
373 }
374 handleCommand( command, button.isDown );
375 }
376 }
377 }
378}
379
380
381void AudioWidget::mousePressEvent( QMouseEvent *event ) { 336void AudioWidget::mousePressEvent( QMouseEvent *event ) {
382 mouseMoveEvent( event ); 337 mouseMoveEvent( event );
383} 338}
384 339
385 340
386void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { 341void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) {
387 mouseMoveEvent( event ); 342 mouseMoveEvent( event );
388} 343}
389 344
390 345
391void AudioWidget::showEvent( QShowEvent* ) { 346void AudioWidget::showEvent( QShowEvent* ) {
392 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); 347 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 );