Audacity 3.2.0
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
audacity::cloud::audiocom::CloudSyncService Class Referencefinal

#include <CloudSyncService.h>

Collaboration diagram for audacity::cloud::audiocom::CloudSyncService:
[legend]

Public Types

enum class  SyncMode { Normal , ForceOverwrite , ForceNew }
 
enum class  ProjectState { NotAvaliable , PendingSync , FullySynced }
 
using SyncPromise = std::promise< sync::ProjectSyncResult >
 
using SyncFuture = std::future< sync::ProjectSyncResult >
 
using GetProjectsPromise = std::promise< sync::GetProjectsResult >
 
using GetProjectsFuture = std::future< sync::GetProjectsResult >
 
using GetHeadSnapshotIDPromise = std::promise< sync::GetHeadSnapshotIDResult >
 
using GetHeadSnapshotIDFuture = std::future< sync::GetHeadSnapshotIDResult >
 

Public Member Functions

GetProjectsFuture GetProjects (concurrency::CancellationContextPtr context, int page, int pageSize, std::string_view searchString)
 Retrieve the list of projects from the cloud. More...
 
SyncFuture OpenFromCloud (std::string projectId, std::string snapshotId, SyncMode mode, sync::ProgressCallback callback)
 Open the project from the cloud. This operation is asynchronous. More...
 
SyncFuture SyncProject (AudacityProject &project, const std::string &path, bool forceSync, sync::ProgressCallback callback)
 
GetHeadSnapshotIDFuture GetHeadSnapshotID (std::string_view projectId)
 

Static Public Member Functions

static CloudSyncServiceGet ()
 
static bool IsCloudProject (const std::string &path)
 
static ProjectState GetProjectState (const std::string &projectId)
 

Private Member Functions

 CloudSyncService ()=default
 
 ~CloudSyncService ()=default
 
 CloudSyncService (const CloudSyncService &)=delete
 
 CloudSyncService (CloudSyncService &&)=delete
 
CloudSyncServiceoperator= (const CloudSyncService &)=delete
 
CloudSyncServiceoperator= (CloudSyncService &&)=delete
 
void FailSync (ResponseResult responseResult)
 
void CompleteSync (std::string path)
 
void CompleteSync (sync::ProjectSyncResult result)
 
void SyncCloudSnapshot (const sync::ProjectInfo &projectInfo, const sync::SnapshotInfo &snapshotInfo, SyncMode mode)
 
void UpdateDowloadProgress (double downloadProgress)
 
void ReportUploadStats (std::string_view projectId, const TransferStats &stats)
 

Private Attributes

std::vector< std::shared_ptr< sync::LocalProjectSnapshot > > mLocalSnapshots
 
std::shared_ptr< sync::RemoteProjectSnapshotmRemoteSnapshot
 
SyncPromise mSyncPromise
 
sync::ProgressCallback mProgressCallback
 
std::atomic< double > mDownloadProgress { 0.0 }
 
std::atomic< bool > mProgressUpdateQueued { false }
 
std::atomic< bool > mSyncInProcess { false }
 

Detailed Description

CloudSyncService is responsible for saving and loading projects from the cloud

Definition at line 63 of file CloudSyncService.h.

Member Typedef Documentation

◆ GetHeadSnapshotIDFuture

Definition at line 83 of file CloudSyncService.h.

◆ GetHeadSnapshotIDPromise

Definition at line 82 of file CloudSyncService.h.

◆ GetProjectsFuture

Definition at line 80 of file CloudSyncService.h.

◆ GetProjectsPromise

Definition at line 79 of file CloudSyncService.h.

◆ SyncFuture

Definition at line 77 of file CloudSyncService.h.

◆ SyncPromise

Definition at line 76 of file CloudSyncService.h.

Member Enumeration Documentation

◆ ProjectState

Enumerator
NotAvaliable 
PendingSync 
FullySynced 

Definition at line 108 of file CloudSyncService.h.

109 {
110 NotAvaliable,
111 PendingSync,
112 FullySynced
113 };

◆ SyncMode

Enumerator
Normal 
ForceOverwrite 
ForceNew 

Definition at line 85 of file CloudSyncService.h.

Constructor & Destructor Documentation

◆ CloudSyncService() [1/3]

audacity::cloud::audiocom::CloudSyncService::CloudSyncService ( )
privatedefault

◆ ~CloudSyncService()

audacity::cloud::audiocom::CloudSyncService::~CloudSyncService ( )
privatedefault

◆ CloudSyncService() [2/3]

