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 () 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 | 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) 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) 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 () 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... | |
Private Attributes | |
std::string | mApiEndpoint |
std::string | mOAuthClientID |
std::string | mOAuthClientSecret |
std::string | mOAuthRedirectURL |
std::string | mOAuthLoginPage |
std::string | mFinishUploadPage |
std::string | mAudioURL |
std::string | mPreferredMimeType |
Configuration for the audio.com.
Definition at line 22 of file ServiceConfig.h.
cloud::audiocom::ServiceConfig::ServiceConfig | ( | ) |
Definition at line 89 of file ServiceConfig.cpp.
References cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComApiEndpoint, cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComAudioDownloadMimeType, cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComAudioURL, cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComFinishUploadPage, cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthClientID, cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthClientSecret, cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthLoginPage, cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthRedirectURL, mApiEndpoint, mAudioURL, mFinishUploadPage, mOAuthClientID, mOAuthClientSecret, mOAuthLoginPage, mOAuthRedirectURL, mPreferredMimeType, Setting< T >::Read(), and audacity::ToUTF8().
std::string cloud::audiocom::ServiceConfig::GetAcceptLanguageValue | ( | ) | const |
Returns the preferred language.
Definition at line 190 of file ServiceConfig.cpp.
References Languages::GetLang().
Referenced by cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::SetRequiredHeaders().
std::string cloud::audiocom::ServiceConfig::GetAPIEndpoint | ( | ) | const |
std::string cloud::audiocom::ServiceConfig::GetAPIUrl | ( | std::string_view | apiURI | ) | const |
Helper to construct the full URLs for the API.
Definition at line 127 of file ServiceConfig.cpp.
References mApiEndpoint.
Referenced by cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::DiscardResult(), cloud::audiocom::OAuthService::DoAuthorise(), and cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::InitiateUpload().
std::string cloud::audiocom::ServiceConfig::GetAudioURL | ( | std::string_view | userSlug, |
std::string_view | audioSlug | ||
) | const |
Helper to construct the page URL for the authorised upload.
Definition at line 141 of file ServiceConfig.cpp.
References mAudioURL, and cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute().
Referenced by cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::CompletePromise().
std::string cloud::audiocom::ServiceConfig::GetDownloadMime | ( | ) | const |
Return the mime type server should store the file. This is a requirement from audiocom
Definition at line 185 of file ServiceConfig.cpp.
References mPreferredMimeType.
Referenced by cloud::audiocom::anonymous_namespace{UploadService.cpp}::GetUploadRequestPayload().
rapidjson::Document cloud::audiocom::ServiceConfig::GetExportConfig | ( | const std::string & | exporterName | ) | const |
Export configuration suitable for the mime type provided.
Definition at line 158 of file ServiceConfig.cpp.
Referenced by cloud::audiocom::ShareAudioDialog::ExportProject().
std::string cloud::audiocom::ServiceConfig::GetFinishUploadPage | ( | std::string_view | audioID, |
std::string_view | token | ||
) | const |
Helper to construct the page URL for the anonymous upload last stage.
Definition at line 132 of file ServiceConfig.cpp.
References mFinishUploadPage, mOAuthClientID, and cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute().
Referenced by cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::CompletePromise().
std::string cloud::audiocom::ServiceConfig::GetOAuthClientID | ( | ) | const |
OAuth2 client ID.
Definition at line 112 of file ServiceConfig.cpp.
References mOAuthClientID.
Referenced by GetOAuthLoginPage(), and cloud::audiocom::anonymous_namespace{OAuthService.cpp}::WriteCommonFields().
std::string cloud::audiocom::ServiceConfig::GetOAuthClientSecret | ( | ) | const |
OAuth2 client secret.
Definition at line 117 of file ServiceConfig.cpp.
References mOAuthClientSecret.
Referenced by cloud::audiocom::anonymous_namespace{OAuthService.cpp}::WriteCommonFields().
std::string cloud::audiocom::ServiceConfig::GetOAuthLoginPage | ( | ) | const |
Page to open in browser to initiate OAuth.
Definition at line 106 of file ServiceConfig.cpp.
References GetOAuthClientID(), mOAuthLoginPage, and cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute().
std::string cloud::audiocom::ServiceConfig::GetOAuthRedirectURL | ( | ) | const |
OAuth2 redirect URL. Only used to satisfy the protocol.
Definition at line 122 of file ServiceConfig.cpp.
References mOAuthRedirectURL.
Referenced by cloud::audiocom::OAuthService::AuthoriseCode().
std::vector< std::string > cloud::audiocom::ServiceConfig::GetPreferredAudioFormats | ( | ) | const |
Preferred audio format.
Definition at line 153 of file ServiceConfig.cpp.
std::chrono::milliseconds cloud::audiocom::ServiceConfig::GetProgressCallbackTimeout | ( | ) | const |
Timeout between progress callbacks.
Definition at line 148 of file ServiceConfig.cpp.
Referenced by cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::HandleUploadProgress().
|
private |
Definition at line 55 of file ServiceConfig.h.
Referenced by GetAPIEndpoint(), GetAPIUrl(), and ServiceConfig().
|
private |
Definition at line 61 of file ServiceConfig.h.
Referenced by GetAudioURL(), and ServiceConfig().
|
private |
Definition at line 60 of file ServiceConfig.h.
Referenced by GetFinishUploadPage(), and ServiceConfig().
|
private |
Definition at line 56 of file ServiceConfig.h.
Referenced by GetFinishUploadPage(), GetOAuthClientID(), and ServiceConfig().
|
private |
Definition at line 57 of file ServiceConfig.h.
Referenced by GetOAuthClientSecret(), and ServiceConfig().
|
private |
Definition at line 59 of file ServiceConfig.h.
Referenced by GetOAuthLoginPage(), and ServiceConfig().
|
private |
Definition at line 58 of file ServiceConfig.h.
Referenced by GetOAuthRedirectURL(), and ServiceConfig().
|
private |
Definition at line 62 of file ServiceConfig.h.
Referenced by GetDownloadMime(), and ServiceConfig().