1 parent
dede07748a
commit
97dc183bdf
6 files changed
+77
-69
No files matched your search
@@ -48,6 +48,7 @@ namespace Echoion::Api
|
||||
[[nodiscard]] const BotConfig& getBot() const;
|
||||
[[nodiscard]] const YouTubeConfig& getYouTube() const;
|
||||
[[nodiscard]] const NetworkConfig& getNetwork() const;
|
||||
[[nodiscard]] const SourcesConfig& getSources() const;
|
||||
[[nodiscard]] const TeamSpeakConfig& getTeamSpeak() const;
|
||||
[[nodiscard]] const SecurityConfig& getSecurity() const;
|
||||
[[nodiscard]] const FeaturesConfig& getFeatures() const;
|
||||
|
||||
@@ -31,17 +31,12 @@ namespace Echoion::Api
|
||||
std::string commandPrefix = "!";
|
||||
float defaultVolume = 0.5f;
|
||||
uint32_t maxQueueSize = 100;
|
||||
// How long the playback engine waits (emitting silence) for a
|
||||
// late stream resolve before skipping the track.
|
||||
std::chrono::milliseconds trackTimeout =
|
||||
std::chrono::milliseconds(30000);
|
||||
|
||||
// Reconnection settings
|
||||
bool autoReconnect = true;
|
||||
std::chrono::milliseconds reconnectDelay =
|
||||
std::chrono::milliseconds(5000);
|
||||
uint32_t maxReconnectAttempts = 5;
|
||||
|
||||
// Audio quality settings
|
||||
AudioQuality preferredQuality = AudioQuality::High;
|
||||
std::chrono::milliseconds(10000);
|
||||
// Crossfade between tracks; 0 = plain gapless handoff.
|
||||
std::chrono::milliseconds crossfade = std::chrono::milliseconds(0);
|
||||
bool allowPlaylistImports = true;
|
||||
};
|
||||
|
||||
@@ -63,6 +58,33 @@ namespace Echoion::Api
|
||||
std::string rpcBindAddress = "127.0.0.1";
|
||||
};
|
||||
|
||||
// Music source resolution chain. Default order tries the native
|
||||
// innertube YouTube path and Yandex Music first, then falls back to
|
||||
// (optionally proxied) yt-dlp last.
|
||||
struct SourcesConfig {
|
||||
std::vector<std::string> order = {
|
||||
"innertube", "yandex", "direct-url",
|
||||
"ytdlp-direct", "ytdlp-proxied"};
|
||||
// How long a failing source is skipped before being retried.
|
||||
std::chrono::milliseconds failureCooldown =
|
||||
std::chrono::milliseconds(300000); // 5m
|
||||
// Hedged stream resolution: when the first source hasn't
|
||||
// answered within this delay, the second candidate races it
|
||||
// (first success wins). 0 disables hedging.
|
||||
std::chrono::milliseconds hedgeDelay =
|
||||
std::chrono::milliseconds(300);
|
||||
// Native innertube player API (fastest YouTube path; one HTTP
|
||||
// POST). youtubei is geo-blocked without a proxy, so with
|
||||
// requireProxy the source is skipped when none is configured.
|
||||
bool innertubeEnabled = true;
|
||||
bool innertubeRequireProxy = true;
|
||||
// Native Yandex Music (unofficial API). Full tracks require an
|
||||
// OAuth token from an account with Plus; without one, yandex
|
||||
// URLs fall back to ytdlp-direct.
|
||||
bool yandexEnabled = true;
|
||||
std::optional<std::string> yandexToken;
|
||||
};
|
||||
|
||||
// TeamSpeak Server Connection
|
||||
struct TeamSpeakConfig {
|
||||
std::string address = "localhost";
|
||||
@@ -100,30 +122,30 @@ namespace Echoion::Api
|
||||
bool autoStartOnSubscribe = true;
|
||||
bool pauseOnEmptySubscribers = true;
|
||||
bool resumeOnSubscriberReturn = true;
|
||||
// Radio mode: when the queue runs dry, enqueue tracks related to
|
||||
// the last played one (via Invidious recommendations).
|
||||
bool autoplay = false;
|
||||
|
||||
// Queue management
|
||||
std::string shuffleMode = "random";
|
||||
// Loudness normalization: slow AGC toward the target RMS level
|
||||
// so quiet and loud tracks play back at a similar volume.
|
||||
bool normalizeLoudness = false;
|
||||
float targetLoudnessDb = -14.0f;
|
||||
|
||||
// Queue management: initial state on cold start ("off"/"random",
|
||||
// "off"/"all"). Runtime toggles are not written back.
|
||||
std::string shuffleMode = "off";
|
||||
std::string repeatMode = "off";
|
||||
uint32_t maxHistorySize = 50;
|
||||
};
|
||||
|
||||
// Advanced Settings
|
||||
struct AdvancedConfig {
|
||||
// Audio configuration
|
||||
uint32_t sampleRate = 192000;
|
||||
uint32_t channels = 2;
|
||||
uint32_t bufferSize = 7680;
|
||||
|
||||
// Thread pool configuration
|
||||
uint32_t commandThreadPoolSize = 4;
|
||||
uint32_t networkThreadPoolSize = 4;
|
||||
uint32_t decoderThreads = 2;
|
||||
|
||||
// Cache settings
|
||||
// Local audio track cache (downloaded/streamed files reused
|
||||
// across plays and restarts).
|
||||
bool cacheEnabled = true;
|
||||
std::string cacheMaxSize = "1GB";
|
||||
uint32_t cacheTTL = 86400;
|
||||
uint32_t tempCleanupInterval = 3600;
|
||||
uint32_t cacheTTL = 86400; // seconds
|
||||
uint32_t tempCleanupInterval = 3600; // seconds
|
||||
};
|
||||
|
||||
// ServerConfig for Plugin interface (mirrors PluginTypes.hpp version)
|
||||
@@ -153,6 +175,7 @@ namespace Echoion::Api
|
||||
BotConfig bot;
|
||||
YouTubeConfig youtube;
|
||||
NetworkConfig network;
|
||||
SourcesConfig sources;
|
||||
TeamSpeakConfig teamspeak;
|
||||
SecurityConfig security;
|
||||
FeaturesConfig features;
|
||||
|
||||
Reference in new issue
Block a user