void SavesSyncRequest::uploadNextFile() { if (_filesToUpload.empty()) { finishSync(true); return; } _currentUploadingFile = _filesToUpload.back(); _filesToUpload.pop_back(); debug(9, "SavesSyncRequest: uploading %s (%d %%)", _currentUploadingFile.c_str(), (int)(getProgress() * 100)); if (_storage->uploadStreamSupported()) { _workingRequest = _storage->upload( _storage->savesDirectoryPath() + _currentUploadingFile, g_system->getSavefileManager()->openRawFile(_currentUploadingFile), new Common::Callback<SavesSyncRequest, Storage::UploadResponse>(this, &SavesSyncRequest::fileUploadedCallback), new Common::Callback<SavesSyncRequest, Networking::ErrorResponse>(this, &SavesSyncRequest::fileUploadedErrorCallback) ); } else { _workingRequest = _storage->upload( _storage->savesDirectoryPath() + _currentUploadingFile, DefaultSaveFileManager::concatWithSavesPath(_currentUploadingFile), new Common::Callback<SavesSyncRequest, Storage::UploadResponse>(this, &SavesSyncRequest::fileUploadedCallback), new Common::Callback<SavesSyncRequest, Networking::ErrorResponse>(this, &SavesSyncRequest::fileUploadedErrorCallback) ); } if (!_workingRequest) finishError(Networking::ErrorResponse(this)); }
void evgSoftSeq::sync() { if(!isLoaded() || m_isSynced) return; // Ensure the sequencer will stop at some point m_seqRam->setRunMode(Single); // Ensure the sequencer won't start if it hasn't already m_seqRam->setTrigSrc(None); // At this point, if the sequencer is not running // then we know that it will never run. // If it is running, then we must wait for the // EOS interrupt. // It is possible that the sequencer has stopped, // but the callback for the EOS interrupt has not been // delivered. This would result in finishSync() // being called twice, however this is prevented // by the m_isSynced flag. if(!m_seqRam->isRunning()) { m_seqRam->disable(); finishSync(); // or finish immediately } else { if(mrmEVGSeqDebug>1) fprintf(stderr, "SS%u: Start sync\n",m_id); return; // wait for EOS } }
void evgSoftSeq::process_eos() { incNumOfRuns(); if(isLoaded() && !m_isSynced) finishSync(); // In single shot mode, auto-disable after // each run. if(m_runModeCt==Single && m_isEnabled) disable(); scanIoRequest(iorunscan); }