3#include "ParameterPlayer.h"
5CParameterPlayer::CParameterPlayer(QObject *parent)
10 , m_bEnableAudioInput(true)
11 , m_bAudioInputMuted(false)
12 , m_fAudioInputVolume(100)
14 , m_bEnableAudioOutput(true)
15 , m_bAudioOutputMuted(false)
16 , m_fAudioOutputVolume(100)
22const CParameterPlayer::TYPE CParameterPlayer::GetType()
const
27int CParameterPlayer::SetType(TYPE type)
36const QString CParameterPlayer::GetUrl()
const
41int CParameterPlayer::SetUrl(
const QString& szUrl)
50const int CParameterPlayer::GetCamera()
const
55int CParameterPlayer::SetCamera(
int nIndex)
57 if(m_nCamera == nIndex)
64const int CParameterPlayer::GetAudioInput()
const
69int CParameterPlayer::SetAudioInput(
int nIndex)
71 if(m_nAudioInput == nIndex)
73 m_nAudioInput = nIndex;
75 emit sigAudioInput(m_nAudioInput);
79const bool CParameterPlayer::GetEnableAudioInput()
const
81 return m_bEnableAudioInput;
84int CParameterPlayer::SetEnableAudioInput(
bool bEnable)
86 if(m_bEnableAudioInput == bEnable)
88 m_bEnableAudioInput = bEnable;
90 emit sigEnableAudioInput(m_bEnableAudioInput);
94const bool CParameterPlayer::GetAudioInputMuted()
const
96 return m_bAudioInputMuted;
99int CParameterPlayer::SetAudioInputMuted(
bool bMuted)
101 if(m_bAudioInputMuted == bMuted)
103 m_bAudioInputMuted = bMuted;
105 emit sigAudioInputMuted(m_bAudioInputMuted);
109const float CParameterPlayer::GetAudioInputVolume()
const
111 return m_fAudioInputVolume;
114int CParameterPlayer::SetAudioInputVolume(
float fVolume)
116 if(m_fAudioInputVolume == fVolume)
118 m_fAudioInputVolume = fVolume;
120 emit sigAudioInputVolume(m_fAudioInputVolume);
124const int CParameterPlayer::GetAudioOutput()
const
126 return m_nAudioOutput;
129int CParameterPlayer::SetAudioOutput(
int nIndex)
131 if(m_nAudioOutput == nIndex)
133 m_nAudioOutput = nIndex;
135 emit sigAudioOutput(m_nAudioOutput);
139const bool CParameterPlayer::GetEnableAudioOutput()
const
141 return m_bEnableAudioOutput;
144int CParameterPlayer::SetEnableAudioOutput(
bool bEnable)
146 if(m_bEnableAudioOutput == bEnable)
148 m_bEnableAudioOutput = bEnable;
150 emit sigEnableAudioOutput(bEnable);
154const bool CParameterPlayer::GetAudioOutputMuted()
const
156 return m_bAudioOutputMuted;
159int CParameterPlayer::SetAudioOutputMuted(
bool bMuted)
161 if(m_bAudioOutputMuted == bMuted)
163 m_bAudioOutputMuted = bMuted;
165 emit sigAudioOutputMuted(m_bAudioOutputMuted);
169const float CParameterPlayer::GetAudioOutputVolume()
const
171 return m_fAudioOutputVolume;
174int CParameterPlayer::SetAudioOutputVolume(
float fVolume)
176 if(m_fAudioOutputVolume == fVolume)
178 m_fAudioOutputVolume = fVolume;
180 emit sigAudioOutputVolume(m_fAudioOutputVolume);
184const int CParameterPlayer::GetHideToolBar()
const
186 return m_nHideToolBar;
189int CParameterPlayer::SetHideToolBar(
int nTime)
191 if(m_nHideToolBar == nTime)
192 return m_nHideToolBar;
193 int old = m_nHideToolBar;
194 m_nHideToolBar = nTime;
199int CParameterPlayer::OnLoad(QSettings &set)
201 SetName(set.value(
"Name", GetName()).toString());
202 SetServerName(set.value(
"ServerName", GetServerName()).toString());
203 SetShowServerName(set.value(
"ShowServerName", GetShowServerName()).toBool());
205 set.beginGroup(
"Player");
206 SetType((TYPE)set.value(
"Type", (
int)GetType()).toInt());
207 SetUrl(set.value(
"Url", GetUrl()).toString());
208 SetCamera(set.value(
"Camera", GetCamera()).toInt());
210 SetSubtitle(set.value(
"Subtitle", GetSubtitle()).toBool());
212 set.beginGroup(
"Audio/Input");
213 SetAudioInput(set.value(
"Device", GetAudioInput()).toInt());
214 SetEnableAudioInput(set.value(
"Enable", GetEnableAudioInput()).toBool());
215 SetAudioInputMuted(set.value(
"Muted", GetAudioInputMuted()).toBool());
216 SetAudioInputVolume(set.value(
"Volume", GetAudioInputVolume()).toBool());
219 set.beginGroup(
"Audio/Output");
220 SetAudioOutput(set.value(
"Device", GetAudioOutput()).toInt());
221 SetEnableAudioOutput(set.value(
"Enable", GetEnableAudioOutput()).toBool());
222 SetAudioOutputMuted(set.value(
"Muted", GetAudioOutputMuted()).toBool());
223 SetAudioOutputVolume(set.value(
"Volume", GetAudioOutputVolume()).toFloat());
226 SetHideToolBar(set.value(
"HideToolBar", GetHideToolBar()).toInt());
232int CParameterPlayer::OnSave(QSettings &set)
234 set.setValue(
"Name", GetName());
235 set.setValue(
"ServerName", GetServerName());
236 set.setValue(
"ShowServerName", GetShowServerName());
238 set.beginGroup(
"Player");
239 set.setValue(
"Type", (
int)GetType());
240 set.setValue(
"Url", GetUrl());
241 set.setValue(
"Camera", GetCamera());
242 set.setValue(
"Subtitle", GetSubtitle());
244 set.beginGroup(
"Audio/Input");
245 set.setValue(
"Device", GetAudioInput());
246 set.setValue(
"Enable", GetEnableAudioInput());
247 set.setValue(
"Muted", GetAudioInputMuted());
248 set.setValue(
"Volume", GetAudioInputVolume());
251 set.beginGroup(
"Audio/Output");
252 set.setValue(
"Device", GetAudioOutput());
253 set.setValue(
"Enable", GetEnableAudioOutput());
254 set.setValue(
"Muted", GetAudioOutputMuted());
255 set.setValue(
"Volume", GetAudioOutputVolume());
258 set.setValue(
"HideToolBar", GetHideToolBar());
264int CParameterPlayer::GetScreen()
const
269int CParameterPlayer::SetScreen(
int nIndex)
271 if(m_nScreen == nIndex)
278bool CParameterPlayer::GetSubtitle()
const
283void CParameterPlayer::SetSubtitle(
bool subtitle)
285 if(m_bSubtitle == subtitle)
287 m_bSubtitle = subtitle;
The interface of remote desktop base parameters.
int SetModified(bool bModified=true)
When setting parameters, if there is a modification, it is called.