Add FPS parameter to UI

This commit is contained in:
Seth Troisi 2022-03-02 00:07:25 -08:00
parent 2909af2408
commit 2ae68776a9
5 changed files with 45 additions and 2 deletions

View File

@ -1232,6 +1232,7 @@ void Fractorium::SetTabOrders()
w = SetTabOrder(this, w, ui.SequenceRotationsPerBlendCWCheckBox);
w = SetTabOrder(this, w, ui.SequenceRotationsPerBlendMaxSpinBox);
w = SetTabOrder(this, w, ui.SequenceLinearCheckBox);
w = SetTabOrder(this, w, ui.SequenceAnimationFpsSpinBox);
w = SetTabOrder(this, w, ui.SequenceGenerateButton);
w = SetTabOrder(this, w, ui.SequenceRenderButton);
w = SetTabOrder(this, w, ui.SequenceSaveButton);

View File

@ -8070,6 +8070,37 @@
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="SequenceAnimationFpsSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The number of frames per second for preview animation.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="suffix">
<string/>
</property>
<property name="prefix">
<string>Animation FPS: </string>
</property>
<property name="maximum">
<number>200</number>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="value">
<number>30</number>
</property>
</widget>
</item>
</layout>
</item>
<item>

View File

@ -65,8 +65,11 @@ void Fractorium::InitLibraryUI()
ui.SequenceRotationsPerBlendMaxSpinBox->setMinimum(m_Settings->RotationsPerBlend());//Upper min = lower max.
//Linear.
ui.SequenceLinearCheckBox->setChecked(m_Settings->Linear());
//Animation FPS.
ui.SequenceAnimationFpsSpinBox->setValue(m_Settings->AnimationFps());
}
/// <summary>
/// Select the item in the library tree specified by the passed in index.
/// </summary>
@ -849,8 +852,8 @@ void FractoriumEmberController<T>::SequenceAnimateButtonClicked()
{
animation->setExpanded(true);
m_AnimateFrame = 0;
const auto fps = 30;//TODO Make this a UI Parameter
m_AnimateTimer->start(1000 / fps);
// TODO look at duration based instead of time
m_AnimateTimer->start(1000 / m_Fractorium->ui.SequenceAnimationFpsSpinBox->value());
}
}
}
@ -1018,6 +1021,7 @@ void Fractorium::SyncSequenceSettings()
m_Settings->RotationsPerBlend(ui.SequenceRotationsPerBlendSpinBox->value());
m_Settings->RotationsPerBlendMax(ui.SequenceRotationsPerBlendMaxSpinBox->value());
m_Settings->Linear(ui.SequenceLinearCheckBox->isChecked());
m_Settings->AnimationFps(ui.SequenceAnimationFpsSpinBox->value());
}
template class FractoriumEmberController<float>;

View File

@ -242,6 +242,9 @@ void FractoriumSettings::RotationsPerBlendMax(uint i) { setValue(ROTATIONSPERBLE
bool FractoriumSettings::Linear() { return value(LINEAR).toBool(); }
void FractoriumSettings::Linear(bool b) { setValue(LINEAR, b); }
uint FractoriumSettings::AnimationFps() { return value(ANIMATION_FPS).toUInt(); }
void FractoriumSettings::AnimationFps(uint i) { setValue(ANIMATION_FPS, i); }
/// <summary>
/// Variations filter settings.
/// </summary>

View File

@ -43,6 +43,7 @@
#define ROTATIONSPERBLEND "sequence/rotationsperblend"
#define ROTATIONSPERBLENDMAX "sequence/rotationsperblendmax"
#define LINEAR "sequence/linear"
#define ANIMATION_FPS "sequence/animationfps"
#define VARFILTERSUM "varfilter/sumcheckbox"
#define VARFILTERASSIGN "varfilter/assigncheckbox"
@ -218,6 +219,9 @@ public:
bool Linear();
void Linear(bool b);
uint AnimationFps();
void AnimationFps(uint i);
int VarFilterSum();
void VarFilterSum(int i);