audacity::cloud::audiocom::CloudSyncService::CloudSyncService ( const CloudSyncService )
privatedelete

◆ CloudSyncService() [3/3]

audacity::cloud::audiocom::CloudSyncService::CloudSyncService ( CloudSyncService &&  )
privatedelete

Member Function Documentation

◆ CompleteSync() [1/2]

void audacity::cloud::audiocom::CloudSyncService::CompleteSync ( std::string  path)
private

Definition at line 507 of file CloudSyncService.cpp.

◆ CompleteSync() [2/2]

void audacity::cloud::audiocom::CloudSyncService::CompleteSync ( sync::ProjectSyncResult  result)
private

Definition at line 513 of file CloudSyncService.cpp.

514{
515 if (mRemoteSnapshot)
516 {
517 result.Stats = mRemoteSnapshot->GetTransferStats();
518 ReportUploadStats(mRemoteSnapshot->GetProjectId(), result.Stats);
519 }
520
521 mSyncPromise.set_value(std::move(result));
522 mRemoteSnapshot.reset();
523 mSyncInProcess.store(false);
524}
std::shared_ptr< sync::RemoteProjectSnapshot > mRemoteSnapshot
void ReportUploadStats(std::string_view projectId, const TransferStats &stats)

References audacity::cloud::audiocom::sync::ProjectSyncResult::Stats.

◆ FailSync()

void audacity::cloud::audiocom::CloudSyncService::FailSync ( ResponseResult  responseResult)
private

Definition at line 499 of file CloudSyncService.cpp.

500{
502 sync::ProjectSyncResult { sync::ProjectSyncResult::StatusCode::Failed,
503 std::move(responseResult),
504 {} });
505}

◆ Get()

CloudSyncService & audacity::cloud::audiocom::CloudSyncService::Get ( )
static

Definition at line 280 of file CloudSyncService.cpp.

281{
282 static CloudSyncService service;
283 return service;
284}

Referenced by audacity::cloud::audiocom::sync::OpenProjectFromCloud(), audacity::cloud::audiocom::sync::ProjectsListDialog::ProjectsTableData::Refresh(), and audacity::cloud::audiocom::sync::SyncCloudProject().

Here is the caller graph for this function:

◆ GetHeadSnapshotID()

CloudSyncService::GetHeadSnapshotIDFuture audacity::cloud::audiocom::CloudSyncService::GetHeadSnapshotID ( std::string_view  projectId)

Definition at line 477 of file CloudSyncService.cpp.

478{
480
481 auto promise = std::make_shared<GetHeadSnapshotIDPromise>();
482
484 GetOAuthService(), GetServiceConfig(), std::string(projectId),
485 [promise](sync::ProjectInfo projectInfo, ResponseResult result)
486 {
487 if (result.Code != SyncResultCode::Success)
488 {
489 promise->set_value(
490 sync::GetHeadSnapshotIDResult { std::move(result) });
491 }
492 else
493 promise->set_value({ projectInfo.HeadSnapshot.Id });
494 });
495
496 return promise->get_future();
497}
#define ASSERT_MAIN_THREAD()
Definition: BasicUI.h:414
void GetProjectInfo(OAuthService &oAuthService, const ServiceConfig &serviceConfig, std::string projectId, std::function< void(sync::ProjectInfo, ResponseResult)> callback)
OAuthService & GetOAuthService()
Returns the instance of the OAuthService.
const ServiceConfig & GetServiceConfig()
Returns the instance of the ServiceConfig.

References ASSERT_MAIN_THREAD, audacity::cloud::audiocom::ResponseResult::Code, audacity::cloud::audiocom::GetOAuthService(), audacity::cloud::audiocom::anonymous_namespace{CloudSyncService.cpp}::GetProjectInfo(), audacity::cloud::audiocom::GetServiceConfig(), audacity::cloud::audiocom::sync::ProjectInfo::HeadSnapshot, and audacity::cloud::audiocom::sync::SnapshotInfo::Id.

Referenced by audacity::cloud::audiocom::sync::OpenProjectFromCloud().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetProjects()

CloudSyncService::GetProjectsFuture audacity::cloud::audiocom::CloudSyncService::GetProjects ( concurrency::CancellationContextPtr  context,
int  page,
int  pageSize,
std::string_view  searchString 
)

Retrieve the list of projects from the cloud.

Definition at line 286 of file CloudSyncService.cpp.

