| 762 | } |
| 763 | |
| 764 | void FloatSlider::LoadState(FileStreamIn& in, bool shouldSetValue) |
| 765 | { |
| 766 | int rev; |
| 767 | in >> rev; |
| 768 | |
| 769 | float var; |
| 770 | in >> var; |
| 771 | mRamp.SetValue(var); |
| 772 | |
| 773 | if (rev < 5) |
| 774 | { |
| 775 | bool hasLFO; |
| 776 | in >> hasLFO; |
| 777 | if (hasLFO) |
| 778 | { |
| 779 | FloatSliderLFOControl* lfo = AcquireLFO(); |
| 780 | if (shouldSetValue) |
| 781 | lfo->SetLFOEnabled(true); |
| 782 | |
| 783 | if (rev == 0) |
| 784 | { |
| 785 | mLFOControl->GetLFOSettings()->LoadState(in); |
| 786 | } |
| 787 | else if (rev > 0) |
| 788 | { |
| 789 | mLFOControl->LoadState(in, mLFOControl->LoadModuleSaveStateRev(in)); |
| 790 | } |
| 791 | if (shouldSetValue) |
| 792 | lfo->UpdateFromSettings(); |
| 793 | } |
| 794 | } |
| 795 | |
| 796 | if (rev >= 2) |
| 797 | { |
| 798 | in >> mModulatorMin; |
| 799 | in >> mModulatorMax; |
| 800 | } |
| 801 | |
| 802 | if (rev >= 3) |
| 803 | { |
| 804 | in >> mSmooth; |
| 805 | in >> mSmoothTarget; |
| 806 | in >> mIsSmoothing; |
| 807 | |
| 808 | if (mIsSmoothing) |
| 809 | TheTransport->AddAudioPoller(this); |
| 810 | } |
| 811 | |
| 812 | if (rev >= 4) |
| 813 | { |
| 814 | in >> mMin; |
| 815 | in >> mMax; |
| 816 | } |
| 817 | |
| 818 | if (rev >= 6) |
| 819 | { |
| 820 | int modeInt; |
| 821 | in >> modeInt; |
nothing calls this directly
no test coverage detected