2015-10-05 08:36:50 +08:00
|
|
|
#ifndef TOXCALL_H
|
|
|
|
#define TOXCALL_H
|
|
|
|
|
|
|
|
#include <cstdint>
|
2015-11-29 19:12:02 +08:00
|
|
|
#include <QtGlobal>
|
2016-01-22 03:17:18 +08:00
|
|
|
#include <QMetaObject>
|
2015-11-29 19:12:02 +08:00
|
|
|
|
2015-10-05 08:36:50 +08:00
|
|
|
#include "src/core/indexedlist.h"
|
|
|
|
|
|
|
|
#include <tox/toxav.h>
|
|
|
|
|
|
|
|
class QTimer;
|
|
|
|
class AudioFilterer;
|
|
|
|
class CoreVideoSource;
|
|
|
|
class CoreAV;
|
|
|
|
|
|
|
|
struct ToxCall
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
ToxCall() = default;
|
2016-04-19 17:56:21 +08:00
|
|
|
explicit ToxCall(uint32_t CallId);
|
2015-10-05 08:36:50 +08:00
|
|
|
~ToxCall();
|
|
|
|
public:
|
|
|
|
ToxCall(const ToxCall& other) = delete;
|
|
|
|
ToxCall(ToxCall&& other) noexcept;
|
|
|
|
|
|
|
|
inline operator int() {return callId;}
|
2016-07-01 07:23:31 +08:00
|
|
|
ToxCall& operator=(const ToxCall& other) = delete;
|
|
|
|
ToxCall& operator=(ToxCall&& other) noexcept;
|
2015-10-05 08:36:50 +08:00
|
|
|
|
|
|
|
protected:
|
2016-01-22 03:17:18 +08:00
|
|
|
QMetaObject::Connection audioInConn;
|
2015-10-05 08:36:50 +08:00
|
|
|
|
|
|
|
public:
|
2016-07-27 06:21:22 +08:00
|
|
|
uint32_t callId;
|
2016-01-22 03:17:18 +08:00
|
|
|
quint32 alSource;
|
2016-07-27 06:21:22 +08:00
|
|
|
bool inactive;
|
2015-10-05 08:36:50 +08:00
|
|
|
bool muteMic;
|
|
|
|
bool muteVol;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ToxFriendCall : public ToxCall
|
|
|
|
{
|
|
|
|
ToxFriendCall() = default;
|
|
|
|
ToxFriendCall(uint32_t FriendNum, bool VideoEnabled, CoreAV& av);
|
|
|
|
ToxFriendCall(ToxFriendCall&& other) noexcept;
|
|
|
|
~ToxFriendCall();
|
|
|
|
|
2016-07-01 07:23:31 +08:00
|
|
|
ToxFriendCall& operator=(ToxFriendCall&& other) noexcept;
|
2015-10-05 08:36:50 +08:00
|
|
|
|
2016-07-27 06:21:22 +08:00
|
|
|
bool videoEnabled;
|
|
|
|
bool nullVideoBitrate;
|
2015-10-05 08:36:50 +08:00
|
|
|
CoreVideoSource* videoSource;
|
2016-07-27 06:21:22 +08:00
|
|
|
TOXAV_FRIEND_CALL_STATE state;
|
2015-10-24 07:53:10 +08:00
|
|
|
|
|
|
|
void startTimeout();
|
|
|
|
void stopTimeout();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
CoreAV* av;
|
|
|
|
QTimer* timeoutTimer;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static constexpr int CALL_TIMEOUT = 45000;
|
2015-10-05 08:36:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ToxGroupCall : public ToxCall
|
|
|
|
{
|
|
|
|
ToxGroupCall() = default;
|
|
|
|
ToxGroupCall(int GroupNum, CoreAV& av);
|
|
|
|
ToxGroupCall(ToxGroupCall&& other) noexcept;
|
|
|
|
|
2016-07-01 07:23:31 +08:00
|
|
|
ToxGroupCall& operator=(ToxGroupCall&& other) noexcept;
|
2015-10-05 08:36:50 +08:00
|
|
|
|
|
|
|
// If you add something here, don't forget to override the ctors and move operators!
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TOXCALL_H
|
|
|
|
|