Audacity 3.2.0
ServiceConfig.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 ServiceConfig.h
7
8 Dmitry Vedenko
9
10**********************************************************************/
11#pragma once
12
13#include <chrono>
14#include <string>
15#include <vector>
16#include <rapidjson/fwd.h>
17
18enum class AudiocomTrace;
19
21{
22
24class CLOUD_AUDIOCOM_API ServiceConfig final
25{
26public:
29 std::string GetAPIEndpoint() const;
31 std::string GetOAuthLoginPage(AudiocomTrace) const;
33 std::string GetOAuthClientID() const;
35 std::string GetOAuthClientSecret() const;
37 std::string GetOAuthRedirectURL() const;
39 // in the default browser when opening the project from audacity
40 std::string GetAuthWithRedirectURL() const;
42 std::string GetAPIUrl(std::string_view apiURI) const;
44 std::string GetFinishUploadPage(
45 std::string_view audioID, std::string_view token,
46 AudiocomTrace) const;
48 std::string GetAudioURL(
49 std::string_view userSlug, std::string_view audioSlug,
50 AudiocomTrace) const;
52 std::chrono::milliseconds GetProgressCallbackTimeout() const;
54 std::vector<std::string> GetPreferredAudioFormats(bool preferLossless = true) const;
56 rapidjson::Document GetExportConfig(const std::string& exporterName) const;
59 std::string GetDownloadMime() const;
61 std::string GetAcceptLanguageValue() const;
62
63 std::string GetCreateProjectUrl() const;
64 std::string GetCreateSnapshotUrl(std::string_view projectId) const;
65 std::string GetSnapshotSyncUrl(
66 std::string_view projectId, std::string_view snapshotId) const;
67 std::string GetProjectsUrl(int page, int pageSize, std::string_view searchTerm) const;
68
69 std::string GetProjectInfoUrl(std::string_view projectId) const;
70 std::string GetSnapshotInfoUrl(
71 std::string_view projectId, std::string_view snapshotId) const;
72 std::string GetDeleteSnapshotUrl(
73 std::string_view projectId, std::string_view snapshotId) const;
74
75 std::string GetNetworkStatsUrl(std::string_view projectId) const;
76 std::string GetProjectPagePath(std::string_view userSlug, std::string_view projectSlug,
77 AudiocomTrace) const;
78 std::string
79 GetProjectsPagePath(std::string_view userSlug, AudiocomTrace) const;
80
81private:
82 std::string mApiEndpoint;
83 std::string mOAuthClientID;
84 std::string mOAuthClientSecret;
85 std::string mOAuthRedirectURL;
86 std::string mOAuthLoginPage;
88 std::string mFinishUploadPage;
89 std::string mFrontendURL;
90 std::string mPreferredMimeType;
91};
92
94CLOUD_AUDIOCOM_API const ServiceConfig& GetServiceConfig();
95} // namespace audacity::cloud::audiocom
AudiocomTrace
Definition: ExportUtils.h:27
Configuration for the audio.com.
Definition: ServiceConfig.h:25
const ServiceConfig & GetServiceConfig()
Returns the instance of the ServiceConfig.