Esempio n. 1
0
void qAnimationDlg::onTotalTimeChanged(double newTime_sec)
{
	double previousTime_sec = computeTotalTime();
	if (previousTime_sec != newTime_sec)
	{
		assert(previousTime_sec != 0);
		double scale = newTime_sec / previousTime_sec;

		size_t vp1 = 0, vp2 = 0;
		while (getNextSegment(vp1, vp2))
		{
			assert(vp1 < stepSelectionList->count());
			m_videoSteps[vp1].duration_sec *= scale;

			if (vp2 == 0)
			{
				//loop case
				break;
			}
			vp1 = vp2;
		}

		//update current step
		updateCurrentStepDuration();
	}
}
Esempio n. 2
0
void qAnimationDlg::onCurrentStepChanged(int index)
{
	//update current step descriptor
	stepIndexLabel->setText(QString::number(index+1));

	updateCurrentStepDuration();

	applyViewport( m_videoSteps[index].interpolator.view1() );
}
Esempio n. 3
0
void qAnimationDlg::onStepTimeChanged(double time_sec)
{
	m_videoSteps[ getCurrentStepIndex() ].duration_sec = time_sec;

	//update total duration
	updateTotalDuration();
	//update current step
	updateCurrentStepDuration();
}
Esempio n. 4
0
void qAnimationDlg::onCurrentStepChanged(int index)
{
	//update current step descriptor
	stepIndexLabel->setText(QString::number(index+1));

	updateCurrentStepDuration();

	applyViewport( m_videoSteps[index].viewport );

	//check that the step is enabled
	bool isEnabled = (stepSelectionList->item(index)->checkState() == Qt::Checked);
	bool isLoop = loopCheckBox->isChecked();
	currentStepGroupBox->setEnabled(isEnabled && (index+1 < m_videoSteps.size() || isLoop));
}
Esempio n. 5
0
void qAnimationDlg::onTotalTimeChanged(double newTime_sec)
{
	double previousTime_sec = computeTotalTime();
	if (previousTime_sec != newTime_sec)
	{
		assert(previousTime_sec != 0);
		double scale = newTime_sec / previousTime_sec;

		//scale all the steps
		for ( size_t i=0; i<m_videoSteps.size(); ++i )
		{
			m_videoSteps[i].duration_sec *= scale;
		}

		//update current step
		updateCurrentStepDuration();
	}
}