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)
21const CParameterPlayer::TYPE CParameterPlayer::GetType()
const
26int CParameterPlayer::SetType(TYPE type)
35const QString CParameterPlayer::GetUrl()
const
40int CParameterPlayer::SetUrl(
const QString& szUrl)
49const int CParameterPlayer::GetCamera()
const
54int CParameterPlayer::SetCamera(
int nIndex)
56 if(m_nCamera == nIndex)
63const int CParameterPlayer::GetAudioInput()
const
68int CParameterPlayer::SetAudioInput(
int nIndex)
70 if(m_nAudioInput == nIndex)
72 m_nAudioInput = nIndex;
74 emit sigAudioInput(m_nAudioInput);
78const bool CParameterPlayer::GetEnableAudioInput()
const
80 return m_bEnableAudioInput;
83int CParameterPlayer::SetEnableAudioInput(
bool bEnable)
85 if(m_bEnableAudioInput == bEnable)
87 m_bEnableAudioInput = bEnable;
89 emit sigEnableAudioInput(m_bEnableAudioInput);
93const bool CParameterPlayer::GetAudioInputMuted()
const
95 return m_bAudioInputMuted;
98int CParameterPlayer::SetAudioInputMuted(
bool bMuted)
100 if(m_bAudioInputMuted == bMuted)
102 m_bAudioInputMuted = bMuted;
104 emit sigAudioInputMuted(m_bAudioInputMuted);
108const float CParameterPlayer::GetAudioInputVolume()
const
110 return m_fAudioInputVolume;
113int CParameterPlayer::SetAudioInputVolume(
float fVolume)
115 if(m_fAudioInputVolume == fVolume)
117 m_fAudioInputVolume = fVolume;
119 emit sigAudioInputVolume(m_fAudioInputVolume);
123const int CParameterPlayer::GetAudioOutput()
const
125 return m_nAudioOutput;
128int CParameterPlayer::SetAudioOutput(
int nIndex)
130 if(m_nAudioOutput == nIndex)
132 m_nAudioOutput = nIndex;
134 emit sigAudioOutput(m_nAudioOutput);
138const bool CParameterPlayer::GetEnableAudioOutput()
const
140 return m_bEnableAudioOutput;
143int CParameterPlayer::SetEnableAudioOutput(
bool bEnable)
145 if(m_bEnableAudioOutput == bEnable)
147 m_bEnableAudioOutput = bEnable;
149 emit sigEnableAudioOutput(bEnable);
153const bool CParameterPlayer::GetAudioOutputMuted()
const
155 return m_bAudioOutputMuted;
158int CParameterPlayer::SetAudioOutputMuted(
bool bMuted)
160 if(m_bAudioOutputMuted == bMuted)
162 m_bAudioOutputMuted = bMuted;
164 emit sigAudioOutputMuted(m_bAudioOutputMuted);
168const float CParameterPlayer::GetAudioOutputVolume()
const
170 return m_fAudioOutputVolume;
173int CParameterPlayer::SetAudioOutputVolume(
float fVolume)
175 if(m_fAudioOutputVolume == fVolume)
177 m_fAudioOutputVolume = fVolume;
179 emit sigAudioOutputVolume(m_fAudioOutputVolume);
183int CParameterPlayer::OnLoad(QSettings &set)
185 SetName(set.value(
"Name", GetName()).toString());
186 SetServerName(set.value(
"ServerName", GetServerName()).toString());
187 SetShowServerName(set.value(
"ShowServerName", GetShowServerName()).toBool());
189 set.beginGroup(
"Player");
190 SetType((TYPE)set.value(
"Type", (
int)GetType()).toInt());
191 SetUrl(set.value(
"Url", GetUrl()).toString());
192 SetCamera(set.value(
"Camera", GetCamera()).toInt());
194 SetSubtitle(set.value(
"Subtitle", GetSubtitle()).toBool());
196 set.beginGroup(
"Audio/Input");
197 SetAudioInput(set.value(
"Device", GetAudioInput()).toInt());
198 SetEnableAudioInput(set.value(
"Enable", GetEnableAudioInput()).toBool());
199 SetAudioInputMuted(set.value(
"Muted", GetAudioInputMuted()).toBool());
200 SetAudioInputVolume(set.value(
"Volume", GetAudioInputVolume()).toBool());
203 set.beginGroup(
"Audio/Output");
204 SetAudioOutput(set.value(
"Device", GetAudioOutput()).toInt());
205 SetEnableAudioOutput(set.value(
"Enable", GetEnableAudioOutput()).toBool());
206 SetAudioOutputMuted(set.value(
"Muted", GetAudioOutputMuted()).toBool());
207 SetAudioOutputVolume(set.value(
"Volume", GetAudioOutputVolume()).toFloat());
214int CParameterPlayer::OnSave(QSettings &set)
216 set.setValue(
"Name", GetName());
217 set.setValue(
"ServerName", GetServerName());
218 set.setValue(
"ShowServerName", GetShowServerName());
220 set.beginGroup(
"Player");
221 set.setValue(
"Type", (
int)GetType());
222 set.setValue(
"Url", GetUrl());
223 set.setValue(
"Camera", GetCamera());
224 set.setValue(
"Subtitle", GetSubtitle());
226 set.beginGroup(
"Audio/Input");
227 set.setValue(
"Device", GetAudioInput());
228 set.setValue(
"Enable", GetEnableAudioInput());
229 set.setValue(
"Muted", GetAudioInputMuted());
230 set.setValue(
"Volume", GetAudioInputVolume());
233 set.beginGroup(
"Audio/Output");
234 set.setValue(
"Device", GetAudioOutput());
235 set.setValue(
"Enable", GetEnableAudioOutput());
236 set.setValue(
"Muted", GetAudioOutputMuted());
237 set.setValue(
"Volume", GetAudioOutputVolume());
244const int CParameterPlayer::GetScreen()
const
249int CParameterPlayer::SetScreen(
int nIndex)
251 if(m_nScreen == nIndex)
258bool CParameterPlayer::GetSubtitle()
const
263void CParameterPlayer::SetSubtitle(
bool subtitle)
265 if(m_bSubtitle == subtitle)
267 m_bSubtitle = subtitle;
连接基础参数接口。包括基本参数(网络参数等)。 所有插件的连接参数都应从此类派生。
int SetModified(bool bModified=true)
在设置参数时,如果有修改,则调用。