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 std::string GetAPIUrl(std::string_view apiURI) const;
41 std::string GetFinishUploadPage(
42 std::string_view audioID, std::string_view token,
43 AudiocomTrace) const;
45 std::string GetAudioURL(
46 std::string_view userSlug, std::string_view audioSlug,
47 AudiocomTrace) const;
49 std::chrono::milliseconds GetProgressCallbackTimeout() const;
51 std::vector<std::string> GetPreferredAudioFormats(bool preferLossless = true) const;
53 rapidjson::Document GetExportConfig(const std::string& exporterName) const;
56 std::string GetDownloadMime() const;
58 std::string GetAcceptLanguageValue() const;
59
60 std::string GetCreateProjectUrl() const;
61 std::string GetCreateSnapshotUrl(std::string_view projectId) const;
62 std::string GetSnapshotSyncUrl(
63 std::string_view projectId, std::string_view snapshotId) const;
64 std::string GetProjectsUrl(int page, int pageSize, std::string_view searchTerm) const;
65
66 std::string GetProjectInfoUrl(std::string_view projectId) const;
67 std::string GetSnapshotInfoUrl(
68 std::string_view projectId, std::string_view snapshotId) const;
69 std::string GetDeleteSnapshotUrl(
70 std::string_view projectId, std::string_view snapshotId) const;
71
72 std::string GetNetworkStatsUrl(std::string_view projectId) const;
73 std::string GetProjectPageUrl(
74 std::string_view userId, std::string_view projectId,
75 AudiocomTrace) const;
76 std::string
77 GetProjectsPageUrl(std::string_view userId, AudiocomTrace) const;
78
79private:
80 std::string mApiEndpoint;
81 std::string mOAuthClientID;
82 std::string mOAuthClientSecret;
83 std::string mOAuthRedirectURL;
84 std::string mOAuthLoginPage;
85 std::string mFinishUploadPage;
86 std::string mFrontendURL;
87 std::string mPreferredMimeType;
88};
89
91CLOUD_AUDIOCOM_API const ServiceConfig& GetServiceConfig();
92} // 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.