289{
290 using namespace audacity::network_manager;
291
292 auto promise = std::make_shared<GetProjectsPromise>();
293
294 auto& serviceConfig = GetServiceConfig();
295 auto& oAuthService = GetOAuthService();
296
297 auto request =
298 Request(serviceConfig.GetProjectsUrl(page, pageSize, searchString));
299
300 request.setHeader(
302 request.setHeader(
304
305 SetCommonHeaders(request);
306
307 auto response = NetworkManager::GetInstance().doGet(request);
308
309 context->OnCancelled(response);
310
311 response->setRequestFinishedCallback(
312 [promise, response](auto)
313 {
314 auto responseResult = GetResponseResult(*response, true);
315
316 if (responseResult.Code != SyncResultCode::Success)
317 {
318 promise->set_value(responseResult);
319 return;
320 }
321
322 auto projects =
323 sync::DeserializePaginatedProjectsResponse(responseResult.Content);
324
325 if (!projects)
326 {
327 promise->set_value(
328 ResponseResult { SyncResultCode::UnexpectedResponse,
329 std::move(responseResult.Content) });
330 return;
331 }
332
333 promise->set_value(std::move(*projects));
334 });
335
336 return promise->get_future();
337}
ResponsePtr doGet(const Request &request)
std::optional< PaginatedProjectsResponse > DeserializePaginatedProjectsResponse(const std::string &data)
void SetCommonHeaders(Request &request)
ResponseResult GetResponseResult(IResponse &response, bool readBody)

References audacity::network_manager::common_headers::Accept, audacity::network_manager::common_content_types::ApplicationJson, audacity::network_manager::common_headers::ContentType, audacity::cloud::audiocom::sync::DeserializePaginatedProjectsResponse(), anonymous_namespace{FrameStatistics.cpp}::GetInstance(), audacity::cloud::audiocom::GetOAuthService(), audacity::cloud::audiocom::GetResponseResult(), audacity::cloud::audiocom::GetServiceConfig(), and audacity::cloud::audiocom::SetCommonHeaders().

Referenced by audacity::cloud::audiocom::sync::ProjectsListDialog::ProjectsTableData::Refresh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetProjectState()

CloudSyncService::ProjectState audacity::cloud::audiocom::CloudSyncService::GetProjectState ( const std::string &  projectId)
static

Definition at line 458 of file CloudSyncService.cpp.

459{
460 auto& cloudDatabase = sync::CloudProjectsDatabase::Get();
461
462 auto projectInfo = cloudDatabase.GetProjectData(projectId);
463
464 if (!projectInfo)
466
467 if (!wxFileExists(ToWXString(projectInfo->LocalPath)))
469
470 if (projectInfo->SyncStatus == sync::DBProjectData::SyncStatusSynced)
472
474}
wxString ToWXString(const std::string &str)

References BasicUI::Get(), and audacity::ToWXString().

Referenced by audacity::cloud::audiocom::sync::ProjectsListDialog::OnOpen().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsCloudProject()

bool audacity::cloud::audiocom::CloudSyncService::IsCloudProject ( const std::string &  path)
static

Definition at line 449 of file CloudSyncService.cpp.

450{
451 auto& cloudDatabase = sync::CloudProjectsDatabase::Get();
452 auto projectInfo = cloudDatabase.GetProjectDataForPath(path);
453
454 return projectInfo.has_value();
455}

References BasicUI::Get().

Here is the call graph for this function:

◆ OpenFromCloud()

CloudSyncService::SyncFuture audacity::cloud::audiocom::CloudSyncService::OpenFromCloud ( std::string  projectId,
std::string  snapshotId,
SyncMode  mode,
sync::ProgressCallback  callback 
)

Open the project from the cloud. This operation is asynchronous.

Definition at line 339 of file CloudSyncService.cpp.

342{
344
345 // Reset promise
346 mSyncPromise = {};
347
348 if (mSyncInProcess.exchange(true))
349 {
351 return mSyncPromise.get_future();
352 }
353
354 if (projectId.empty())
355 {
356 FailSync({ SyncResultCode::InternalClientError, "Empty projectId" });
357 return mSyncPromise.get_future();
358 }
359
360 if (!callback)
361 mProgressCallback = [](auto...) { return true; };
362 else
363 mProgressCallback = std::move(callback);
364
366 GetOAuthService(), GetServiceConfig(), projectId, snapshotId,
367 [this, mode](
368 sync::ProjectInfo projectInfo, sync::SnapshotInfo snapshotInfo,
369 ResponseResult result)
370 {
371 if (result.Code != SyncResultCode::Success)
372 FailSync(std::move(result));
373 else
374 SyncCloudSnapshot(projectInfo, snapshotInfo, mode);
375 });
376
377 return mSyncPromise.get_future();
378}
void FailSync(ResponseResult responseResult)
void SyncCloudSnapshot(const sync::ProjectInfo &projectInfo, const sync::SnapshotInfo &snapshotInfo, SyncMode mode)
void GetSnapshotInfo(OAuthService &oAuthService, const ServiceConfig &serviceConfig, std::string projectId, std::string snapshotId, std::function< void(sync::ProjectInfo, sync::SnapshotInfo, ResponseResult result)> callback)

References ASSERT_MAIN_THREAD, audacity::cloud::audiocom::ResponseResult::Code, audacity::cloud::audiocom::GetOAuthService(), audacity::cloud::audiocom::GetServiceConfig(), and audacity::cloud::audiocom::anonymous_namespace{CloudSyncService.cpp}::GetSnapshotInfo().

Referenced by audacity::cloud::audiocom::sync::OpenProjectFromCloud().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

CloudSyncService & audacity::cloud::audiocom::CloudSyncService::operator= ( CloudSyncService &&  )
privatedelete

◆ operator=() [2/2]

CloudSyncService & audacity::cloud::audiocom::CloudSyncService::operator= ( const CloudSyncService )
privatedelete

◆ ReportUploadStats()

void audacity::cloud::audiocom::CloudSyncService::ReportUploadStats ( std::string_view  projectId,
const TransferStats stats 
)
private

Definition at line 650 of file CloudSyncService.cpp.

652{
653 sync::NetworkStats networkStats;
654
655 networkStats.Bytes = stats.BytesTransferred;
656 networkStats.Blocks = stats.BlocksTransferred;
657 networkStats.Files = stats.ProjectFilesTransferred;
658 networkStats.Mixes = 0;
659 networkStats.IsDownload = true;
660
661 using namespace audacity::network_manager;
662
663 auto request = Request(GetServiceConfig().GetNetworkStatsUrl(projectId));
664
665 request.setHeader(
667
668 SetCommonHeaders(request);
669
670 auto body = Serialize(networkStats);
671
672 auto response =
673 NetworkManager::GetInstance().doPost(request, body.data(), body.size());
674 // Keep response alive
675 response->setRequestFinishedCallback([response](auto) {});
676}
ResponsePtr doPost(const Request &request, const void *data, size_t size)
std::string Serialize(const ProjectForm &form)

References audacity::network_manager::common_content_types::ApplicationJson, audacity::cloud::audiocom::sync::NetworkStats::Blocks, audacity::cloud::audiocom::TransferStats::BlocksTransferred, audacity::cloud::audiocom::sync::NetworkStats::Bytes, audacity::cloud::audiocom::TransferStats::BytesTransferred, audacity::network_manager::common_headers::ContentType, audacity::cloud::audiocom::sync::NetworkStats::Files, anonymous_namespace{FrameStatistics.cpp}::GetInstance(), audacity::cloud::audiocom::GetServiceConfig(), audacity::cloud::audiocom::sync::NetworkStats::IsDownload, audacity::cloud::audiocom::sync::NetworkStats::Mixes, audacity::cloud::audiocom::TransferStats::ProjectFilesTransferred, audacity::cloud::audiocom::sync::Serialize(), and audacity::cloud::audiocom::SetCommonHeaders().

Here is the call graph for this function:

◆ SyncCloudSnapshot()

void audacity::cloud::audiocom::CloudSyncService::SyncCloudSnapshot ( const sync::ProjectInfo projectInfo,
const sync::SnapshotInfo snapshotInfo,
SyncMode  mode 
)
private

Definition at line 526 of file CloudSyncService.cpp.

529{
530 // Get the project location
531 auto localProjectInfo =
533
534 const auto createNew = !localProjectInfo || mode == SyncMode::ForceNew;
535
536 const auto wxPath = createNew ?
539 audacity::ToWXString(projectInfo.Name)) :
540 audacity::ToWXString(localProjectInfo->LocalPath);
541
542 const auto utf8Path = audacity::ToUTF8(wxPath);
543
544 const auto fileExists = wxFileExists(wxPath);
545
546 if (!fileExists)
547 {
548 if (snapshotInfo.Id.empty())
549 {
551 return;
552 }
553
554 const auto dir = CloudProjectsSavePath.Read();
555 FileNames::MkDir(dir);
556
558 ProjectFileIO::Get(project.Project()).LoadProject(wxPath, true);
559 }
560 else
561 {
562 assert(localProjectInfo.has_value());
563 assert(mode != SyncMode::ForceNew);
564 // The project exists on the disk. Depending on how we got here, we might
565 // different scenarios:
566 // 1. Local snapshot ID matches the remote snapshot ID. Just complete the
567 // sync right away. If the project was modified locally, but not saved,
568 // the user will be prompted about the autosave.
569 if (
570 localProjectInfo->SnapshotId == snapshotInfo.Id &&
571 localProjectInfo->SyncStatus != sync::DBProjectData::SyncStatusDownloading)
572 {
575 return;
576 }
577 // 2. Project sync was interrupted.
578 if (
579 mode == SyncMode::Normal &&
580 localProjectInfo->SyncStatus == sync::DBProjectData::SyncStatusUploading)
581 {
582 // There is not enough information to decide if the project has
583 // diverged. Just open it, so the sync can resume. If the project has
584 // diverged, the user will be prompted to resolve the conflict on the
585 // next save.
588 return;
589 }
590 // 3. Project was modified locally, but not saved.
591 if (HasAutosave(utf8Path))
592 {
593 if (mode == SyncMode::Normal)
594 {
596 return;
597 }
598 else
599 DropAutosave(utf8Path);
600 }
601 }
602
603 if (snapshotInfo.Id.empty())
604 {
606 return;
607 }
608
610 projectInfo, snapshotInfo, utf8Path,
611 [this, createNew, path = utf8Path, projectId = projectInfo.Id,
612 snapshotId = snapshotInfo.Id](sync::RemoteProjectSnapshotState state)
613 {
614 UpdateDowloadProgress(
615 (state.ProjectDownloaded + state.BlocksDownloaded) /
616 (state.BlocksTotal + 1.0));
617
618 if (state.IsComplete())
619 {
620 const bool success = state.Result.Code == SyncResultCode::Success;
621
622 CompleteSync({ success ?
623 sync::ProjectSyncResult::StatusCode::Succeeded :
624 sync::ProjectSyncResult::StatusCode::Failed,
625 std::move(state.Result), std::move(path) });
626 }
627 },
628 mode == SyncMode::ForceNew);
629}
const auto project
Makes a temporary project that doesn't display on the screen.
std::optional< TentativeConnection > LoadProject(const FilePath &fileName, bool ignoreAutosave)
static ProjectFileIO & Get(AudacityProject &project)
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:207
std::optional< DBProjectData > GetProjectData(std::string_view projectId) const
static std::shared_ptr< RemoteProjectSnapshot > Sync(ProjectInfo projectInfo, SnapshotInfo snapshotInfo, std::string path, RemoteProjectSnapshotStateCallback callback, bool downloadDetached)
FILES_API wxString MkDir(const wxString &Str)
wxString MakeSafeProjectPath(const wxString &rootDir, const wxString &projectName)
std::string ToUTF8(const std::wstring &wstr)

