Compare commits
1 Commits
765340a727
...
dev_contac
Author | SHA1 | Date | |
---|---|---|---|
d795d328d3 |
2
.github/workflows/cd.yml
vendored
2
.github/workflows/cd.yml
vendored
@ -64,8 +64,6 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
platform:
|
||||
- vcpkg_toolkit: arm-neon-android
|
||||
ndk_abi: armeabi-v7a
|
||||
- vcpkg_toolkit: arm64-android
|
||||
ndk_abi: arm64-v8a
|
||||
- vcpkg_toolkit: x64-android
|
||||
|
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@ -38,8 +38,6 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
platform:
|
||||
- vcpkg_toolkit: arm-neon-android
|
||||
ndk_abi: armeabi-v7a
|
||||
- vcpkg_toolkit: arm64-android
|
||||
ndk_abi: arm64-v8a
|
||||
- vcpkg_toolkit: x64-android
|
||||
@ -61,9 +59,9 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
#- name: update vcpkg
|
||||
# run: |
|
||||
# git clone https://github.com/microsoft/vcpkg.git
|
||||
- name: update vcpkg
|
||||
run: |
|
||||
git clone https://github.com/microsoft/vcpkg.git
|
||||
|
||||
- name: Install Dependencies (host)
|
||||
run: sudo apt update && sudo apt -y install cmake pkg-config nasm
|
||||
@ -71,8 +69,7 @@ jobs:
|
||||
- name: Install Dependencies (target)
|
||||
env:
|
||||
ANDROID_NDK_HOME: ${{steps.setup_ndk.outputs.ndk-path}}
|
||||
#run: vcpkg install --triplet ${{matrix.platform.vcpkg_toolkit}} --overlay-ports=vcpkg/ports libsodium opus libvpx libpng libjpeg-turbo
|
||||
run: vcpkg install --triplet ${{matrix.platform.vcpkg_toolkit}} libsodium opus libvpx libpng libjpeg-turbo
|
||||
run: vcpkg install --triplet ${{matrix.platform.vcpkg_toolkit}} --overlay-ports=vcpkg/ports libsodium opus libvpx libpng libjpeg-turbo
|
||||
|
||||
# vcpkg scripts root /usr/local/share/vcpkg/scripts
|
||||
- name: Configure CMake
|
||||
|
3
external/sdl/CMakeLists.txt
vendored
3
external/sdl/CMakeLists.txt
vendored
@ -25,8 +25,7 @@ if (NOT TARGET SDL3::SDL3)
|
||||
#GIT_TAG 6e885d96193a4b0096fe7fed6d4e6c3e5f247283 # tip 09-09-2024
|
||||
#GIT_TAG 9dd8859240703d886941733ad32c1dc6f50d64f0 # tip 19-09-2024
|
||||
#GIT_TAG afdf325fb4090e93a124519d1a3bc1fbe0ba9025 # bad
|
||||
#GIT_TAG e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e # tip 05-10-2024 (3.1.3)
|
||||
GIT_TAG 2654d5d48b8f764148a7c246fea85b32b1133578 # tip 18-10-2024
|
||||
GIT_TAG e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e # tip 05-10-2024 (3.1.3)
|
||||
|
||||
FIND_PACKAGE_ARGS # for the future
|
||||
)
|
||||
|
2
external/solanaceae_message_serializer
vendored
2
external/solanaceae_message_serializer
vendored
Submodule external/solanaceae_message_serializer updated: c5ee5ac3f9...e574c4f779
2
external/solanaceae_object_store
vendored
2
external/solanaceae_object_store
vendored
Submodule external/solanaceae_object_store updated: ed640ba08c...2801fc21fb
2
external/solanaceae_tox
vendored
2
external/solanaceae_tox
vendored
Submodule external/solanaceae_tox updated: cd196562af...a0c3336f37
2
external/solanaceae_toxcore
vendored
2
external/solanaceae_toxcore
vendored
Submodule external/solanaceae_toxcore updated: 727c341899...7cd6a2b0de
2
external/solanaceae_util
vendored
2
external/solanaceae_util
vendored
Submodule external/solanaceae_util updated: a38c3a3305...17d2baf736
8
flake.lock
generated
8
flake.lock
generated
@ -63,17 +63,17 @@
|
||||
"sdl3": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1729218869,
|
||||
"narHash": "sha256-0KrwC3Yrs1LHwT9SPvknDwPymNmksq6dixM4/KiFqFA=",
|
||||
"lastModified": 1728073678,
|
||||
"narHash": "sha256-S7yRcLHMPgq6+gec8l+ESxp2dJ+6Po/UNsBUXptQzMQ=",
|
||||
"owner": "libsdl-org",
|
||||
"repo": "SDL",
|
||||
"rev": "2654d5d48b8f764148a7c246fea85b32b1133578",
|
||||
"rev": "e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "libsdl-org",
|
||||
"repo": "SDL",
|
||||
"rev": "2654d5d48b8f764148a7c246fea85b32b1133578",
|
||||
"rev": "e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
|
@ -11,7 +11,7 @@
|
||||
flake = false;
|
||||
};
|
||||
sdl3 = {
|
||||
url = "github:libsdl-org/SDL/2654d5d48b8f764148a7c246fea85b32b1133578"; # keep in sync this cmake
|
||||
url = "github:libsdl-org/SDL/e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e"; # keep in sync this cmake
|
||||
flake = false;
|
||||
};
|
||||
sdl3_image = {
|
||||
|
@ -80,6 +80,8 @@ target_sources(tomato PUBLIC
|
||||
./chat_gui/icons/group.cpp
|
||||
./chat_gui/contact_list.hpp
|
||||
./chat_gui/contact_list.cpp
|
||||
./chat_gui/contact_tree.hpp
|
||||
./chat_gui/contact_tree.cpp
|
||||
./chat_gui/file_selector.hpp
|
||||
./chat_gui/file_selector.cpp
|
||||
./chat_gui/send_image_popup.hpp
|
||||
|
@ -2,18 +2,21 @@
|
||||
|
||||
#include "./tox_client.hpp"
|
||||
|
||||
AutoDirty::AutoDirty(ToxClient& tc) : _tc(tc), _tep_sr(_tc.newSubRef(this)) {
|
||||
// TODO: add more events
|
||||
_tep_sr
|
||||
.subscribe(Tox_Event_Type::TOX_EVENT_SELF_CONNECTION_STATUS)
|
||||
.subscribe(Tox_Event_Type::TOX_EVENT_FRIEND_CONNECTION_STATUS)
|
||||
.subscribe(Tox_Event_Type::TOX_EVENT_FRIEND_REQUEST)
|
||||
.subscribe(Tox_Event_Type::TOX_EVENT_GROUP_INVITE)
|
||||
.subscribe(Tox_Event_Type::TOX_EVENT_GROUP_SELF_JOIN)
|
||||
.subscribe(Tox_Event_Type::TOX_EVENT_GROUP_PEER_JOIN)
|
||||
.subscribe(Tox_Event_Type::TOX_EVENT_GROUP_PEER_EXIT)
|
||||
.subscribe(Tox_Event_Type::TOX_EVENT_CONFERENCE_INVITE)
|
||||
;
|
||||
// TODO: add more events
|
||||
|
||||
void AutoDirty::subscribe(void) {
|
||||
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_SELF_CONNECTION_STATUS);
|
||||
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_FRIEND_CONNECTION_STATUS);
|
||||
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_FRIEND_REQUEST);
|
||||
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_INVITE);
|
||||
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_SELF_JOIN);
|
||||
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_PEER_JOIN);
|
||||
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_PEER_EXIT);
|
||||
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_CONFERENCE_INVITE);
|
||||
}
|
||||
|
||||
AutoDirty::AutoDirty(ToxClient& tc) : _tc(tc) {
|
||||
subscribe();
|
||||
}
|
||||
|
||||
bool AutoDirty::onToxEvent(const Tox_Event_Self_Connection_Status*) {
|
||||
|
@ -8,7 +8,8 @@ class ToxClient;
|
||||
// sets ToxClient dirty on some events
|
||||
class AutoDirty : public ToxEventI {
|
||||
ToxClient& _tc;
|
||||
ToxEventProviderI::SubscriptionReference _tep_sr;
|
||||
|
||||
void subscribe(void); // private
|
||||
|
||||
public:
|
||||
AutoDirty(ToxClient& tc);
|
||||
|
97
src/chat_gui/contact_tree.cpp
Normal file
97
src/chat_gui/contact_tree.cpp
Normal file
@ -0,0 +1,97 @@
|
||||
#include "./contact_tree.hpp"
|
||||
|
||||
#include <solanaceae/contact/components.hpp>
|
||||
|
||||
#include "./contact_list.hpp"
|
||||
#include "entt/entity/entity.hpp"
|
||||
|
||||
#include <imgui/imgui.h>
|
||||
|
||||
namespace Components {
|
||||
struct TagTreeViewOpen {};
|
||||
};
|
||||
|
||||
ContactTreeWindow::ContactTreeWindow(Contact3Registry& cr, Theme& theme, ContactTextureCache& ctc) : _cr(cr), _theme(theme), _ctc(ctc) {
|
||||
}
|
||||
|
||||
void ContactTreeWindow::render(void) {
|
||||
//{ // main window menubar injection
|
||||
// // assumes the window "tomato" was rendered already by cg
|
||||
// if (ImGui::Begin("tomato")) {
|
||||
// if (ImGui::BeginMenuBar()) {
|
||||
// ImGui::Separator();
|
||||
// if (ImGui::BeginMenu("Settings")) {
|
||||
// if (ImGui::MenuItem("settings window", nullptr, _show_window)) {
|
||||
// _show_window = !_show_window;
|
||||
// }
|
||||
// ImGui::EndMenu();
|
||||
// }
|
||||
// ImGui::EndMenuBar();
|
||||
// }
|
||||
// }
|
||||
// ImGui::End();
|
||||
//}
|
||||
|
||||
if (_show_window) {
|
||||
if (ImGui::Begin("ContactTreeWindow", &_show_window)) {
|
||||
|
||||
if (ImGui::BeginTable("##table", 1, ImGuiTableFlags_None)) {
|
||||
// first we need all root nodes
|
||||
for (const auto [cv_root] : _cr.view<Contact::Components::TagRoot>().each()) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::PushID(entt::to_integral(cv_root));
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
Contact3Handle c_root {_cr, cv_root};
|
||||
bool open = c_root.all_of<Components::TagTreeViewOpen>();
|
||||
|
||||
bool has_children = c_root.all_of<Contact::Components::ParentOf>();
|
||||
|
||||
// roots are usually no normal contacts
|
||||
// they should display as a protocol or profile or account
|
||||
// TODO: set some table background instead of full span selected?
|
||||
if (renderContactBig(_theme, _ctc, c_root, 2, false, true)) {
|
||||
// clicked, toggle open
|
||||
if (open) {
|
||||
c_root.remove<Components::TagTreeViewOpen>();
|
||||
open = false;
|
||||
} else {
|
||||
c_root.emplace_or_replace<Components::TagTreeViewOpen>();
|
||||
open = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (open) {
|
||||
// render children
|
||||
|
||||
ImGui::Indent();
|
||||
|
||||
if (c_root.all_of<Contact::Components::ParentOf>()) {
|
||||
for (const auto cv_child : c_root.get<Contact::Components::ParentOf>().subs) {
|
||||
ImGui::PushID(entt::to_integral(cv_child));
|
||||
|
||||
Contact3Handle c_child {_cr, cv_child};
|
||||
renderContactBig(_theme, _ctc, c_child, 2);
|
||||
|
||||
ImGui::PopID();
|
||||
}
|
||||
} else {
|
||||
// TODO: remove
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::TextDisabled("no parent of");
|
||||
}
|
||||
|
||||
ImGui::Unindent();
|
||||
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
ImGui::EndTable();
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
23
src/chat_gui/contact_tree.hpp
Normal file
23
src/chat_gui/contact_tree.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <solanaceae/contact/contact_model3.hpp>
|
||||
|
||||
#include "./texture_cache_defs.hpp"
|
||||
|
||||
// fwd
|
||||
struct Theme;
|
||||
|
||||
class ContactTreeWindow {
|
||||
bool _show_window {true};
|
||||
|
||||
Contact3Registry& _cr;
|
||||
|
||||
Theme& _theme;
|
||||
ContactTextureCache& _ctc;
|
||||
|
||||
public:
|
||||
ContactTreeWindow(Contact3Registry& cr, Theme& theme, ContactTextureCache& ctc);
|
||||
|
||||
void render(void);
|
||||
};
|
||||
|
@ -1048,11 +1048,6 @@ void ChatGui4::renderMessageBodyText(Message3Registry& reg, const Message3 e) {
|
||||
|
||||
void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
||||
auto o = reg.get<Message::Components::MessageFileObject>(e).o;
|
||||
if (!o) {
|
||||
ImGui::TextDisabled("file message missing file object!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
!_show_chat_avatar_tf
|
||||
&& (
|
||||
@ -1352,27 +1347,10 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
||||
|
||||
if (fts != nullptr) {
|
||||
ImGui::SeparatorText("transfer stats");
|
||||
|
||||
{
|
||||
const char* byte_suffix = "???";
|
||||
int64_t byte_divider = sizeToHumanReadable(fts->rate_up, byte_suffix);
|
||||
ImGui::Text("rate up : %.2f %s/s", fts->rate_up/byte_divider, byte_suffix);
|
||||
}
|
||||
{
|
||||
const char* byte_suffix = "???";
|
||||
int64_t byte_divider = sizeToHumanReadable(fts->rate_down, byte_suffix);
|
||||
ImGui::Text("rate down : %.2f %s/s", fts->rate_down/byte_divider, byte_suffix);
|
||||
}
|
||||
{
|
||||
const char* byte_suffix = "???";
|
||||
int64_t byte_divider = sizeToHumanReadable(fts->total_up, byte_suffix);
|
||||
ImGui::Text("total up : %.3f %s", double(fts->total_up)/byte_divider, byte_suffix);
|
||||
}
|
||||
{
|
||||
const char* byte_suffix = "???";
|
||||
int64_t byte_divider = sizeToHumanReadable(fts->total_down, byte_suffix);
|
||||
ImGui::Text("total down: %.3f %s", double(fts->total_down)/byte_divider, byte_suffix);
|
||||
}
|
||||
ImGui::Text("rate up : %.1f Bytes/s", fts->rate_up);
|
||||
ImGui::Text("rate down : %.1f Bytes/s", fts->rate_down);
|
||||
ImGui::Text("total up : %lu Bytes", fts->total_up);
|
||||
ImGui::Text("total down: %lu Bytes", fts->total_down);
|
||||
}
|
||||
|
||||
ImGui::EndTooltip();
|
||||
@ -1479,7 +1457,7 @@ void ChatGui4::pasteFile(const char* mime_type) {
|
||||
size_t data_size = 0;
|
||||
void* data = SDL_GetClipboardData(mime_type, &data_size);
|
||||
|
||||
std::cout << "CG: pasted image of size: " << data_size << " mimetype: " << mime_type << "\n";
|
||||
std::cout << "CG: pasted image of size " << data_size << " mime " << mime_type << "\n";
|
||||
|
||||
_sip.sendMemory(
|
||||
static_cast<const uint8_t*>(data), data_size,
|
||||
|
@ -27,12 +27,10 @@ StreamManager::Connection::Connection(
|
||||
}
|
||||
}
|
||||
|
||||
StreamManager::StreamManager(ObjectStore2& os) : _os(os), _os_sr(_os.newSubRef(this)) {
|
||||
_os_sr
|
||||
.subscribe(ObjectStore_Event::object_construct)
|
||||
//.subscribe(ObjectStore_Event::object_update)
|
||||
.subscribe(ObjectStore_Event::object_destroy)
|
||||
;
|
||||
StreamManager::StreamManager(ObjectStore2& os) : _os(os) {
|
||||
_os.subscribe(this, ObjectStore_Event::object_construct);
|
||||
//_os.subscribe(this, ObjectStore_Event::object_update);
|
||||
_os.subscribe(this, ObjectStore_Event::object_destroy);
|
||||
}
|
||||
|
||||
StreamManager::~StreamManager(void) {
|
||||
|
@ -57,7 +57,6 @@ namespace Components {
|
||||
class StreamManager : protected ObjectStoreEventI {
|
||||
friend class StreamManagerUI; // TODO: make this go away
|
||||
ObjectStore2& _os;
|
||||
ObjectStore2::SubscriptionReference _os_sr;
|
||||
|
||||
struct Connection {
|
||||
ObjectHandle src;
|
||||
|
@ -20,11 +20,10 @@ MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme
|
||||
renderer(renderer_),
|
||||
conf(std::move(conf_)),
|
||||
rmm(cr),
|
||||
msnj{cr, os, {}, {}},
|
||||
msnj{cr, {}, {}},
|
||||
mts(rmm),
|
||||
sm(os),
|
||||
tc(save_path, save_password),
|
||||
tel(tc, std::cout),
|
||||
tpi(tc.getTox()),
|
||||
ad(tc),
|
||||
tcm(cr, tc, tc),
|
||||
@ -44,6 +43,7 @@ MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme
|
||||
mil(),
|
||||
msg_tc(mil, sdlrtu),
|
||||
cg(conf, os, rmm, cr, sdlrtu, contact_tc, msg_tc, theme),
|
||||
ctw(cr, theme, contact_tc),
|
||||
sw(conf),
|
||||
osui(os),
|
||||
tuiu(tc, conf),
|
||||
@ -51,7 +51,7 @@ MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme
|
||||
smui(os, sm),
|
||||
dvt(os, sm, sdlrtu)
|
||||
{
|
||||
tel.subscribeAll();
|
||||
tel.subscribeAll(tc);
|
||||
|
||||
registerMessageComponents(msnj);
|
||||
registerToxMessageComponents(msnj);
|
||||
@ -358,6 +358,7 @@ Screen* MainScreen::render(float time_delta, bool&) {
|
||||
const float msgtc_interval = msg_tc.update();
|
||||
|
||||
const float cg_interval = cg.render(time_delta); // render
|
||||
ctw.render();
|
||||
sw.render(); // render
|
||||
osui.render();
|
||||
tuiu.render(); // render
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "./message_image_loader.hpp"
|
||||
|
||||
#include "./chat_gui4.hpp"
|
||||
#include "./chat_gui/contact_tree.hpp"
|
||||
#include "./chat_gui/settings_window.hpp"
|
||||
#include "./object_store_ui.hpp"
|
||||
#include "./tox_ui_utils.hpp"
|
||||
@ -65,8 +66,8 @@ struct MainScreen final : public Screen {
|
||||
|
||||
StreamManager sm;
|
||||
|
||||
ToxEventLogger tel{std::cout};
|
||||
ToxClient tc;
|
||||
ToxEventLogger tel;
|
||||
ToxPrivateImpl tpi;
|
||||
AutoDirty ad;
|
||||
ToxContactModel2 tcm;
|
||||
@ -92,6 +93,7 @@ struct MainScreen final : public Screen {
|
||||
TextureCache<void*, Message3Handle, MessageImageLoader> msg_tc;
|
||||
|
||||
ChatGui4 cg;
|
||||
ContactTreeWindow ctw;
|
||||
SettingsWindow sw;
|
||||
ObjectStoreUI osui;
|
||||
ToxUIUtils tuiu;
|
||||
|
@ -120,17 +120,15 @@ void MediaMetaInfoLoader::handleMessage(const Message3Handle& m) {
|
||||
_rmm.throwEventUpdate(m);
|
||||
}
|
||||
|
||||
MediaMetaInfoLoader::MediaMetaInfoLoader(RegistryMessageModelI& rmm) : _rmm(rmm), _rmm_sr(_rmm.newSubRef(this)) {
|
||||
MediaMetaInfoLoader::MediaMetaInfoLoader(RegistryMessageModelI& rmm) : _rmm(rmm) {
|
||||
// HACK: make them be added externally?
|
||||
_image_loaders.push_back(std::make_unique<ImageLoaderWebP>());
|
||||
_image_loaders.push_back(std::make_unique<ImageLoaderSDLBMP>());
|
||||
_image_loaders.push_back(std::make_unique<ImageLoaderQOI>());
|
||||
_image_loaders.push_back(std::make_unique<ImageLoaderSDLImage>());
|
||||
|
||||
_rmm_sr
|
||||
.subscribe(RegistryMessageModel_Event::message_construct)
|
||||
.subscribe(RegistryMessageModel_Event::message_updated)
|
||||
;
|
||||
_rmm.subscribe(this, RegistryMessageModel_Event::message_construct);
|
||||
_rmm.subscribe(this, RegistryMessageModel_Event::message_updated);
|
||||
}
|
||||
|
||||
MediaMetaInfoLoader::~MediaMetaInfoLoader(void) {
|
||||
|
@ -14,7 +14,6 @@ namespace Message::Components {
|
||||
class MediaMetaInfoLoader : public RegistryMessageModelEventI {
|
||||
protected:
|
||||
RegistryMessageModelI& _rmm;
|
||||
RegistryMessageModelI::SubscriptionReference _rmm_sr;
|
||||
|
||||
std::vector<std::unique_ptr<ImageLoaderI>> _image_loaders;
|
||||
|
||||
|
@ -491,18 +491,16 @@ void ToxAVVoIPModel::handleEvent(const Events::FriendCallState& e) {
|
||||
}
|
||||
|
||||
ToxAVVoIPModel::ToxAVVoIPModel(ObjectStore2& os, ToxAVI& av, Contact3Registry& cr, ToxContactModel2& tcm) :
|
||||
_os(os), _av(av), _av_sr(_av.newSubRef(this)), _cr(cr), _tcm(tcm)
|
||||
_os(os), _av(av), _cr(cr), _tcm(tcm)
|
||||
{
|
||||
_av_sr
|
||||
.subscribe(ToxAV_Event::friend_call)
|
||||
.subscribe(ToxAV_Event::friend_call_state)
|
||||
.subscribe(ToxAV_Event::friend_audio_bitrate)
|
||||
.subscribe(ToxAV_Event::friend_video_bitrate)
|
||||
.subscribe(ToxAV_Event::friend_audio_frame)
|
||||
.subscribe(ToxAV_Event::friend_video_frame)
|
||||
.subscribe(ToxAV_Event::iterate_audio)
|
||||
.subscribe(ToxAV_Event::iterate_video)
|
||||
;
|
||||
_av.subscribe(this, ToxAV_Event::friend_call);
|
||||
_av.subscribe(this, ToxAV_Event::friend_call_state);
|
||||
_av.subscribe(this, ToxAV_Event::friend_audio_bitrate);
|
||||
_av.subscribe(this, ToxAV_Event::friend_video_bitrate);
|
||||
_av.subscribe(this, ToxAV_Event::friend_audio_frame);
|
||||
_av.subscribe(this, ToxAV_Event::friend_video_frame);
|
||||
_av.subscribe(this, ToxAV_Event::iterate_audio);
|
||||
_av.subscribe(this, ToxAV_Event::iterate_video);
|
||||
|
||||
// attach to all tox friend contacts
|
||||
|
||||
|
@ -18,7 +18,6 @@ struct ToxAVCallVideoSink;
|
||||
class ToxAVVoIPModel : protected ToxAVEventI, public VoIPModelI {
|
||||
ObjectStore2& _os;
|
||||
ToxAVI& _av;
|
||||
ToxAVI::SubscriptionReference _av_sr;
|
||||
Contact3Registry& _cr;
|
||||
ToxContactModel2& _tcm;
|
||||
|
||||
|
@ -33,11 +33,9 @@ ToxAvatarManager::ToxAvatarManager(
|
||||
ObjectStore2& os,
|
||||
Contact3Registry& cr,
|
||||
ConfigModelI& conf
|
||||
) : /*_rmm(rmm)*/ _os(os), _os_sr(_os.newSubRef(this)), _cr(cr), _conf(conf) {
|
||||
_os_sr
|
||||
.subscribe(ObjectStore_Event::object_construct)
|
||||
.subscribe(ObjectStore_Event::object_update)
|
||||
;
|
||||
) : /*_rmm(rmm)*/ _os(os), _cr(cr), _conf(conf) {
|
||||
_os.subscribe(this, ObjectStore_Event::object_construct);
|
||||
_os.subscribe(this, ObjectStore_Event::object_update);
|
||||
|
||||
if (!_conf.has_string("ToxAvatarManager", "save_path")) {
|
||||
// or on linux: $HOME/.config/tox/avatars/
|
||||
|
@ -14,7 +14,6 @@ struct ToxKey;
|
||||
|
||||
class ToxAvatarManager : public ObjectStoreEventI {
|
||||
ObjectStore2& _os;
|
||||
ObjectStore2::SubscriptionReference _os_sr;
|
||||
Contact3Registry& _cr;
|
||||
ConfigModelI& _conf;
|
||||
|
||||
|
@ -30,8 +30,8 @@ ToxFriendFauxOfflineMessaging::ToxFriendFauxOfflineMessaging(
|
||||
ToxContactModel2& tcm,
|
||||
ToxI& t,
|
||||
ToxEventProviderI& tep
|
||||
) : _cr(cr), _rmm(rmm), _tcm(tcm), _t(t), _tep_sr(tep.newSubRef(this)) {
|
||||
_tep_sr.subscribe(Tox_Event_Type::TOX_EVENT_FRIEND_CONNECTION_STATUS);
|
||||
) : _cr(cr), _rmm(rmm), _tcm(tcm), _t(t), _tep(tep) {
|
||||
_tep.subscribe(this, Tox_Event_Type::TOX_EVENT_FRIEND_CONNECTION_STATUS);
|
||||
}
|
||||
|
||||
float ToxFriendFauxOfflineMessaging::tick(float time_delta) {
|
||||
|
@ -18,7 +18,7 @@ class ToxFriendFauxOfflineMessaging : public ToxEventI {
|
||||
RegistryMessageModelI& _rmm;
|
||||
ToxContactModel2& _tcm;
|
||||
ToxI& _t;
|
||||
ToxEventProviderI::SubscriptionReference _tep_sr;
|
||||
ToxEventProviderI& _tep;
|
||||
|
||||
float _interval_timer{0.f};
|
||||
|
||||
|
Reference in New Issue
Block a user