|
|
|
|
@ -108,7 +108,8 @@ nmWxPebiResultControlBar::getPlaybackController() const
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::onPropertyIndexChanged(int nIndex)
|
|
|
|
|
{
|
|
|
|
|
if(m_pPlaybackController == nullptr || nIndex < 0) {
|
|
|
|
|
if(m_pPlaybackController == nullptr ||
|
|
|
|
|
m_pPlaybackController->isPlaying() || nIndex < 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(m_pPlaybackController->selectProperty(
|
|
|
|
|
@ -119,7 +120,8 @@ void nmWxPebiResultControlBar::onPropertyIndexChanged(int nIndex)
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::onTimeIndexChanged(int nIndex)
|
|
|
|
|
{
|
|
|
|
|
if(m_pPlaybackController == nullptr || nIndex < 0) {
|
|
|
|
|
if(m_pPlaybackController == nullptr ||
|
|
|
|
|
m_pPlaybackController->isPlaying() || nIndex < 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(m_pPlaybackController->selectFrame(
|
|
|
|
|
@ -131,12 +133,11 @@ void nmWxPebiResultControlBar::onTimeIndexChanged(int nIndex)
|
|
|
|
|
void nmWxPebiResultControlBar::onColorSettingsClicked()
|
|
|
|
|
{
|
|
|
|
|
if(m_pPlaybackController == nullptr || m_pSceneController == nullptr ||
|
|
|
|
|
m_pPlaybackController->isPlaying() ||
|
|
|
|
|
!m_pSceneController->hasSnapshot()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 打开任何结果设置都属于手动操作;关闭后不自动恢复播放。
|
|
|
|
|
m_pPlaybackController->pause();
|
|
|
|
|
nmWxPebiResultColorScaleSettingsDlg oDialog(
|
|
|
|
|
m_pSceneController, this);
|
|
|
|
|
connect(&oDialog, SIGNAL(displaySettingsApplied()),
|
|
|
|
|
@ -148,6 +149,10 @@ void nmWxPebiResultControlBar::onColorSettingsClicked()
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::onFirstFrameClicked()
|
|
|
|
|
{
|
|
|
|
|
if(m_pPlaybackController == nullptr ||
|
|
|
|
|
m_pPlaybackController->isPlaying()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(m_pPlaybackController->selectFirstFrame()) {
|
|
|
|
|
emit operationSucceeded();
|
|
|
|
|
}
|
|
|
|
|
@ -155,6 +160,10 @@ void nmWxPebiResultControlBar::onFirstFrameClicked()
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::onPreviousFrameClicked()
|
|
|
|
|
{
|
|
|
|
|
if(m_pPlaybackController == nullptr ||
|
|
|
|
|
m_pPlaybackController->isPlaying()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(m_pPlaybackController->selectPreviousFrame()) {
|
|
|
|
|
emit operationSucceeded();
|
|
|
|
|
}
|
|
|
|
|
@ -162,6 +171,10 @@ void nmWxPebiResultControlBar::onPreviousFrameClicked()
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::onNextFrameClicked()
|
|
|
|
|
{
|
|
|
|
|
if(m_pPlaybackController == nullptr ||
|
|
|
|
|
m_pPlaybackController->isPlaying()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(m_pPlaybackController->selectNextFrame()) {
|
|
|
|
|
emit operationSucceeded();
|
|
|
|
|
}
|
|
|
|
|
@ -169,6 +182,10 @@ void nmWxPebiResultControlBar::onNextFrameClicked()
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::onLastFrameClicked()
|
|
|
|
|
{
|
|
|
|
|
if(m_pPlaybackController == nullptr ||
|
|
|
|
|
m_pPlaybackController->isPlaying()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(m_pPlaybackController->selectLastFrame()) {
|
|
|
|
|
emit operationSucceeded();
|
|
|
|
|
}
|
|
|
|
|
@ -176,6 +193,9 @@ void nmWxPebiResultControlBar::onLastFrameClicked()
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::onPlayPauseClicked()
|
|
|
|
|
{
|
|
|
|
|
if(m_pPlaybackController == nullptr) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(m_pPlaybackController->togglePlayback()) {
|
|
|
|
|
emit operationSucceeded();
|
|
|
|
|
}
|
|
|
|
|
@ -183,8 +203,10 @@ void nmWxPebiResultControlBar::onPlayPauseClicked()
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::onAnimationSettingsClicked()
|
|
|
|
|
{
|
|
|
|
|
// 打开设置属于明确的手动操作;关闭对话框后不自动恢复播放。
|
|
|
|
|
m_pPlaybackController->pause();
|
|
|
|
|
if(m_pPlaybackController == nullptr ||
|
|
|
|
|
m_pPlaybackController->isPlaying()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
nmWxPebiResultAnimationSettingsDlg oDialog(
|
|
|
|
|
m_pPlaybackController->getPlaybackSpeed(),
|
|
|
|
|
m_pPlaybackController->isLoopEnabled(), this);
|
|
|
|
|
@ -254,9 +276,6 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
const bool bPropertyBlocked = m_pPropertyCombo->blockSignals(true);
|
|
|
|
|
m_pPropertyCombo->setCurrentIndex(nPropertyIndex);
|
|
|
|
|
m_pPropertyCombo->blockSignals(bPropertyBlocked);
|
|
|
|
|
m_pPropertyCombo->setEnabled(true);
|
|
|
|
|
m_pColorSettingsButton->setEnabled(true);
|
|
|
|
|
|
|
|
|
|
const bool bTimeDependent =
|
|
|
|
|
m_pPlaybackController->isPropertyTimeDependent(sPropertyId);
|
|
|
|
|
const int nFrameCount = bTimeDependent
|
|
|
|
|
@ -283,19 +302,23 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
const bool bHasTime = bHasCompleteTimeList;
|
|
|
|
|
const bool bHasMultipleFrames = bHasCompleteTimeList &&
|
|
|
|
|
nFrameCount > 1;
|
|
|
|
|
m_pTimeCombo->setEnabled(bHasTime);
|
|
|
|
|
const bool bPlaying = m_pPlaybackController->isPlaying();
|
|
|
|
|
m_pPropertyCombo->setEnabled(!bPlaying);
|
|
|
|
|
m_pColorSettingsButton->setEnabled(!bPlaying);
|
|
|
|
|
m_pTimeCombo->setEnabled(bHasTime && !bPlaying);
|
|
|
|
|
m_pFirstButton->setEnabled(
|
|
|
|
|
bHasMultipleFrames && nCurrentFrame > 0);
|
|
|
|
|
bHasMultipleFrames && nCurrentFrame > 0 && !bPlaying);
|
|
|
|
|
m_pPreviousButton->setEnabled(
|
|
|
|
|
bHasMultipleFrames && nCurrentFrame > 0);
|
|
|
|
|
bHasMultipleFrames && nCurrentFrame > 0 && !bPlaying);
|
|
|
|
|
m_pNextButton->setEnabled(
|
|
|
|
|
bHasMultipleFrames && nCurrentFrame < nFrameCount - 1);
|
|
|
|
|
bHasMultipleFrames &&
|
|
|
|
|
nCurrentFrame < nFrameCount - 1 && !bPlaying);
|
|
|
|
|
m_pLastButton->setEnabled(
|
|
|
|
|
bHasMultipleFrames && nCurrentFrame < nFrameCount - 1);
|
|
|
|
|
bHasMultipleFrames &&
|
|
|
|
|
nCurrentFrame < nFrameCount - 1 && !bPlaying);
|
|
|
|
|
m_pPlayPauseButton->setEnabled(bHasMultipleFrames);
|
|
|
|
|
m_pSettingsButton->setEnabled(bHasMultipleFrames);
|
|
|
|
|
m_pSettingsButton->setEnabled(bHasMultipleFrames && !bPlaying);
|
|
|
|
|
|
|
|
|
|
const bool bPlaying = m_pPlaybackController->isPlaying();
|
|
|
|
|
m_pPlayPauseButton->setIcon(QIcon(resultControlIconPath(
|
|
|
|
|
bPlaying ? QString::fromLatin1("NmStopAnimation.png")
|
|
|
|
|
: QString::fromLatin1("NmStartAnimation.png"))));
|
|
|
|
|
|