예제 #1
0
void TourWidget::handleSliderMove( int value )
{
    d->m_playback.seek( value / 100.0 );
    QTime nullTime( 0, 0, 0 );
    QTime time = nullTime.addSecs(  value / 100.0 );
    d->m_tourUi.m_elapsedTime->setText( QString("%L1:%L2").arg( time.minute(), 2, 10, QChar('0') ).arg( time.second(), 2, 10, QChar('0') ) );
}
예제 #2
0
void TourWidgetPrivate::handlePlaybackProgress(const double position)
{
    if( !m_tourUi.m_slider->isSliderDown() ){
        m_tourUi.m_slider->setValue( position * 100 );
        QTime nullTime( 0, 0, 0 );
        QTime time = nullTime.addSecs( position );
        m_tourUi.m_elapsedTime->setText( QString("%L1:%L2").arg( time.minute(), 2, 10, QChar('0') ).arg( time.second(), 2, 10, QChar('0') ) );
    }
}
예제 #3
0
void TourWidget::updateDuration()
{
    d->m_tourUi.m_slider->setMaximum( d->m_playback.duration() * 100 );
    QTime nullTime( 0, 0, 0 );
    QTime totalTime = nullTime.addSecs( d->m_playback.duration() );
    d->m_tourUi.m_totalTime->setText( QString("%L1:%L2").arg( totalTime.minute(), 2, 10, QChar('0') ).arg( totalTime.second(), 2, 10, QChar('0') ) );
    d->m_tourUi.m_slider->setValue( 0 );
    d->m_tourUi.m_elapsedTime->setText( QString("%L1:%L2").arg( 0, 2, 10, QChar('0') ).arg( 0, 2, 10, QChar('0') ) );
}
void MainWindow::showSubtitle()
{
	disconnect(m_ui->subtitleTextEdit, SIGNAL(textChanged()), this, SLOT(updateSubtitle()));
	disconnect(m_ui->xPositionSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateSubtitle()));
	disconnect(m_ui->yPositionSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateSubtitle()));
	disconnect(m_ui->beginTimeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(updateSubtitle()));
	disconnect(m_ui->lengthTimeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(updateSubtitle()));

	if (m_currentTrack < 0 || m_currentTrack > 1)
	{
		m_currentTrack = 0;
	}

	if (m_currentSubtitle < 0)
	{
		if (m_subtitles[m_currentTrack].count() > 0)
		{
			m_currentSubtitle = (m_subtitles[m_currentTrack].count() - 1);
		}
		else
		{
			m_currentSubtitle = 0;
		}
	}
	else if (m_currentSubtitle >= m_subtitles[m_currentTrack].count())
	{
		m_currentSubtitle = 0;
	}

	if (m_currentSubtitle < m_subtitles[m_currentTrack].count())
	{
		QTime nullTime(0, 0, 0, 0);

		m_ui->subtitleTextEdit->setPlainText(m_subtitles[m_currentTrack].at(m_currentSubtitle).text);
		m_ui->beginTimeEdit->setTime(nullTime.addMSecs((m_subtitles[m_currentTrack].at(m_currentSubtitle).beginTime * 1000)));
		m_ui->lengthTimeEdit->setTime(nullTime.addMSecs(((m_subtitles[m_currentTrack].at(m_currentSubtitle).endTime * 1000) - (m_subtitles[m_currentTrack].at(m_currentSubtitle).beginTime * 1000))));
		m_ui->xPositionSpinBox->setValue(m_subtitles[m_currentTrack].at(m_currentSubtitle).positionX);
		m_ui->yPositionSpinBox->setValue(m_subtitles[m_currentTrack].at(m_currentSubtitle).positionY);
	}
	else
	{
		m_ui->subtitleTextEdit->clear();
		m_ui->beginTimeEdit->setTime(QTime());
		m_ui->lengthTimeEdit->setTime(QTime());
		m_ui->xPositionSpinBox->setValue(0);
		m_ui->yPositionSpinBox->setValue(0);
	}

	connect(m_ui->subtitleTextEdit, SIGNAL(textChanged()), this, SLOT(updateSubtitle()));
	connect(m_ui->xPositionSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateSubtitle()));
	connect(m_ui->yPositionSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateSubtitle()));
	connect(m_ui->beginTimeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(updateSubtitle()));
	connect(m_ui->lengthTimeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(updateSubtitle()));
}
예제 #5
0
void TourWidgetPrivate::updateRootIndex()
{
    GeoDataTour *tour = findTour( m_document );
    if ( tour ){
        GeoDataPlaylist *playlist = tour->playlist();
        if ( playlist ) {
            m_tourUi.m_listView->setModel( m_widget->model()->treeModel() );
            m_tourUi.m_listView->setRootIndex( m_widget->model()->treeModel()->index( playlist ) );
            QObject::connect( m_tourUi.m_listView->selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ),
                              q, SLOT( updateButtonsStates() ) );
        }
        m_playback.setMarbleWidget( m_widget );
        m_playback.setTour( tour );
        m_tourUi.m_slider->setMaximum( m_playback.duration() * 100 );
        QTime nullTime( 0, 0, 0 );
        QTime time = nullTime.addSecs( m_playback.duration() );
        m_tourUi.m_totalTime->setText( QString("%L1:%L2").arg( time.minute(), 2, 10, QChar('0') ).arg( time.second(), 2, 10, QChar('0') ) );
        QObject::connect( &m_playback, SIGNAL( progressChanged( double ) ),
                         q, SLOT( handlePlaybackProgress( double ) ) );
        q->stopPlaying();
        m_tourUi.m_toolBarPlayback->setEnabled( true );
        bool isPlaybackEmpty = m_playback.mainTrackSize() != 0;
        m_tourUi.actionPlay->setEnabled( isPlaybackEmpty );
        m_tourUi.m_slider->setEnabled( isPlaybackEmpty );
        m_tourUi.m_actionRecord->setEnabled( isPlaybackEmpty );
        m_tourUi.actionStop->setEnabled( false );
        if( m_playback.mainTrackSize() > 0 ) {
            if( dynamic_cast<PlaybackFlyToItem*>( m_playback.mainTrackItemAt( 0 ) ) ) {
                QModelIndex playlistIndex = m_widget->model()->treeModel()->index( playlist );
                for( int i = 0; i < playlist->size(); ++i ) {
                    if( playlist->primitive( i )->nodeType() == GeoDataTypes::GeoDataFlyToType ) {
                        m_delegate->setFirstFlyTo( m_widget->model()->treeModel()->index( i, 0, playlistIndex ) );
                        break;
                    }
                }
            } else {
                m_delegate->setFirstFlyTo( QPersistentModelIndex() );
            }
        }
    }
}
예제 #6
0
/**
 Delete the current device wake-up alarm time in the RTC.
 Reference implementation completes the request with KErrNotSupported. This is required for automated testing.
 Actual plugins return expected values and this can be verified by manual testing
 For testing purposes it sets a pub sub property to a NULL value defined in test code.

 @param aStatus to complete when the operation has finished

 @see TRequestStatus
*/
void CRtcAdaptationRef::UnsetWakeupAlarm(TRequestStatus& aStatus)
	{
    if(!IsTestPsKeyDefined())
        {
        DEBUGPRINT1A("UnsetWakeupAlarm:: Calling Actual plugins functions (saartcadaptation.dll)");
        iSaaRtcAdaptationDll->UnsetWakeupAlarm(aStatus);
        }
    else
        {
        DEBUGPRINT1A("UnsetWakeupAlarm:: Calling ref plugins functions (rtcadaptationref.dll)");
        // Set this pub sub property to a NULL value because we are unsetting the RTC (for testing purposes)
        // The property is defined in the test code. In normal operation this will fail silently because the property has not been defined.
        TTime nullTime(Time::NullTTime());
        TPckgC<TTime> wakeupAlarmTimePckg(nullTime);
        RProperty::Set(KAlarmServerUID, KTestRTCValueKey, wakeupAlarmTimePckg);
        aStatus = KRequestPending;
        TRequestStatus* status = &aStatus;
        // No support for RTC on HRP/Techview.
        User::RequestComplete(status, KErrNotSupported);
        }
	}