Compare commits

...

7 Commits

Author SHA1 Message Date
765340a727 update to new tox interface
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
2024-11-06 10:52:33 +01:00
72d3575670 more human readable
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
2024-10-28 23:17:52 +01:00
31352ed06a forgot to write id
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
2024-10-27 15:32:04 +01:00
2d96139d4a prep message serl for file objects
Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousDelivery / windows (push) Waiting to run
ContinuousDelivery / windows-asan (push) Waiting to run
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / linux (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run
2024-10-27 15:09:06 +01:00
92740c8dbe use sr
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
2024-10-25 13:46:00 +02:00
a9d8c070bc enable arm32 in the ci/cd
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
2024-10-19 11:24:09 +02:00
f93602e524 update sdl to latest
Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousDelivery / windows (push) Waiting to run
ContinuousDelivery / windows-asan (push) Waiting to run
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / linux (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run
2024-10-18 17:46:52 +02:00
25 changed files with 99 additions and 62 deletions

View File

@ -64,6 +64,8 @@ jobs:
strategy: strategy:
matrix: matrix:
platform: platform:
- vcpkg_toolkit: arm-neon-android
ndk_abi: armeabi-v7a
- vcpkg_toolkit: arm64-android - vcpkg_toolkit: arm64-android
ndk_abi: arm64-v8a ndk_abi: arm64-v8a
- vcpkg_toolkit: x64-android - vcpkg_toolkit: x64-android

View File

@ -38,6 +38,8 @@ jobs:
strategy: strategy:
matrix: matrix:
platform: platform:
- vcpkg_toolkit: arm-neon-android
ndk_abi: armeabi-v7a
- vcpkg_toolkit: arm64-android - vcpkg_toolkit: arm64-android
ndk_abi: arm64-v8a ndk_abi: arm64-v8a
- vcpkg_toolkit: x64-android - vcpkg_toolkit: x64-android
@ -59,9 +61,9 @@ jobs:
distribution: 'temurin' distribution: 'temurin'
java-version: '17' java-version: '17'
- name: update vcpkg #- name: update vcpkg
run: | # run: |
git clone https://github.com/microsoft/vcpkg.git # git clone https://github.com/microsoft/vcpkg.git
- name: Install Dependencies (host) - name: Install Dependencies (host)
run: sudo apt update && sudo apt -y install cmake pkg-config nasm run: sudo apt update && sudo apt -y install cmake pkg-config nasm
@ -69,7 +71,8 @@ jobs:
- name: Install Dependencies (target) - name: Install Dependencies (target)
env: env:
ANDROID_NDK_HOME: ${{steps.setup_ndk.outputs.ndk-path}} 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}} --overlay-ports=vcpkg/ports libsodium opus libvpx libpng libjpeg-turbo
run: vcpkg install --triplet ${{matrix.platform.vcpkg_toolkit}} libsodium opus libvpx libpng libjpeg-turbo
# vcpkg scripts root /usr/local/share/vcpkg/scripts # vcpkg scripts root /usr/local/share/vcpkg/scripts
- name: Configure CMake - name: Configure CMake

View File

@ -25,7 +25,8 @@ if (NOT TARGET SDL3::SDL3)
#GIT_TAG 6e885d96193a4b0096fe7fed6d4e6c3e5f247283 # tip 09-09-2024 #GIT_TAG 6e885d96193a4b0096fe7fed6d4e6c3e5f247283 # tip 09-09-2024
#GIT_TAG 9dd8859240703d886941733ad32c1dc6f50d64f0 # tip 19-09-2024 #GIT_TAG 9dd8859240703d886941733ad32c1dc6f50d64f0 # tip 19-09-2024
#GIT_TAG afdf325fb4090e93a124519d1a3bc1fbe0ba9025 # bad #GIT_TAG afdf325fb4090e93a124519d1a3bc1fbe0ba9025 # bad
GIT_TAG e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e # tip 05-10-2024 (3.1.3) #GIT_TAG e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e # tip 05-10-2024 (3.1.3)
GIT_TAG 2654d5d48b8f764148a7c246fea85b32b1133578 # tip 18-10-2024
FIND_PACKAGE_ARGS # for the future FIND_PACKAGE_ARGS # for the future
) )

8
flake.lock generated
View File

@ -63,17 +63,17 @@
"sdl3": { "sdl3": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1728073678, "lastModified": 1729218869,
"narHash": "sha256-S7yRcLHMPgq6+gec8l+ESxp2dJ+6Po/UNsBUXptQzMQ=", "narHash": "sha256-0KrwC3Yrs1LHwT9SPvknDwPymNmksq6dixM4/KiFqFA=",
"owner": "libsdl-org", "owner": "libsdl-org",
"repo": "SDL", "repo": "SDL",
"rev": "e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e", "rev": "2654d5d48b8f764148a7c246fea85b32b1133578",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "libsdl-org", "owner": "libsdl-org",
"repo": "SDL", "repo": "SDL",
"rev": "e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e", "rev": "2654d5d48b8f764148a7c246fea85b32b1133578",
"type": "github" "type": "github"
} }
}, },