References audacity::cloud::audiocom::CloudProjectsSavePath, audacity::network_manager::HttpCode::Conflict, audacity::cloud::audiocom::anonymous_namespace{CloudSyncService.cpp}::DropAutosave(), BasicUI::Get(), ProjectFileIO::Get(), audacity::cloud::audiocom::anonymous_namespace{CloudSyncService.cpp}::HasAutosave(), audacity::cloud::audiocom::sync::SnapshotInfo::Id, audacity::cloud::audiocom::sync::ProjectInfo::Id, ProjectFileIO::LoadProject(), audacity::cloud::audiocom::sync::MakeSafeProjectPath(), FileNames::MkDir(), audacity::cloud::audiocom::sync::ProjectInfo::Name, project, Setting< T >::Read(), Journal::Sync(), audacity::ToUTF8(), and audacity::ToWXString().

Here is the call graph for this function:

◆ SyncProject()

CloudSyncService::SyncFuture audacity::cloud::audiocom::CloudSyncService::SyncProject ( AudacityProject project,
const std::string &  path,
bool  forceSync,
sync::ProgressCallback  callback 
)

Definition at line 380 of file CloudSyncService.cpp.

383{
385
386 // Reset promise
387 mSyncPromise = {};
388
389 if (mSyncInProcess.exchange(true))
390 {
392 return mSyncPromise.get_future();
393 }
394
395 if (!callback)
396 mProgressCallback = [](auto...) { return true; };
397 else
398 mProgressCallback = std::move(callback);
399
400 auto& cloudDatabase = sync::CloudProjectsDatabase::Get();
401
402 auto projectInfo = cloudDatabase.GetProjectDataForPath(path);
403
404 if (!projectInfo)
405 {
406 // We assume, that the project is local
407 CompleteSync(path);
408 return mSyncPromise.get_future();
409 }
410
412 GetOAuthService(), GetServiceConfig(), projectInfo->ProjectId,
413 [projectInfo = *projectInfo, &project, path,
414 mode = forceSync ? SyncMode::ForceOverwrite : SyncMode::Normal,
415 this](sync::ProjectInfo remoteInfo, ResponseResult result)
416 {
417 if (result.Code != SyncResultCode::Success)
418 {
419 FailSync(std::move(result));
420 return;
421 }
422
423 // Do not perform the snapshot request if the project is up to date
424 if (remoteInfo.HeadSnapshot.Id == projectInfo.SnapshotId)
425 {
426 CompleteSync({ sync::ProjectSyncResult::StatusCode::Succeeded });
427 return;
428 }
429
430 const auto snapshotId = remoteInfo.HeadSnapshot.Synced > 0 ?
431 remoteInfo.HeadSnapshot.Id :
432 remoteInfo.LastSyncedSnapshotId;
433
435 GetOAuthService(), GetServiceConfig(), remoteInfo.Id, snapshotId,
436 [this, &project, mode,
437 remoteInfo](sync::SnapshotInfo snapshotInfo, ResponseResult result)
438 {
439 if (result.Code != SyncResultCode::Success)
440 FailSync(std::move(result));
441 else
442 SyncCloudSnapshot(remoteInfo, snapshotInfo, mode);
443 });
444 });
445
446 return mSyncPromise.get_future();
447}

