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)
20const CParameterPlayer::TYPE CParameterPlayer::GetType()
const
25int CParameterPlayer::SetType(TYPE type)
34const QString CParameterPlayer::GetUrl()
const
39int CParameterPlayer::SetUrl(
const QString& szUrl)
48const int CParameterPlayer::GetCamera()
const
53int CParameterPlayer::SetCamera(
int nIndex)
55 if(m_nCamera == nIndex)
62const int CParameterPlayer::GetAudioInput()
const
67int CParameterPlayer::SetAudioInput(
int nIndex)
69 if(m_nAudioInput == nIndex)
71 m_nAudioInput = nIndex;
73 emit sigAudioInput(m_nAudioInput);
77const bool CParameterPlayer::GetEnableAudioInput()
const
79 return m_bEnableAudioInput;
82int CParameterPlayer::SetEnableAudioInput(
bool bEnable)
84 if(m_bEnableAudioInput == bEnable)
86 m_bEnableAudioInput = bEnable;
88 emit sigEnableAudioInput(m_bEnableAudioInput);
92const bool CParameterPlayer::GetAudioInputMuted()
const
94 return m_bAudioInputMuted;
97int CParameterPlayer::SetAudioInputMuted(
bool bMuted)
99 if(m_bAudioInputMuted == bMuted)
101 m_bAudioInputMuted = bMuted;
103 emit sigAudioInputMuted(m_bAudioInputMuted);
107const float CParameterPlayer::GetAudioInputVolume()
const
109 return m_fAudioInputVolume;
112int CParameterPlayer::SetAudioInputVolume(
float fVolume)
114 if(m_fAudioInputVolume == fVolume)
116 m_fAudioInputVolume = fVolume;
118 emit sigAudioInputVolume(m_fAudioInputVolume);
122const int CParameterPlayer::GetAudioOutput()
const
124 return m_nAudioOutput;
127int CParameterPlayer::SetAudioOutput(
int nIndex)
129 if(m_nAudioOutput == nIndex)
131 m_nAudioOutput = nIndex;
133 emit sigAudioOutput(m_nAudioOutput);
137const bool CParameterPlayer::GetEnableAudioOutput()
const
139 return m_bEnableAudioOutput;
142int CParameterPlayer::SetEnableAudioOutput(
bool bEnable)
144 if(m_bEnableAudioOutput == bEnable)
146 m_bEnableAudioOutput = bEnable;
148 emit sigEnableAudioOutput(bEnable);
152const bool CParameterPlayer::GetAudioOutputMuted()
const
154 return m_bAudioOutputMuted;
157int CParameterPlayer::SetAudioOutputMuted(
bool bMuted)
159 if(m_bAudioOutputMuted == bMuted)
161 m_bAudioOutputMuted = bMuted;
163 emit sigAudioOutputMuted(m_bAudioOutputMuted);
167const float CParameterPlayer::GetAudioOutputVolume()
const
169 return m_fAudioOutputVolume;
172int CParameterPlayer::SetAudioOutputVolume(
float fVolume)
174 if(m_fAudioOutputVolume == fVolume)
176 m_fAudioOutputVolume = fVolume;
178 emit sigAudioOutputVolume(m_fAudioOutputVolume);
181int CParameterPlayer::OnLoad(QSettings &set)
183 set.beginGroup(
"Player");
184 SetType((TYPE)set.value(
"Type", (
int)GetType()).toInt());
185 SetUrl(set.value(
"Url", GetUrl()).toString());
186 SetCamera(set.value(
"Camera", GetCamera()).toInt());
188 set.beginGroup(
"Audio/Input");
189 SetAudioInput(set.value(
"Device", GetAudioInput()).toInt());
190 SetEnableAudioInput(set.value(
"Enable", GetEnableAudioInput()).toBool());
191 SetAudioInputMuted(set.value(
"Muted", GetAudioInputMuted()).toBool());
192 SetAudioInputVolume(set.value(
"Volume", GetAudioInputVolume()).toBool());
195 set.beginGroup(
"Audio/Output");
196 SetAudioOutput(set.value(
"Device", GetAudioOutput()).toInt());
197 SetEnableAudioOutput(set.value(
"Enable", GetEnableAudioOutput()).toBool());
198 SetAudioOutputMuted(set.value(
"Muted", GetAudioOutputMuted()).toBool());
199 SetAudioOutputVolume(set.value(
"Volume", GetAudioOutputVolume()).toFloat());
206int CParameterPlayer::OnSave(QSettings &set)
208 set.beginGroup(
"Player");
209 set.setValue(
"Type", (
int)GetType());
210 set.setValue(
"Url", GetUrl());
211 set.setValue(
"Camera", GetCamera());
213 set.beginGroup(
"Audio/Input");
214 set.setValue(
"Device", GetAudioInput());
215 set.setValue(
"Enable", GetEnableAudioInput());
216 set.setValue(
"Muted", GetAudioInputMuted());
217 set.setValue(
"Volume", GetAudioInputVolume());
220 set.beginGroup(
"Audio/Output");
221 set.setValue(
"Device", GetAudioOutput());
222 set.setValue(
"Enable", GetEnableAudioOutput());
223 set.setValue(
"Muted", GetAudioOutputMuted());
224 set.setValue(
"Volume", GetAudioOutputVolume());
231const int CParameterPlayer::GetScreen()
const
236int CParameterPlayer::SetScreen(
int nIndex)
238 if(m_nScreen == nIndex)
The interface of connecter parameters.
int SetModified(bool bModified=true)
When setting parameters, if there is a modification, it is called.