Initial commit
This commit is contained in:
commit
f6c5bcca39
52 files changed
+55449
No files matched your search
@@ -0,0 +1,76 @@
|
||||
#pragma once
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <teamspeak/public_definitions.h>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <glaze/core/common.hpp>
|
||||
|
||||
namespace definitions {
|
||||
|
||||
|
||||
struct StreamInfo {
|
||||
std::string url;
|
||||
int itag = 0;
|
||||
std::string mimeType;
|
||||
int bitrate = 0;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
};
|
||||
|
||||
struct Streams {
|
||||
StreamInfo audio;
|
||||
StreamInfo video;
|
||||
};
|
||||
|
||||
struct QueueItem {
|
||||
std::string name;
|
||||
std::string videoId;
|
||||
std::string requester;
|
||||
std::optional<Streams> streams;
|
||||
|
||||
QueueItem() = default;
|
||||
|
||||
QueueItem(std::string name, std::string videoId, std::string requested_by, const std::optional<Streams> & streams)
|
||||
: name{std::move(name)}, videoId(std::move(videoId)), requester{std::move(requested_by)}, streams{streams} {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct SearchResultItem {
|
||||
std::string name;
|
||||
std::string length;
|
||||
std::string thumbnail;
|
||||
std::string viewCount;
|
||||
std::string url;
|
||||
std::string videoId;
|
||||
};
|
||||
|
||||
struct PluginState {
|
||||
std::vector<QueueItem> queue;
|
||||
std::vector<anyID> onlineSubscribers;
|
||||
std::vector<anyID> offlineSubscribers;
|
||||
std::uint64_t serverConnection;
|
||||
bool wasPlaying = false;
|
||||
};
|
||||
}
|
||||
|
||||
template <> struct glz::meta<definitions::StreamInfo> {
|
||||
using T = definitions::StreamInfo;
|
||||
static constexpr auto value =
|
||||
object("url", &T::url, "itag", &T::itag, "mimeType", &T::mimeType,
|
||||
"bitrate", &T::bitrate, "width", &T::width, "height", &T::height);
|
||||
};
|
||||
|
||||
template <> struct glz::meta<definitions::Streams> {
|
||||
using T = definitions::Streams;
|
||||
static constexpr auto value =
|
||||
object("audio", &T::audio, "video", &T::video);
|
||||
};
|
||||
|
||||
template <> struct glz::meta<definitions::QueueItem> {
|
||||
using T = definitions::QueueItem;
|
||||
static constexpr auto value =
|
||||
object("name", &T::name, "videoId", &T::videoId, "requester", &T::requester,
|
||||
"streams", &T::streams);
|
||||
};
|
||||
Reference in new issue
Block a user