References ASSERT_MAIN_THREAD, BasicUI::Get(), audacity::cloud::audiocom::GetOAuthService(), audacity::cloud::audiocom::anonymous_namespace{CloudSyncService.cpp}::GetProjectInfo(), audacity::cloud::audiocom::GetServiceConfig(), audacity::cloud::audiocom::sync::ProjectInfo::HeadSnapshot, audacity::cloud::audiocom::sync::SnapshotInfo::Id, and project.

Referenced by audacity::cloud::audiocom::sync::SyncCloudProject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDowloadProgress()

void audacity::cloud::audiocom::CloudSyncService::UpdateDowloadProgress ( double  downloadProgress)
private

Definition at line 631 of file CloudSyncService.cpp.

632{
633 mDownloadProgress.store(downloadProgress);
634
635 if (mProgressUpdateQueued.exchange(true))
636 return;
637
639 [this]
640 {
641 auto remoteSnapshot = mRemoteSnapshot;
642
643 if (remoteSnapshot && !mProgressCallback(mDownloadProgress.load()))
644 remoteSnapshot->Cancel();
645
646 mProgressUpdateQueued.store(false);
647 });
648}
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Definition: BasicUI.cpp:214

References BasicUI::CallAfter().

Here is the call graph for this function:

Member Data Documentation

