1 parent
295542ab9e
commit
24075fbd52
11 files changed
+305
-133
No files matched your search
@@ -21,7 +21,7 @@ namespace Echoion::Api
|
||||
struct QueueEntry;
|
||||
struct PlaylistInfo;
|
||||
|
||||
// Minimal PlaybackState for Plugin
|
||||
// Minimal playback state for the host boundary.
|
||||
struct PlaybackSummary {
|
||||
std::optional<TrackSummary> currentTrack;
|
||||
bool isPlaying = false;
|
||||
@@ -42,7 +42,7 @@ namespace Echoion::Api
|
||||
using CoreCreateFunc = std::function<CoreInterfacePtr()>;
|
||||
using CoreDestroyFunc = std::function<void(ICoreInterface*)>;
|
||||
|
||||
// Core interface that the Plugin will use to communicate with the Core
|
||||
// Core interface used by the standalone host to communicate with Core.
|
||||
// MINIMAL VERSION - breaks dependencies on Core-specific types
|
||||
class ICoreInterface
|
||||
{
|
||||
@@ -51,7 +51,7 @@ namespace Echoion::Api
|
||||
virtual ~ICoreInterface() = default;
|
||||
|
||||
// Lifecycle
|
||||
// Plugin passes config file path, Core loads config internally
|
||||
// The host passes a config path; Core loads it internally.
|
||||
virtual Result<void>
|
||||
initialize(const std::filesystem::path& configPath) = 0;
|
||||
virtual Result<void> shutdown() = 0;
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Echoion::Api
|
||||
// call returns the path). Downloads run asynchronously.
|
||||
[[nodiscard]] virtual Result<std::optional<std::string>>
|
||||
requestClientAvatar(uint64_t /*clientId*/,
|
||||
const std::string& /*destDir*/)
|
||||
const std::string& /*destDir*/)
|
||||
{
|
||||
return std::optional<std::string>{};
|
||||
}
|
||||
@@ -79,12 +79,92 @@ namespace Echoion::Api
|
||||
uint64_t channelId) = 0;
|
||||
virtual Result<void> kickClient(uint64_t clientId,
|
||||
const std::string& reason) = 0;
|
||||
virtual Result<void>
|
||||
kickClientFromChannel(uint64_t /*clientId*/,
|
||||
const std::string& /*reason*/)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"channel kick is not supported by this host");
|
||||
}
|
||||
virtual Result<void> banClient(uint64_t /*clientId*/,
|
||||
uint64_t /*durationSeconds*/,
|
||||
const std::string& /*reason*/)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"bans are not supported by this host");
|
||||
}
|
||||
[[nodiscard]] virtual Result<std::vector<BanInfo>> getBans()
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"ban listing is not supported by this host");
|
||||
}
|
||||
virtual Result<void> unban(uint64_t /*banId*/)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"unban is not supported by this host");
|
||||
}
|
||||
|
||||
// Channel operations
|
||||
[[nodiscard]] virtual Result<std::vector<ChannelInfo>>
|
||||
getChannels() const = 0;
|
||||
[[nodiscard]] virtual Result<std::optional<ChannelInfo>>
|
||||
getChannel(uint64_t channelId) const = 0;
|
||||
virtual Result<uint64_t>
|
||||
createChannel(const ChannelCreateOptions& /*options*/)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"channel creation is not supported by this host");
|
||||
}
|
||||
virtual Result<void>
|
||||
editChannel(uint64_t /*channelId*/,
|
||||
const ChannelEditOptions& /*options*/)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"channel editing is not supported by this host");
|
||||
}
|
||||
virtual Result<void> reorderChannel(uint64_t /*channelId*/,
|
||||
uint64_t /*parentId*/,
|
||||
uint64_t /*orderAfterId*/)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"channel reordering is not supported by this host");
|
||||
}
|
||||
virtual Result<void> deleteChannel(uint64_t /*channelId*/,
|
||||
bool /*force*/)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"channel deletion is not supported by this host");
|
||||
}
|
||||
|
||||
// Server-group administration. Membership changes use TeamSpeak's
|
||||
// stable client database id, not the connection-scoped client id.
|
||||
[[nodiscard]] virtual Result<std::vector<ServerGroupInfo>>
|
||||
getServerGroups()
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"server groups are not supported by this host");
|
||||
}
|
||||
virtual Result<void>
|
||||
addClientToServerGroup(uint64_t /*groupId*/,
|
||||
uint64_t /*clientDatabaseId*/)
|
||||
{
|
||||
return fail(
|
||||
ErrorCode::NotSupported,
|
||||
"server-group membership is not supported by this host");
|
||||
}
|
||||
virtual Result<void>
|
||||
removeClientFromServerGroup(uint64_t /*groupId*/,
|
||||
uint64_t /*clientDatabaseId*/)
|
||||
{
|
||||
return fail(
|
||||
ErrorCode::NotSupported,
|
||||
"server-group membership is not supported by this host");
|
||||
}
|
||||
[[nodiscard]] virtual Result<ServerInfo> getTeamSpeakServerInfo()
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"server information is not supported by this host");
|
||||
}
|
||||
|
||||
// Messaging
|
||||
virtual Result<void>
|
||||
@@ -102,40 +182,6 @@ namespace Echoion::Api
|
||||
virtual Result<void>
|
||||
setWhisperList(const std::vector<uint64_t>& clientIds) = 0;
|
||||
|
||||
// Independent audio timelines. A TeamSpeak connection has one voice
|
||||
// sequence, so hosts implement each stream with its own connection and
|
||||
// encoder. The default methods preserve compatibility for hosts that only
|
||||
// support the primary stream.
|
||||
using AudioStreamId = uint64_t;
|
||||
struct AudioStreamOptions {
|
||||
std::string name;
|
||||
ServerConfig server;
|
||||
std::vector<uint64_t> recipients;
|
||||
};
|
||||
[[nodiscard]] virtual Result<AudioStreamId>
|
||||
createAudioStream(const AudioStreamOptions&)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"independent audio streams are not supported by this host");
|
||||
}
|
||||
virtual Result<void> destroyAudioStream(AudioStreamId)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"independent audio streams are not supported by this host");
|
||||
}
|
||||
virtual Result<void> sendAudioDataToStream(
|
||||
AudioStreamId, const std::span<const short>&)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"independent audio streams are not supported by this host");
|
||||
}
|
||||
virtual Result<void> setAudioStreamRecipients(
|
||||
AudioStreamId, const std::vector<uint64_t>&)
|
||||
{
|
||||
return fail(ErrorCode::NotSupported,
|
||||
"independent audio streams are not supported by this host");
|
||||
}
|
||||
|
||||
// Server connection
|
||||
// ServerConfig is defined in PluginTypes.hpp (self-contained)
|
||||
virtual Result<void>
|
||||
|
||||
Reference in new issue
Block a user