From c2e720dfa8240899b170991016ba7193c59a45e6 Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Fri, 27 Jun 2014 01:17:10 +0200 Subject: [PATCH] Register AV callbacks --- core.cpp | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ core.h | 12 ++++++++++ 2 files changed, 79 insertions(+) diff --git a/core.cpp b/core.cpp index c385866d7..20e5d3bba 100644 --- a/core.cpp +++ b/core.cpp @@ -101,6 +101,18 @@ void Core::start() tox_callback_file_control(tox, onFileControlCallback, this); tox_callback_file_data(tox, onFileDataCallback, this); + toxav_register_callstate_callback(onAvInvite, av_OnInvite, this); + toxav_register_callstate_callback(onAvStart, av_OnStart, this); + toxav_register_callstate_callback(onAvCancel, av_OnCancel, this); + toxav_register_callstate_callback(onAvReject, av_OnReject, this); + toxav_register_callstate_callback(onAvEnd, av_OnEnd, this); + toxav_register_callstate_callback(onAvRinging, av_OnRinging, this); + toxav_register_callstate_callback(onAvStarting, av_OnStarting, this); + toxav_register_callstate_callback(onAvEnding, av_OnEnding, this); + toxav_register_callstate_callback(onAvError, av_OnError, this); + toxav_register_callstate_callback(onAvRequestTimeout, av_OnRequestTimeout, this); + toxav_register_callstate_callback(onAvPeerTimeout, av_OnPeerTimeout, this); + uint8_t friendAddress[TOX_FRIEND_ADDRESS_SIZE]; tox_get_address(tox, friendAddress); @@ -862,3 +874,58 @@ void Core::sendAllFileData(Core *core, ToxFile* file) emit core->fileTransferFinished(*file); removeFileFromQueue(true, file->friendId, file->fileNum); } + +void Core::onAvInvite(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV invite"; +} + +void Core::onAvStart(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV start"; +} + +void Core::onAvCancel(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV cancel"; +} + +void Core::onAvReject(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV reject"; +} + +void Core::onAvEnd(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV end"; +} + +void Core::onAvRinging(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV ringing"; +} + +void Core::onAvStarting(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV starting"; +} + +void Core::onAvEnding(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV ending"; +} + +void Core::onAvError(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV error"; +} + +void Core::onAvRequestTimeout(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV request timeout"; +} + +void Core::onAvPeerTimeout(int32_t call_index, void* toxav) +{ + qDebug() << "Core: AV peer timeout"; +} diff --git a/core.h b/core.h index 2ac62191c..c5dea9199 100644 --- a/core.h +++ b/core.h @@ -184,6 +184,18 @@ private: uint8_t control_type, uint8_t *data, uint16_t length, void *core); static void onFileDataCallback(Tox *tox, int32_t friendnumber, uint8_t filenumber, uint8_t *data, uint16_t length, void *userdata); + static void onAvInvite(int32_t call_index, void* toxav); + static void onAvStart(int32_t call_index, void* toxav); + static void onAvCancel(int32_t call_index, void* toxav); + static void onAvReject(int32_t call_index, void* toxav); + static void onAvEnd(int32_t call_index, void* toxav); + static void onAvRinging(int32_t call_index, void* toxav); + static void onAvStarting(int32_t call_index, void* toxav); + static void onAvEnding(int32_t call_index, void* toxav); + static void onAvError(int32_t call_index, void* toxav); + static void onAvRequestTimeout(int32_t call_index, void* toxav); + static void onAvPeerTimeout(int32_t call_index, void* toxav); + void checkConnection(); void onBootstrapTimer();