| 254 | } |
| 255 | |
| 256 | void LoopStorer::SaveState(FileStreamOut& out) |
| 257 | { |
| 258 | out << GetModuleSaveStateRev(); |
| 259 | |
| 260 | IDrawableModule::SaveState(out); |
| 261 | |
| 262 | out << mCurrentBufferIdx; |
| 263 | |
| 264 | for (auto* sampleData : mSamples) |
| 265 | { |
| 266 | if (!sampleData->mIsCurrentBuffer) |
| 267 | { |
| 268 | out << sampleData->mNumBars; |
| 269 | out << sampleData->mBufferLength; |
| 270 | if (sampleData->mBufferLength != -1) |
| 271 | sampleData->mBuffer->Save(out, sampleData->mBufferLength); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | void LoopStorer::LoadState(FileStreamIn& in, int rev) |
| 277 | { |