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

Service, responsible for uploading audio files to More...

#include <UploadService.h>

Collaboration diagram for cloud::audiocom::UploadService:

Public Types

using CompletedCallback = std::function< void(const UploadOperationCompleted &)>
using ProgressCallback = std::function< void(uint64_t current, uint64_t total)>

Public Member Functions

 UploadService (const ServiceConfig &config, OAuthService &service)
UploadOperationHandle Upload (const wxString &fileName, const wxString &projectName, bool isPublic, CompletedCallback completedCallback, ProgressCallback progressCallback)
 Uploads the file to More...

Private Attributes

const ServiceConfigmServiceConfig

Detailed Description

Service, responsible for uploading audio files to

Definition at line 96 of file UploadService.h.

Member Typedef Documentation

◆ CompletedCallback

Definition at line 101 of file UploadService.h.

◆ ProgressCallback

using cloud::audiocom::UploadService::ProgressCallback = std::function<void(uint64_t current, uint64_t total)>

Definition at line 104 of file UploadService.h.

Constructor & Destructor Documentation

◆ UploadService()

cloud::audiocom::UploadService::UploadService ( const ServiceConfig config,
OAuthService service 

Definition at line 504 of file UploadService.cpp.

505 : mServiceConfig(config), mOAuthService(service)
const ServiceConfig & mServiceConfig

Member Function Documentation

◆ Upload()

UploadOperationHandle cloud::audiocom::UploadService::Upload ( const wxString &  fileName,
const wxString &  projectName,
bool  isPublic,
CompletedCallback  completedCallback,
ProgressCallback  progressCallback 

Uploads the file to

Definition at line 509 of file UploadService.cpp.

513 if (!wxFileExists(fileName))
514 {
515 if (completedCallback)
516 completedCallback(UploadOperationCompleted {
519 return {};
520 }
522 auto operation = std::make_shared<AudiocomUploadOperation>(
523 mServiceConfig, fileName, projectName, isPublic,
524 std::move(completedCallback), std::move(progressCallback));
526 mOAuthService.ValidateAuth([operation](std::string_view authToken)
527 { operation->InitiateUpload(authToken); });
529 return UploadOperationHandle { operation };
void ValidateAuth(std::function< void(std::string_view)> completedHandler)
Attempt to authorize the user.
@ FileNotFound
Specified file is not found.

References cloud::audiocom::UploadOperationCompleted::FileNotFound, mOAuthService, mServiceConfig, and cloud::audiocom::OAuthService::ValidateAuth().

Here is the call graph for this function:

Member Data Documentation

◆ mOAuthService

OAuthService& cloud::audiocom::UploadService::mOAuthService

Definition at line 118 of file UploadService.h.

Referenced by Upload().

◆ mServiceConfig

const ServiceConfig& cloud::audiocom::UploadService::mServiceConfig

Definition at line 117 of file UploadService.h.

Referenced by Upload().

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