-
Notifications
You must be signed in to change notification settings - Fork 0
/
uvoipdata.cpp
93 lines (75 loc) · 1.6 KB
/
uvoipdata.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include "uvoipdata.h"
#include <QDebug>
UVoipData::UVoipData(QDeclarativeItem *parent)
: QDeclarativeItem(parent)
, m_hostMicLevel(0)
, m_remoteMicLevel(0)
, m_socketUrl()
, m_clientConnected(false)
, m_serverConnected(false)
{
}
qreal UVoipData::hostMicrophoneLevel()
{
return m_hostMicLevel;
}
void UVoipData::setHostMicrophoneLevel(qreal level)
{
m_hostMicLevel = level;
emit hostMicrophoneLevelChanged();
}
qreal UVoipData::remoteMicrophoneLevel()
{
return m_remoteMicLevel;
}
const QString &UVoipData::socketUrl()
{
return m_socketUrl;
}
void UVoipData::requestConnect()
{
emit requestConnectChanged();
}
void UVoipData::requestDisconnect()
{
emit requestDisconnectChanged();
}
bool UVoipData::clientConnected()
{
return m_clientConnected;
}
bool UVoipData::serverConnected()
{
return m_serverConnected;
}
void UVoipData::setRemoteMicrophoneLevel(qreal level)
{
m_remoteMicLevel = level;
emit remoteMicrophoneLevelChanged();
}
void UVoipData::setSocketUrl(const QString &url)
{
qDebug() << "Socket url received:" << url;
m_socketUrl = url;
emit socketUrlChanged();
}
void UVoipData::setClientConnected(bool isConnected)
{
if(m_clientConnected != isConnected)
{
m_clientConnected = isConnected;
emit clientConnectedChanged();
}
}
void UVoipData::setServerConnected(bool isConnected)
{
if(m_serverConnected != isConnected)
{
m_serverConnected = isConnected;
emit serverConnectedChanged();
}
}
void UVoipData::emitClientConnectionFailed()
{
emit clientConnectionFailedChanged();
}