View File

@ -11,7 +11,7 @@
flake = false; flake = false;
}; };
sdl3 = { sdl3 = {
url = "github:libsdl-org/SDL/e292d1f5ace469f718d7b6b4dec8c28e37dcaa0e"; # keep in sync this cmake url = "github:libsdl-org/SDL/2654d5d48b8f764148a7c246fea85b32b1133578"; # keep in sync this cmake
flake = false; flake = false;
}; };
sdl3_image = { sdl3_image = {

View File

@ -2,21 +2,18 @@
#include "./tox_client.hpp" #include "./tox_client.hpp"
AutoDirty::AutoDirty(ToxClient& tc) : _tc(tc), _tep_sr(_tc.newSubRef(this)) {
// TODO: add more events // TODO: add more events
_tep_sr
void AutoDirty::subscribe(void) { .subscribe(Tox_Event_Type::TOX_EVENT_SELF_CONNECTION_STATUS)
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_SELF_CONNECTION_STATUS); .subscribe(Tox_Event_Type::TOX_EVENT_FRIEND_CONNECTION_STATUS)
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_FRIEND_CONNECTION_STATUS); .subscribe(Tox_Event_Type::TOX_EVENT_FRIEND_REQUEST)
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_FRIEND_REQUEST); .subscribe(Tox_Event_Type::TOX_EVENT_GROUP_INVITE)
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_INVITE); .subscribe(Tox_Event_Type::TOX_EVENT_GROUP_SELF_JOIN)
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_SELF_JOIN); .subscribe(Tox_Event_Type::TOX_EVENT_GROUP_PEER_JOIN)
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_PEER_JOIN); .subscribe(Tox_Event_Type::TOX_EVENT_GROUP_PEER_EXIT)
_tc.subscribe(this, Tox_Event_Type::TOX_EVENT_GROUP_PEER_EXIT); .subscribe(Tox_Event_Type::TOX_EVENT_CONFERENCE_INVITE)
_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*) { bool AutoDirty::onToxEvent(const Tox_Event_Self_Connection_Status*) {

View File

@ -8,8 +8,7 @@ class ToxClient;
// sets ToxClient dirty on some events // sets ToxClient dirty on some events
class AutoDirty : public ToxEventI { class AutoDirty : public ToxEventI {
ToxClient& _tc; ToxClient& _tc;
ToxEventProviderI::SubscriptionReference _tep_sr;
void subscribe(void); // private
public: public:
AutoDirty(ToxClient& tc); AutoDirty(ToxClient& tc);

View File

@ -1048,6 +1048,11 @@ void ChatGui4::renderMessageBodyText(Message3Registry& reg, const Message3 e) {
void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) { void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
auto o = reg.get<Message::Components::MessageFileObject>(e).o; auto o = reg.get<Message::Components::MessageFileObject>(e).o;
if (!o) {
ImGui::TextDisabled("file message missing file object!");
return;
}
if ( if (
!_show_chat_avatar_tf !_show_chat_avatar_tf
&& ( && (
@ -1347,10 +1352,27 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
if (fts != nullptr) { if (fts != nullptr) {
ImGui::SeparatorText("transfer stats"); ImGui::SeparatorText("transfer stats");
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); const char* byte_suffix = "???";
ImGui::Text("total down: %lu Bytes", fts->total_down); 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::EndTooltip(); ImGui::EndTooltip();
@ -1457,7 +1479,7 @@ void ChatGui4::pasteFile(const char* mime_type) {
size_t data_size = 0; size_t data_size = 0;
void* data = SDL_GetClipboardData(mime_type, &data_size); void* data = SDL_GetClipboardData(mime_type, &data_size);
std::cout << "CG: pasted image of size " << data_size << " mime " << mime_type << "\n"; std::cout << "CG: pasted image of size: " << data_size << " mimetype: " << mime_type << "\n";
_sip.sendMemory( _sip.sendMemory(
static_cast<const uint8_t*>(data), data_size, static_cast<const uint8_t*>(data), data_size,

View File

@ -27,10 +27,12 @@ StreamManager::Connection::Connection(
} }
} }
StreamManager::StreamManager(ObjectStore2& os) : _os(os) { StreamManager::StreamManager(ObjectStore2& os) : _os(os), _os_sr(_os.newSubRef(this)) {
_os.subscribe(this, ObjectStore_Event::object_construct); _os_sr
//_os.subscribe(this, ObjectStore_Event::object_update); .subscribe(ObjectStore_Event::object_construct)
_os.subscribe(this, ObjectStore_Event::object_destroy); //.subscribe(ObjectStore_Event::object_update)
.subscribe(ObjectStore_Event::object_destroy)
;
} }
StreamManager::~StreamManager(void) { StreamManager::~StreamManager(void) {

View File

@ -57,6 +57,7 @@ namespace Components {
class StreamManager : protected ObjectStoreEventI { class StreamManager : protected ObjectStoreEventI {
friend class StreamManagerUI; // TODO: make this go away friend class StreamManagerUI; // TODO: make this go away
ObjectStore2& _os; ObjectStore2& _os;
ObjectStore2::SubscriptionReference _os_sr;
struct Connection { struct Connection {
ObjectHandle src; ObjectHandle src;

View File

@ -20,10 +20,11 @@ MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme
renderer(renderer_), renderer(renderer_),
conf(std::move(conf_)), conf(std::move(conf_)),
rmm(cr), rmm(cr),
msnj{cr, {}, {}}, msnj{cr, os, {}, {}},
mts(rmm), mts(rmm),
sm(os), sm(os),
tc(save_path, save_password), tc(save_path, save_password),
tel(tc, std::cout),
tpi(tc.getTox()), tpi(tc.getTox()),
ad(tc), ad(tc),
tcm(cr, tc, tc), tcm(cr, tc, tc),
@ -50,7 +51,7 @@ MainScreen::MainScreen(SimpleConfigModel&& conf_, SDL_Renderer* renderer_, Theme
smui(os, sm), smui(os, sm),
dvt(os, sm, sdlrtu) dvt(os, sm, sdlrtu)
{ {
tel.subscribeAll(tc); tel.subscribeAll();
registerMessageComponents(msnj); registerMessageComponents(msnj);
registerToxMessageComponents(msnj); registerToxMessageComponents(msnj);

View File

@ -65,8 +65,8 @@ struct MainScreen final : public Screen {
StreamManager sm; StreamManager sm;
ToxEventLogger tel{std::cout};
ToxClient tc; ToxClient tc;
ToxEventLogger tel;
ToxPrivateImpl tpi; ToxPrivateImpl tpi;
AutoDirty ad; AutoDirty ad;
ToxContactModel2 tcm; ToxContactModel2 tcm;

View File

@ -120,15 +120,17 @@ void MediaMetaInfoLoader::handleMessage(const Message3Handle& m) {
_rmm.throwEventUpdate(m); _rmm.throwEventUpdate(m);
} }
MediaMetaInfoLoader::MediaMetaInfoLoader(RegistryMessageModelI& rmm) : _rmm(rmm) { MediaMetaInfoLoader::MediaMetaInfoLoader(RegistryMessageModelI& rmm) : _rmm(rmm), _rmm_sr(_rmm.newSubRef(this)) {
// HACK: make them be added externally? // HACK: make them be added externally?
_image_loaders.push_back(std::make_unique<ImageLoaderWebP>()); _image_loaders.push_back(std::make_unique<ImageLoaderWebP>());
_image_loaders.push_back(std::make_unique<ImageLoaderSDLBMP>()); _image_loaders.push_back(std::make_unique<ImageLoaderSDLBMP>());
_image_loaders.push_back(std::make_unique<ImageLoaderQOI>()); _image_loaders.push_back(std::make_unique<ImageLoaderQOI>());
_image_loaders.push_back(std::make_unique<ImageLoaderSDLImage>()); _image_loaders.push_back(std::make_unique<ImageLoaderSDLImage>());
_rmm.subscribe(this, RegistryMessageModel_Event::message_construct); _rmm_sr
_rmm.subscribe(this, RegistryMessageModel_Event::message_updated); .subscribe(RegistryMessageModel_Event::message_construct)
.subscribe(RegistryMessageModel_Event::message_updated)
;
} }
MediaMetaInfoLoader::~MediaMetaInfoLoader(void) { MediaMetaInfoLoader::~MediaMetaInfoLoader(void) {

View File

@ -14,6 +14,7 @@ namespace Message::Components {
class MediaMetaInfoLoader : public RegistryMessageModelEventI { class MediaMetaInfoLoader : public RegistryMessageModelEventI {
protected: protected:
RegistryMessageModelI& _rmm; RegistryMessageModelI& _rmm;
RegistryMessageModelI::SubscriptionReference _rmm_sr;
std::vector<std::unique_ptr<ImageLoaderI>> _image_loaders; std::vector<std::unique_ptr<ImageLoaderI>> _image_loaders;

View File

@ -491,16 +491,18 @@ void ToxAVVoIPModel::handleEvent(const Events::FriendCallState& e) {
} }
ToxAVVoIPModel::ToxAVVoIPModel(ObjectStore2& os, ToxAVI& av, Contact3Registry& cr, ToxContactModel2& tcm) : ToxAVVoIPModel::ToxAVVoIPModel(ObjectStore2& os, ToxAVI& av, Contact3Registry& cr, ToxContactModel2& tcm) :
_os(os), _av(av), _cr(cr), _tcm(tcm) _os(os), _av(av), _av_sr(_av.newSubRef(this)), _cr(cr), _tcm(tcm)
{ {
_av.subscribe(this, ToxAV_Event::friend_call); _av_sr
_av.subscribe(this, ToxAV_Event::friend_call_state); .subscribe(ToxAV_Event::friend_call)
_av.subscribe(this, ToxAV_Event::friend_audio_bitrate); .subscribe(ToxAV_Event::friend_call_state)
_av.subscribe(this, ToxAV_Event::friend_video_bitrate); .subscribe(ToxAV_Event::friend_audio_bitrate)
_av.subscribe(this, ToxAV_Event::friend_audio_frame); .subscribe(ToxAV_Event::friend_video_bitrate)
_av.subscribe(this, ToxAV_Event::friend_video_frame); .subscribe(ToxAV_Event::friend_audio_frame)
_av.subscribe(this, ToxAV_Event::iterate_audio); .subscribe(ToxAV_Event::friend_video_frame)
_av.subscribe(this, ToxAV_Event::iterate_video); .subscribe(ToxAV_Event::iterate_audio)
.subscribe(ToxAV_Event::iterate_video)
;
// attach to all tox friend contacts // attach to all tox friend contacts

View File

@ -18,6 +18,7 @@ struct ToxAVCallVideoSink;
class ToxAVVoIPModel : protected ToxAVEventI, public VoIPModelI { class ToxAVVoIPModel : protected ToxAVEventI, public VoIPModelI {
ObjectStore2& _os; ObjectStore2& _os;
ToxAVI& _av; ToxAVI& _av;
ToxAVI::SubscriptionReference _av_sr;
Contact3Registry& _cr; Contact3Registry& _cr;
ToxContactModel2& _tcm; ToxContactModel2& _tcm;

View File

@ -33,9 +33,11 @@ ToxAvatarManager::ToxAvatarManager(
ObjectStore2& os, ObjectStore2& os,
Contact3Registry& cr, Contact3Registry& cr,
ConfigModelI& conf ConfigModelI& conf
) : /*_rmm(rmm)*/ _os(os), _cr(cr), _conf(conf) { ) : /*_rmm(rmm)*/ _os(os), _os_sr(_os.newSubRef(this)), _cr(cr), _conf(conf) {
_os.subscribe(this, ObjectStore_Event::object_construct); _os_sr
_os.subscribe(this, ObjectStore_Event::object_update); .subscribe(ObjectStore_Event::object_construct)
.subscribe(ObjectStore_Event::object_update)
;
if (!_conf.has_string("ToxAvatarManager", "save_path")) { if (!_conf.has_string("ToxAvatarManager", "save_path")) {
// or on linux: $HOME/.config/tox/avatars/ // or on linux: $HOME/.config/tox/avatars/

View File

@ -14,6 +14,7 @@ struct ToxKey;
class ToxAvatarManager : public ObjectStoreEventI { class ToxAvatarManager : public ObjectStoreEventI {
ObjectStore2& _os; ObjectStore2& _os;
ObjectStore2::SubscriptionReference _os_sr;
Contact3Registry& _cr; Contact3Registry& _cr;
ConfigModelI& _conf; ConfigModelI& _conf;

View File

@ -30,8 +30,8 @@ ToxFriendFauxOfflineMessaging::ToxFriendFauxOfflineMessaging(
ToxContactModel2& tcm, ToxContactModel2& tcm,
ToxI& t, ToxI& t,
ToxEventProviderI& tep ToxEventProviderI& tep
) : _cr(cr), _rmm(rmm), _tcm(tcm), _t(t), _tep(tep) { ) : _cr(cr), _rmm(rmm), _tcm(tcm), _t(t), _tep_sr(tep.newSubRef(this)) {
_tep.subscribe(this, Tox_Event_Type::TOX_EVENT_FRIEND_CONNECTION_STATUS); _tep_sr.subscribe(Tox_Event_Type::TOX_EVENT_FRIEND_CONNECTION_STATUS);
} }
float ToxFriendFauxOfflineMessaging::tick(float time_delta) { float ToxFriendFauxOfflineMessaging::tick(float time_delta) {

View File

@ -18,7 +18,7 @@ class ToxFriendFauxOfflineMessaging : public ToxEventI {
RegistryMessageModelI& _rmm; RegistryMessageModelI& _rmm;
ToxContactModel2& _tcm; ToxContactModel2& _tcm;
ToxI& _t; ToxI& _t;
ToxEventProviderI& _tep; ToxEventProviderI::SubscriptionReference _tep_sr;
float _interval_timer{0.f}; float _interval_timer{0.f};