◆ mDownloadProgress

std::atomic<double> audacity::cloud::audiocom::CloudSyncService::mDownloadProgress { 0.0 }
private

Definition at line 140 of file CloudSyncService.h.

◆ mLocalSnapshots

std::vector<std::shared_ptr<sync::LocalProjectSnapshot> > audacity::cloud::audiocom::CloudSyncService::mLocalSnapshots
private

Definition at line 134 of file CloudSyncService.h.

◆ mProgressCallback

sync::ProgressCallback audacity::cloud::audiocom::CloudSyncService::mProgressCallback
private

Definition at line 138 of file CloudSyncService.h.

◆ mProgressUpdateQueued

std::atomic<bool> audacity::cloud::audiocom::CloudSyncService::mProgressUpdateQueued { false }
private

Definition at line 141 of file CloudSyncService.h.

◆ mRemoteSnapshot

std::shared_ptr<sync::RemoteProjectSnapshot> audacity::cloud::audiocom::CloudSyncService::mRemoteSnapshot
private

Definition at line 135 of file CloudSyncService.h.

◆ mSyncInProcess

std::atomic<bool> audacity::cloud::audiocom::CloudSyncService::mSyncInProcess { false }
private

Definition at line 143 of file CloudSyncService.h.

◆ mSyncPromise

SyncPromise audacity::cloud::audiocom::CloudSyncService::mSyncPromise
private

Definition at line 137 of file CloudSyncService.h.


The documentation for this class was generated from the following files: