1#include "ParameterICE.h"
3CParameterICE::CParameterICE(QObject *parent)
9 m_nStunPort = m_nTurnPort = 3478;
12int CParameterICE::Load(QSettings &set)
16 m_szSignalServer = set.value(
"ICE/Signal/Server", m_szSignalServer).toString();
17 m_nSignalPort = set.value(
"ICE/Signal/Port", m_nSignalPort).toUInt();
18 m_szSignalUser = set.value(
"ICE/Signal/User", m_szSignalUser).toString();
19 m_szSignalPassword = set.value(
"ICE/Signal/Password", m_szSignalPassword).toString();
20 m_szStunServer = set.value(
"ICE/STUN/Server", m_szTurnServer).toString();
21 m_nStunPort = set.value(
"ICE/STUN/Port", m_nStunPort).toUInt();
22 m_szTurnServer = set.value(
"ICE/TURN/Server", m_szTurnServer).toString();
23 m_nTurnPort = set.value(
"ICE/TURN/Port", m_nTurnPort).toUInt();
24 m_szTurnUser = set.value(
"ICE/TURN/User", m_szTurnUser).toString();
25 m_szTurnPassword = set.value(
"ICE/TURN/Password", m_szTurnPassword).toString();
27 setIce(set.value(
"ICE/Enable", m_bIce).toBool());
28 SetIceDebug(set.value(
"ICE/Enable/Debug", GetIceDebug()).toBool());
32int CParameterICE::Save(QSettings &set)
35 set.setValue(
"ICE/Signal/Server", m_szSignalServer);
36 set.setValue(
"ICE/Signal/Port", m_nSignalPort);
37 set.setValue(
"ICE/Signal/User", m_szSignalUser);
38 set.setValue(
"ICE/Signal/Password", m_szSignalPassword);
39 set.setValue(
"ICE/STUN/Server", m_szStunServer);
40 set.setValue(
"ICE/STUN/Port", m_nStunPort);
41 set.setValue(
"ICE/TURN/Server", m_szTurnServer);
42 set.setValue(
"ICE/TURN/Port", m_nTurnPort);
43 set.setValue(
"ICE/TURN/User", m_szTurnUser);
44 set.setValue(
"ICE/TURN/Password", m_szTurnPassword);
45 set.setValue(
"ICE/Enable", m_bIce);
46 set.setValue(
"ICE/Enable/Debug", GetIceDebug());
50bool CParameterICE::getIce()
const
55void CParameterICE::setIce(
bool newBIce)
57 if (m_bIce == newBIce)
63bool CParameterICE::GetIceDebug()
const
68void CParameterICE::SetIceDebug(
bool newIceDebug)
70 if(m_bIceDebug == newIceDebug)
72 m_bIceDebug = newIceDebug;
73 emit sigIceDebugChanged(m_bIceDebug);
76const QString &CParameterICE::getSignalServer()
const
78 return m_szSignalServer;
81void CParameterICE::setSignalServer(
const QString &newSzSignalServer)
83 if (m_szSignalServer == newSzSignalServer)
85 m_szSignalServer = newSzSignalServer;
86 emit sigSignalServerChanged();
89quint16 CParameterICE::getSignalPort()
const
94void CParameterICE::setSignalPort(quint16 newNSignalPort)
96 if (m_nSignalPort == newNSignalPort)
98 m_nSignalPort = newNSignalPort;
99 emit sigSignalPortChanged();
102const QString &CParameterICE::getSignalUser()
const
104 return m_szSignalUser;
107void CParameterICE::setSignalUser(
const QString &newSzSignalUser)
109 if (m_szSignalUser == newSzSignalUser)
111 m_szSignalUser = newSzSignalUser;
112 emit sigSignalUserChanged();
115const QString &CParameterICE::getSignalPassword()
const
117 return m_szSignalPassword;
120void CParameterICE::setSignalPassword(
const QString &newSzSignalPassword)
122 if (m_szSignalPassword == newSzSignalPassword)
124 m_szSignalPassword = newSzSignalPassword;
125 emit sigSignalPasswordChanged();
128const QString &CParameterICE::getStunServer()
const
130 return m_szStunServer;
133void CParameterICE::setStunServer(
const QString &newSzStunServer)
135 if (m_szStunServer == newSzStunServer)
137 m_szStunServer = newSzStunServer;
138 emit sigStunServerChanged();
141quint16 CParameterICE::getStunPort()
const
146void CParameterICE::setStunPort(quint16 newNStunPort)
148 if (m_nStunPort == newNStunPort)
150 m_nStunPort = newNStunPort;
151 emit sigStunPortChanged();
154const QString &CParameterICE::getTurnServer()
const
156 return m_szTurnServer;
159void CParameterICE::setTurnServer(
const QString &newSzTurnServer)
161 if (m_szTurnServer == newSzTurnServer)
163 m_szTurnServer = newSzTurnServer;
164 emit sigTurnServerChanged();
167quint16 CParameterICE::getTurnPort()
const
172void CParameterICE::setTurnPort(quint16 newNTurnPort)
174 if (m_nTurnPort == newNTurnPort)
176 m_nTurnPort = newNTurnPort;
177 emit sigTurnPortChanged();
180const QString &CParameterICE::getTurnUser()
const
185void CParameterICE::setTurnUser(
const QString &newSzTurnUser)
187 if (m_szTurnUser == newSzTurnUser)
189 m_szTurnUser = newSzTurnUser;
190 emit sigTurnUserChanged();
193const QString &CParameterICE::getTurnPassword()
const
195 return m_szTurnPassword;
198void CParameterICE::setTurnPassword(
const QString &newSzTurnPassword)
200 if (m_szTurnPassword == newSzTurnPassword)
202 m_szTurnPassword = newSzTurnPassword;
203 emit sigTurnPasswordChanged();