content stuff
This commit is contained in:
parent
ddadc9bdbc
commit
495ec41234
@ -1,28 +1,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <entt/entity/registry.hpp>
|
|
||||||
#include <entt/entity/handle.hpp>
|
|
||||||
#include <entt/container/dense_set.hpp>
|
#include <entt/container/dense_set.hpp>
|
||||||
|
|
||||||
|
#include <solanaceae/object_store/object_store.hpp>
|
||||||
#include <solanaceae/contact/contact_model3.hpp>
|
#include <solanaceae/contact/contact_model3.hpp>
|
||||||
#include <solanaceae/message3/registry_message_model.hpp>
|
#include <solanaceae/message3/registry_message_model.hpp>
|
||||||
|
|
||||||
#include <solanaceae/file/file2.hpp>
|
#include <solanaceae/file/file2.hpp>
|
||||||
|
|
||||||
enum class Content : uint32_t {};
|
|
||||||
using ContentRegistry = entt::basic_registry<Content>;
|
|
||||||
using ContentHandle = entt::basic_handle<ContentRegistry>;
|
|
||||||
|
|
||||||
struct ContentStore {
|
|
||||||
static constexpr const char* version {"1"};
|
|
||||||
|
|
||||||
ContentRegistry _reg;
|
|
||||||
|
|
||||||
ContentRegistry& registry(void);
|
|
||||||
ContentHandle objectHandle(const Content e);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace Content1::Components {
|
namespace Content1::Components {
|
||||||
|
|
||||||
// TODO: design it as a tree?
|
// TODO: design it as a tree?
|
||||||
@ -33,7 +18,7 @@ namespace Content1::Components {
|
|||||||
struct TagVideoStream {};
|
struct TagVideoStream {};
|
||||||
|
|
||||||
struct TimingTiedTo {
|
struct TimingTiedTo {
|
||||||
entt::dense_set<ContentHandle> ties;
|
entt::dense_set<ObjectHandle> ties;
|
||||||
};
|
};
|
||||||
|
|
||||||
// the associated messages, if any
|
// the associated messages, if any
|
||||||
@ -59,6 +44,6 @@ namespace Content1::Components {
|
|||||||
|
|
||||||
// TODO: i have no idea
|
// TODO: i have no idea
|
||||||
struct RawFile2ReadFromContentFactoryI {
|
struct RawFile2ReadFromContentFactoryI {
|
||||||
virtual std::shared_ptr<File2I> open(ContentHandle h) = 0;
|
virtual std::shared_ptr<File2I> open(ObjectHandle h) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ int main(int argc, char** argv) {
|
|||||||
} else { // HACK
|
} else { // HACK
|
||||||
SDLVideoCameraContent vcc;
|
SDLVideoCameraContent vcc;
|
||||||
auto* reader = vcc.aquireReader();
|
auto* reader = vcc.aquireReader();
|
||||||
for (size_t i = 0; i < 200; i++) {
|
for (size_t i = 0; i < 20; i++) {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||||
auto new_frame_opt = reader->getNext();
|
auto new_frame_opt = reader->getNext();
|
||||||
if (new_frame_opt.has_value()) {
|
if (new_frame_opt.has_value()) {
|
||||||
|
@ -71,8 +71,6 @@ MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme
|
|||||||
g_provideInstance<RegistryMessageModel>("RegistryMessageModel", "host", &rmm);
|
g_provideInstance<RegistryMessageModel>("RegistryMessageModel", "host", &rmm);
|
||||||
g_provideInstance<MessageSerializerNJ>("MessageSerializerNJ", "host", &msnj);
|
g_provideInstance<MessageSerializerNJ>("MessageSerializerNJ", "host", &msnj);
|
||||||
|
|
||||||
g_provideInstance<ContentStore>("ContentStore", "host", &cs);
|
|
||||||
|
|
||||||
g_provideInstance<ToxI>("ToxI", "host", &tc);
|
g_provideInstance<ToxI>("ToxI", "host", &tc);
|
||||||
g_provideInstance<ToxPrivateI>("ToxPrivateI", "host", &tpi);
|
g_provideInstance<ToxPrivateI>("ToxPrivateI", "host", &tpi);
|
||||||
g_provideInstance<ToxEventProviderI>("ToxEventProviderI", "host", &tc);
|
g_provideInstance<ToxEventProviderI>("ToxEventProviderI", "host", &tc);
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
#include <solanaceae/toxcore/tox_event_logger.hpp>
|
#include <solanaceae/toxcore/tox_event_logger.hpp>
|
||||||
#include "./tox_private_impl.hpp"
|
#include "./tox_private_impl.hpp"
|
||||||
|
|
||||||
#include "./content/content.hpp"
|
|
||||||
|
|
||||||
#include <solanaceae/tox_contacts/tox_contact_model2.hpp>
|
#include <solanaceae/tox_contacts/tox_contact_model2.hpp>
|
||||||
#include <solanaceae/tox_messages/tox_message_manager.hpp>
|
#include <solanaceae/tox_messages/tox_message_manager.hpp>
|
||||||
#include <solanaceae/tox_messages/tox_transfer_manager.hpp>
|
#include <solanaceae/tox_messages/tox_transfer_manager.hpp>
|
||||||
@ -60,8 +58,6 @@ struct MainScreen final : public Screen {
|
|||||||
MessageSerializerNJ msnj;
|
MessageSerializerNJ msnj;
|
||||||
MessageTimeSort mts;
|
MessageTimeSort mts;
|
||||||
|
|
||||||
ContentStore cs;
|
|
||||||
|
|
||||||
ToxEventLogger tel{std::cout};
|
ToxEventLogger tel{std::cout};
|
||||||
ToxClient tc;
|
ToxClient tc;
|
||||||
ToxPrivateImpl tpi;
|
ToxPrivateImpl tpi;
|
||||||
|
Loading…
Reference in New Issue
Block a user