Audacity 3.2.0
|
Configuration for the audio.com. More...
#include <ServiceConfig.h>
Public Member Functions | |
ServiceConfig () | |
std::string | GetAPIEndpoint () const |
API endpoint. More... | |
std::string | GetOAuthLoginPage (AudiocomTrace) const |
Page to open in browser to initiate OAuth. More... | |
std::string | GetOAuthClientID () const |
OAuth2 client ID. More... | |
std::string | GetOAuthClientSecret () const |
OAuth2 client secret. More... | |
std::string | GetOAuthRedirectURL () const |
OAuth2 redirect URL. Only used to satisfy the protocol. More... | |
std::string | GetAuthWithRedirectURL () const |
Audio.com authorization API to automatically login current user. More... | |
std::string | GetAPIUrl (std::string_view apiURI) const |
Helper to construct the full URLs for the API. More... | |
std::string | GetFinishUploadPage (std::string_view audioID, std::string_view token, AudiocomTrace) const |
Helper to construct the page URL for the anonymous upload last stage. More... | |
std::string | GetAudioURL (std::string_view userSlug, std::string_view audioSlug, AudiocomTrace) const |
Helper to construct the page URL for the authorised upload. More... | |
std::chrono::milliseconds | GetProgressCallbackTimeout () const |
Timeout between progress callbacks. More... | |
std::vector< std::string > | GetPreferredAudioFormats (bool preferLossless=true) const |
Preferred audio format. More... | |
rapidjson::Document | GetExportConfig (const std::string &exporterName) const |
Export configuration suitable for the mime type provided. More... | |
std::string | GetDownloadMime () const |
std::string | GetAcceptLanguageValue () const |
Returns the preferred language. More... | |
std::string | GetCreateProjectUrl () const |
std::string | GetCreateSnapshotUrl (std::string_view projectId) const |
std::string | GetSnapshotSyncUrl (std::string_view projectId, std::string_view snapshotId) const |
std::string | GetProjectsUrl (int page, int pageSize, std::string_view searchTerm) const |
std::string | GetProjectInfoUrl (std::string_view projectId) const |
std::string | GetSnapshotInfoUrl (std::string_view projectId, std::string_view snapshotId) const |
std::string | GetDeleteSnapshotUrl (std::string_view projectId, std::string_view snapshotId) const |
std::string | GetNetworkStatsUrl (std::string_view projectId) const |
std::string | GetProjectPagePath (std::string_view userSlug, std::string_view projectSlug, AudiocomTrace) const |
std::string | GetProjectsPagePath (std::string_view userSlug, AudiocomTrace) const |
Private Attributes | |
std::string | mApiEndpoint |
std::string | mOAuthClientID |
std::string | mOAuthClientSecret |
std::string | mOAuthRedirectURL |
std::string | mOAuthLoginPage |
std::string | mAuthWithRedirectURL |
std::string | mFinishUploadPage |
std::string | mFrontendURL |
std::string | mPreferredMimeType |
Configuration for the audio.com.
Definition at line 24 of file ServiceConfig.h.
audacity::cloud::audiocom::ServiceConfig::ServiceConfig | ( | ) |
Definition at line 127 of file ServiceConfig.cpp.
References audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComApiEndpoint, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComAudioDownloadMimeType, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComAuthWithRedirectURL, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComFinishUploadPage, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComFrontendURL, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthClientID, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthClientSecret, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthLoginPage, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthRedirectURL, mApiEndpoint, mAuthWithRedirectURL, mFinishUploadPage, mFrontendURL, mOAuthClientID, mOAuthClientSecret, mOAuthLoginPage, mOAuthRedirectURL, mPreferredMimeType, Setting< T >::Read(), and audacity::ToUTF8().
std::string audacity::cloud::audiocom::ServiceConfig::GetAcceptLanguageValue | ( | ) | const |
Returns the preferred language.
Definition at line 260 of file ServiceConfig.cpp.
References Languages::GetLang().
Referenced by audacity::cloud::audiocom::SetCommonHeaders(), audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::SetRequiredHeaders(), and audacity::cloud::audiocom::sync::LocalProjectSnapshot::UpdateProjectSnapshot().
std::string audacity::cloud::audiocom::ServiceConfig::GetAPIEndpoint | ( | ) | const |
std::string audacity::cloud::audiocom::ServiceConfig::GetAPIUrl | ( | std::string_view | apiURI | ) | const |
Helper to construct the full URLs for the API.
Definition at line 174 of file ServiceConfig.cpp.
References mApiEndpoint.
Referenced by audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::DiscardResult(), audacity::cloud::audiocom::OAuthService::DoAuthorise(), GetCreateProjectUrl(), and audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::InitiateUpload().
std::string audacity::cloud::audiocom::ServiceConfig::GetAudioURL | ( | std::string_view | userSlug, |
std::string_view | audioSlug, | ||
AudiocomTrace | trace | ||
) | const |
Helper to construct the page URL for the authorised upload.
Definition at line 191 of file ServiceConfig.cpp.
References audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::GetButtonName(), mFrontendURL, MTM_CAMPAIGN, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute(), and audacity::ToUTF8().
Referenced by audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::CompletePromise().
std::string audacity::cloud::audiocom::ServiceConfig::GetAuthWithRedirectURL | ( | ) | const |
Audio.com authorization API to automatically login current user.
Definition at line 169 of file ServiceConfig.cpp.
References mAuthWithRedirectURL.
std::string audacity::cloud::audiocom::ServiceConfig::GetCreateProjectUrl | ( | ) | const |
Definition at line 272 of file ServiceConfig.cpp.
References GetAPIUrl().
Referenced by audacity::cloud::audiocom::sync::LocalProjectSnapshot::UpdateProjectSnapshot().
std::string audacity::cloud::audiocom::ServiceConfig::GetCreateSnapshotUrl | ( | std::string_view | projectId | ) | const |
Definition at line 278 of file ServiceConfig.cpp.
References mApiEndpoint, and audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute().
Referenced by audacity::cloud::audiocom::sync::LocalProjectSnapshot::UpdateProjectSnapshot().
std::string audacity::cloud::audiocom::ServiceConfig::GetDeleteSnapshotUrl | ( | std::string_view | projectId, |
std::string_view | snapshotId | ||
) | const |
Definition at line 334 of file ServiceConfig.cpp.
References mApiEndpoint, and audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute().
Referenced by audacity::cloud::audiocom::sync::LocalProjectSnapshot::DeleteSnapshot().
std::string audacity::cloud::audiocom::ServiceConfig::GetDownloadMime | ( | ) | const |
Return the mime type server should store the file. This is a requirement from audiocom
Definition at line 255 of file ServiceConfig.cpp.
References mPreferredMimeType.
Referenced by audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::GetUploadRequestPayload().
rapidjson::Document audacity::cloud::audiocom::ServiceConfig::GetExportConfig | ( | const std::string & | exporterName | ) | const |
Export configuration suitable for the mime type provided.
Definition at line 219 of file ServiceConfig.cpp.
Referenced by audacity::cloud::audiocom::sync::MixdownUploader::ExportProject(), and audacity::cloud::audiocom::ShareAudioDialog::ExportProject().
std::string audacity::cloud::audiocom::ServiceConfig::GetFinishUploadPage | ( | std::string_view | audioID, |
std::string_view | token, | ||
AudiocomTrace | trace | ||
) | const |
Helper to construct the page URL for the anonymous upload last stage.
Definition at line 179 of file ServiceConfig.cpp.
References audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::GetButtonName(), mFinishUploadPage, mOAuthClientID, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute(), and audacity::ToUTF8().
Referenced by audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::CompletePromise().
std::string audacity::cloud::audiocom::ServiceConfig::GetNetworkStatsUrl | ( | std::string_view | projectId | ) | const |
Definition at line 346 of file ServiceConfig.cpp.
References mApiEndpoint, and audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute().
std::string audacity::cloud::audiocom::ServiceConfig::GetOAuthClientID | ( | ) | const |
OAuth2 client ID.
Definition at line 154 of file ServiceConfig.cpp.
References mOAuthClientID.
Referenced by GetOAuthLoginPage(), and audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::WriteClientFields().
std::string audacity::cloud::audiocom::ServiceConfig::GetOAuthClientSecret | ( | ) | const |
OAuth2 client secret.
Definition at line 159 of file ServiceConfig.cpp.
References mOAuthClientSecret.
Referenced by audacity::cloud::audiocom::anonymous_namespace{OAuthService.cpp}::WriteClientFields().
std::string audacity::cloud::audiocom::ServiceConfig::GetOAuthLoginPage | ( | AudiocomTrace | trace | ) | const |
Page to open in browser to initiate OAuth.
Definition at line 145 of file ServiceConfig.cpp.
References audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::GetButtonName(), GetOAuthClientID(), mOAuthLoginPage, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute(), and audacity::ToUTF8().
std::string audacity::cloud::audiocom::ServiceConfig::GetOAuthRedirectURL | ( | ) | const |
OAuth2 redirect URL. Only used to satisfy the protocol.
Definition at line 164 of file ServiceConfig.cpp.
References mOAuthRedirectURL.
Referenced by audacity::cloud::audiocom::OAuthService::AuthoriseCode().
std::vector< std::string > audacity::cloud::audiocom::ServiceConfig::GetPreferredAudioFormats | ( | bool | preferLossless = true | ) | const |
Preferred audio format.
Definition at line 210 of file ServiceConfig.cpp.
std::chrono::milliseconds audacity::cloud::audiocom::ServiceConfig::GetProgressCallbackTimeout | ( | ) | const |
Timeout between progress callbacks.
Definition at line 204 of file ServiceConfig.cpp.
Referenced by audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::HandleUploadProgress().
std::string audacity::cloud::audiocom::ServiceConfig::GetProjectInfoUrl | ( | std::string_view | projectId | ) | const |
Definition at line 313 of file ServiceConfig.cpp.
References mApiEndpoint, and audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute().
Referenced by audacity::cloud::audiocom::anonymous_namespace{CloudSyncService.cpp}::GetProjectInfo().
std::string audacity::cloud::audiocom::ServiceConfig::GetProjectPagePath | ( | std::string_view | userSlug, |
std::string_view | projectSlug, | ||
AudiocomTrace | trace | ||
) | const |
Definition at line 356 of file ServiceConfig.cpp.
References audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::GetButtonName(), MTM_CAMPAIGN, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute(), and audacity::ToUTF8().
std::string audacity::cloud::audiocom::ServiceConfig::GetProjectsPagePath | ( | std::string_view | userSlug, |
AudiocomTrace | trace | ||
) | const |
Definition at line 370 of file ServiceConfig.cpp.
References audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::GetButtonName(), MTM_CAMPAIGN, audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute(), and audacity::ToUTF8().
std::string audacity::cloud::audiocom::ServiceConfig::GetProjectsUrl | ( | int | page, |
int | pageSize, | ||
std::string_view | searchTerm | ||
) | const |
Definition at line 295 of file ServiceConfig.cpp.
References mApiEndpoint, and audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute().
std::string audacity::cloud::audiocom::ServiceConfig::GetSnapshotInfoUrl | ( | std::string_view | projectId, |
std::string_view | snapshotId | ||
) | const |
Definition at line 322 of file ServiceConfig.cpp.
References mApiEndpoint, and audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute().
Referenced by audacity::cloud::audiocom::anonymous_namespace{CloudSyncService.cpp}::GetSnapshotInfo().
std::string audacity::cloud::audiocom::ServiceConfig::GetSnapshotSyncUrl | ( | std::string_view | projectId, |
std::string_view | snapshotId | ||
) | const |
Definition at line 285 of file ServiceConfig.cpp.
References mApiEndpoint, and audacity::cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute().
Referenced by audacity::cloud::audiocom::sync::LocalProjectSnapshot::MarkSnapshotSynced(), audacity::cloud::audiocom::sync::anonymous_namespace{ResumedSnaphotUploadOperation.cpp}::ResumedSnaphotUploadOperation::RefreshUrls(), and audacity::cloud::audiocom::sync::LocalProjectSnapshot::StorePendingSnapshot().
|
private |
Definition at line 82 of file ServiceConfig.h.
Referenced by GetAPIEndpoint(), GetAPIUrl(), GetCreateSnapshotUrl(), GetDeleteSnapshotUrl(), GetNetworkStatsUrl(), GetProjectInfoUrl(), GetProjectsUrl(), GetSnapshotInfoUrl(), GetSnapshotSyncUrl(), and ServiceConfig().
|
private |
Definition at line 87 of file ServiceConfig.h.
Referenced by GetAuthWithRedirectURL(), and ServiceConfig().
|
private |
Definition at line 88 of file ServiceConfig.h.
Referenced by GetFinishUploadPage(), and ServiceConfig().
|
private |
Definition at line 89 of file ServiceConfig.h.
Referenced by GetAudioURL(), and ServiceConfig().
|
private |
Definition at line 83 of file ServiceConfig.h.
Referenced by GetFinishUploadPage(), GetOAuthClientID(), and ServiceConfig().
|
private |
Definition at line 84 of file ServiceConfig.h.
Referenced by GetOAuthClientSecret(), and ServiceConfig().
|
private |
Definition at line 86 of file ServiceConfig.h.
Referenced by GetOAuthLoginPage(), and ServiceConfig().
|
private |
Definition at line 85 of file ServiceConfig.h.
Referenced by GetOAuthRedirectURL(), and ServiceConfig().
|
private |
Definition at line 90 of file ServiceConfig.h.
Referenced by GetDownloadMime(), and ServiceConfig().