Audacity 3.2.0
Public Member Functions | List of all members
cloud::audiocom::ServiceConfig Class Referencefinal

Configuration for the audio.com. More...

#include <ServiceConfig.h>

Public Member Functions

std::string_view GetAPIEndpoint () const
 API endpoint. More...
 
std::string_view GetOAuthLoginPage () const
 Page to open in browser to initiate OAuth. More...
 
std::string_view GetOAuthClientID () const
 OAuth2 client ID. More...
 
std::string_view 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::chrono::milliseconds GetProgressCallbackTimeout () const
 Timeout between progress callbacks. More...
 
MimeTypesList GetPreferredAudioFormats () const
 Preferred audio format. More...
 
MimeType GetDownloadMime () const
 Return the mime type server should store the file. This is a requirement from audiocom. More...
 

Detailed Description

Configuration for the audio.com.

Definition at line 23 of file ServiceConfig.h.

Member Function Documentation

◆ GetAPIEndpoint()

std::string_view cloud::audiocom::ServiceConfig::GetAPIEndpoint ( ) const

API endpoint.

Definition at line 15 of file ServiceConfig.cpp.

16{
17 return "https://api.audio.com";
18}

Referenced by GetAPIUrl().

Here is the caller graph for this function:

◆ GetAPIUrl()

std::string cloud::audiocom::ServiceConfig::GetAPIUrl ( std::string_view  apiURI) const

Helper to construct the full URLs for the API.

Definition at line 40 of file ServiceConfig.cpp.

41{
42 return std::string(GetAPIEndpoint()) + std::string(apiURI);
43}
std::string_view GetAPIEndpoint() const
API endpoint.

References GetAPIEndpoint().

Referenced by cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::DiscardResult(), cloud::audiocom::OAuthService::DoAuthorise(), and cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::InitiateUpload().

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

◆ GetDownloadMime()

MimeType cloud::audiocom::ServiceConfig::GetDownloadMime ( ) const

Return the mime type server should store the file. This is a requirement from audiocom.

Definition at line 63 of file ServiceConfig.cpp.

64{
65 return "audio/x-wav";
66}

Referenced by cloud::audiocom::anonymous_namespace{UploadService.cpp}::GetUploadRequestPayload().

Here is the caller graph for this function:

◆ GetFinishUploadPage()

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 45 of file ServiceConfig.cpp.

47{
48 return "http://audio.com/audacity/upload?audioId=" + std::string(audioID) +
49 "&token=" + std::string(token) +
50 "&clientId=" + std::string(GetOAuthClientID());
51}
std::string_view GetOAuthClientID() const
OAuth2 client ID.

References GetOAuthClientID().

Referenced by cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::CompletePromise().

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

◆ GetOAuthClientID()

std::string_view cloud::audiocom::ServiceConfig::GetOAuthClientID ( ) const

OAuth2 client ID.

Definition at line 29 of file ServiceConfig.cpp.

30{
31 return "1741964426607541";
32}

Referenced by GetFinishUploadPage(), GetOAuthLoginPage(), and cloud::audiocom::anonymous_namespace{OAuthService.cpp}::WriteCommonFields().

Here is the caller graph for this function:

◆ GetOAuthLoginPage()

std::string_view cloud::audiocom::ServiceConfig::GetOAuthLoginPage ( ) const

Page to open in browser to initiate OAuth.

Definition at line 20 of file ServiceConfig.cpp.

21{
22 static const std::string loginPage =
23 std::string("https://audio.com/audacity/link?clientId=") +
24 std::string(GetOAuthClientID());
25
26 return loginPage;
27}

References GetOAuthClientID().

Here is the call graph for this function:

◆ GetOAuthRedirectURL()

std::string_view cloud::audiocom::ServiceConfig::GetOAuthRedirectURL ( ) const

OAuth2 redirect URL. Only used to satisfy the protocol.

Definition at line 34 of file ServiceConfig.cpp.

35{
36 //return "audacity://link";
37 return "https://audio.com/auth/sign-in/success";
38}

Referenced by cloud::audiocom::OAuthService::AuthoriseCode().

Here is the caller graph for this function:

◆ GetPreferredAudioFormats()

MimeTypesList cloud::audiocom::ServiceConfig::GetPreferredAudioFormats ( ) const

Preferred audio format.

Definition at line 58 of file ServiceConfig.cpp.

59{
60 return { "audio/x-wavpack", "audio/x-flac", "audio/x-wav" };
61}

◆ GetProgressCallbackTimeout()

std::chrono::milliseconds cloud::audiocom::ServiceConfig::GetProgressCallbackTimeout ( ) const

Timeout between progress callbacks.

Definition at line 53 of file ServiceConfig.cpp.

54{
55 return std::chrono::seconds(3);
56}

Referenced by cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::HandleUploadProgress().

Here is the caller graph for this function:

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