588 else |
592 else |
589 { |
593 { |
590 mButtonActions[EMPX5thButton]->setEnabled( true ); |
594 mButtonActions[EMPX5thButton]->setEnabled( true ); |
591 } |
595 } |
592 |
596 |
593 if ( ! details->mSeekable ) |
597 if ( details->mSeekable && details->mPausableStream ) |
|
598 { |
|
599 mButtonActions[EMPX2ndButton]->setEnabled( true ); |
|
600 mButtonActions[EMPX4thButton]->setEnabled( true ); |
|
601 } |
|
602 else |
594 { |
603 { |
595 mButtonActions[EMPX2ndButton]->setEnabled( false ); |
604 mButtonActions[EMPX2ndButton]->setEnabled( false ); |
596 mButtonActions[EMPX4thButton]->setEnabled( false ); |
605 mButtonActions[EMPX4thButton]->setEnabled( false ); |
597 } |
606 } |
|
607 |
|
608 if ( details->mPausableStream ) |
|
609 { |
|
610 mButtonActions[EMPX3rdButton]->setEnabled( true ); |
|
611 } |
598 else |
612 else |
599 { |
613 { |
600 mButtonActions[EMPX2ndButton]->setEnabled( true ); |
|
601 mButtonActions[EMPX4thButton]->setEnabled( true ); |
|
602 } |
|
603 |
|
604 if ( ! details->mPausableStream ) |
|
605 { |
|
606 mButtonActions[EMPX3rdButton]->setEnabled( false ); |
614 mButtonActions[EMPX3rdButton]->setEnabled( false ); |
607 } |
615 } |
|
616 |
|
617 // |
|
618 // toolbar creates button once it gets visible, so we don't know exact timing when toolbar |
|
619 // creates button, so start timer to get layout information once the toolbar gets visible. |
|
620 // This is needed since we don't use toolbar in proper way. |
|
621 // |
|
622 if ( ! mRetrieveButtonTimer && ! mButtons.count() ) |
|
623 { |
|
624 mRetrieveButtonTimer = new QTimer(); |
|
625 mRetrieveButtonTimer->setSingleShot( false ); |
|
626 mRetrieveButtonTimer->setInterval( KRetrieveButtonTimeOut ); |
|
627 connect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) ); |
|
628 |
|
629 mRetrieveButtonTimer->start(); |
|
630 } |
|
631 |
|
632 durationChanged( (qreal)mController->fileDetails()->mDuration / (qreal)KPbMilliMultiplier ); |
|
633 } |
|
634 |
|
635 // ------------------------------------------------------------------------------------------------- |
|
636 // QMPXVideoPlaybackToolBar::openDetailsView() |
|
637 // ------------------------------------------------------------------------------------------------- |
|
638 // |
|
639 void QMPXVideoPlaybackToolBar::openDetailsView() |
|
640 { |
|
641 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::openDetailsView()")); |
|
642 |
|
643 TPlaybackViewMode viewMode = mController->viewMode(); |
|
644 |
|
645 if ( viewMode == EFullScreenView ) |
|
646 { |
|
647 mController->changeViewMode( EDetailsView ); |
|
648 } |
|
649 } |
|
650 |
|
651 // ------------------------------------------------------------------------------------------------- |
|
652 // QMPXVideoPlaybackToolBar::positionChanged |
|
653 // ------------------------------------------------------------------------------------------------- |
|
654 // |
|
655 void QMPXVideoPlaybackToolBar::positionChanged( int position ) |
|
656 { |
|
657 MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::positionChanged position = %d"), position ); |
|
658 |
|
659 mPosition = position; |
|
660 } |
|
661 |
|
662 // ------------------------------------------------------------------------------------------------- |
|
663 // QMPXVideoPlaybackToolBar::durationChanged |
|
664 // ------------------------------------------------------------------------------------------------- |
|
665 // |
|
666 void QMPXVideoPlaybackToolBar::durationChanged( int duration ) |
|
667 { |
|
668 MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::durationChanged duration = %d"), duration ); |
|
669 |
|
670 mDuration = duration; |
|
671 } |
|
672 |
|
673 // ------------------------------------------------------------------------------------------------- |
|
674 // QMPXVideoPlaybackToolBar::setVisible |
|
675 // ------------------------------------------------------------------------------------------------- |
|
676 // |
|
677 void QMPXVideoPlaybackToolBar::setVisible( bool visible ) |
|
678 { |
|
679 MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::setVisible visible = %d"), visible ); |
|
680 |
|
681 if ( visible ) |
|
682 { |
|
683 mController->view()->showItems( Hb::ToolBarItem ); |
|
684 } |
608 else |
685 else |
609 { |
686 { |
610 mButtonActions[EMPX3rdButton]->setEnabled( true ); |
|
611 } |
|
612 } |
|
613 |
|
614 // ------------------------------------------------------------------------------------------------- |
|
615 // QMPXVideoPlaybackToolBar::openDetailsView() |
|
616 // ------------------------------------------------------------------------------------------------- |
|
617 // |
|
618 void QMPXVideoPlaybackToolBar::openDetailsView() |
|
619 { |
|
620 MPX_ENTER_EXIT(_L("QMPXVideoPlaybackToolBar::openDetailsView()")); |
|
621 |
|
622 TPlaybackViewMode viewMode = mController->viewMode(); |
|
623 |
|
624 if ( viewMode == EFullScreenView ) |
|
625 { |
|
626 mController->changeViewMode( EDetailsView ); |
|
627 } |
|
628 } |
|
629 |
|
630 // ------------------------------------------------------------------------------------------------- |
|
631 // QMPXVideoPlaybackToolBar::positionChanged |
|
632 // ------------------------------------------------------------------------------------------------- |
|
633 // |
|
634 void QMPXVideoPlaybackToolBar::positionChanged( int position ) |
|
635 { |
|
636 MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::positionChanged position = %d"), position ); |
|
637 |
|
638 mPosition = position; |
|
639 retrieveButtons(); |
|
640 } |
|
641 |
|
642 // ------------------------------------------------------------------------------------------------- |
|
643 // QMPXVideoPlaybackToolBar::durationChanged |
|
644 // ------------------------------------------------------------------------------------------------- |
|
645 // |
|
646 void QMPXVideoPlaybackToolBar::durationChanged( int duration ) |
|
647 { |
|
648 MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::durationChanged duration = %d"), duration ); |
|
649 |
|
650 mDuration = duration; |
|
651 } |
|
652 |
|
653 // ------------------------------------------------------------------------------------------------- |
|
654 // QMPXVideoPlaybackToolBar::setVisible |
|
655 // ------------------------------------------------------------------------------------------------- |
|
656 // |
|
657 void QMPXVideoPlaybackToolBar::setVisible( bool visible ) |
|
658 { |
|
659 MPX_DEBUG(_L("QMPXVideoPlaybackToolBar::setVisible visible = %d"), visible ); |
|
660 |
|
661 if ( visible ) |
|
662 { |
|
663 mController->view()->showItems( Hb::ToolBarItem ); |
|
664 |
|
665 if ( mNeverVisibled ) |
|
666 { |
|
667 mNeverVisibled = false; |
|
668 |
|
669 |
|
670 // |
|
671 // toolbar creates button once it gets visible, so we don't know exact timing when toolbar |
|
672 // creates button, so start timer to get layout information once the toolbar gets visible. |
|
673 // This is needed since we don't use toolbar in proper way. |
|
674 // |
|
675 mRetrieveButtonTimer = new QTimer(); |
|
676 mRetrieveButtonTimer->setSingleShot( false ); |
|
677 mRetrieveButtonTimer->setInterval( KRetrieveButtonTimeOut ); |
|
678 connect( mRetrieveButtonTimer, SIGNAL( timeout() ), this, SLOT( retrieveButtons() ) ); |
|
679 |
|
680 mRetrieveButtonTimer->start(); |
|
681 } |
|
682 } |
|
683 else |
|
684 { |
|
685 mController->view()->hideItems( Hb::ToolBarItem ); |
687 mController->view()->hideItems( Hb::ToolBarItem ); |
686 } |
688 } |
687 } |
689 } |
688 |
690 |
689 // ------------------------------------------------------------------------------------------------- |
691 // ------------------------------------------------------------------------------------------------- |