- src/call/: сигналинг (call.c, call_proto.h, ETCP_RT_ID_CALL 0x36) + релей медиа + headless аудио-сокет (call_headless.c, call_audio_bind) + Opus/jitter/тоны - chat: события CHAT_EVT_CALL_* (34–40), CHAT_EVT_DM_MESSAGES (41), DM-трамплины - chatgui: call window, miniaudio I/O, audio_frame_ring, test_audio_jitter - chatgui-android: CallScreen/IncomingCallDialog, аудио-роутинг, JNI, рингтон - tests: test_call, test_call_headless
56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
#ifndef MEMBERLISTMODEL_H
|
|
#define MEMBERLISTMODEL_H
|
|
|
|
#include <QAbstractListModel>
|
|
#include <QColor>
|
|
#include <QMap>
|
|
#include <QString>
|
|
#include <QIcon>
|
|
#include <QPixmap>
|
|
#include <QTimer>
|
|
#include <stdint.h>
|
|
|
|
struct MemberListItem {
|
|
quint64 nodeId = 0;
|
|
bool online = false;
|
|
bool isSelf = false;
|
|
QPixmap avatar;
|
|
QString name;
|
|
int rtt = -1;
|
|
int natType = -1;
|
|
uint8_t flags = 0;
|
|
uint8_t storage = 0;
|
|
};
|
|
|
|
class MemberListModel : public QAbstractListModel {
|
|
Q_OBJECT
|
|
public:
|
|
explicit MemberListModel(QObject* parent = nullptr);
|
|
|
|
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
|
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
|
|
|
void setChannel(const QString& channelId, bool isOwner);
|
|
void refresh();
|
|
void refreshRtt();
|
|
quint64 nodeIdAt(int row) const;
|
|
bool isOnlineAt(int row) const;
|
|
|
|
/* Called from bridge callbacks (GUI thread) */
|
|
void onMemberList(const QString& chId, int count, const uint8_t* data, int dataLen);
|
|
void onMemberUpdated(const QString& chId, const uint8_t* data);
|
|
void onMemberRemoved(const QString& chId, uint64_t nodeId);
|
|
|
|
private:
|
|
void loadBatch(int from, int count);
|
|
QPixmap makeAvatar(QColor color, QChar letter) const;
|
|
|
|
QString m_channelId;
|
|
bool m_isOwner = false;
|
|
int m_totalCount = 0;
|
|
mutable QMap<int, MemberListItem> m_cache;
|
|
QTimer* m_rttTimer;
|
|
};
|
|
|
|
#endif
|