1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or (at your option) the GNU General
28** Public license version 3 or any later version approved by the KDE Free
29** Qt Foundation. The licenses are as published by the Free Software
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31** included in the packaging of this file. Please review the following
32** information to ensure the GNU General Public License requirements will
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34** https://www.gnu.org/licenses/gpl-3.0.html.
35**
36** $QT_END_LICENSE$
37**
38****************************************************************************/
39
40#include "qmediarecordercontrol.h"
41
42QT_BEGIN_NAMESPACE
43
44
45/*!
46 \class QMediaRecorderControl
47 \inmodule QtMultimedia
48
49
50 \ingroup multimedia_control
51
52 \brief The QMediaRecorderControl class provides access to the recording
53 functionality of a QMediaService.
54
55 Generally you will use the QMediaRecorder class in application code - this
56 class is mostly used when implementing a new QMediaService or if there is
57 access to specific low level functionality not otherwise present in QMediaRecorder.
58
59 If a QMediaService can record media it will implement QMediaRecorderControl.
60 This control provides a means to set the \l {outputLocation()}{output location},
61 and record, pause and stop recording via the \l setState() method. It also
62 provides feedback on the \l {duration()}{duration} of the recording.
63
64 The interface name of QMediaRecorderControl is \c org.qt-project.qt.mediarecordercontrol/5.0 as
65 defined in QMediaRecorderControl_iid.
66
67 \sa QMediaService::requestControl(), QMediaRecorder
68
69*/
70
71/*!
72 \macro QMediaRecorderControl_iid
73
74 \c org.qt-project.qt.mediarecordercontrol/5.0
75
76 Defines the interface name of the QMediaRecorderControl class.
77
78 \relates QMediaRecorderControl
79*/
80
81/*!
82 Constructs a media recorder control with the given \a parent.
83*/
84
85QMediaRecorderControl::QMediaRecorderControl(QObject* parent)
86 : QMediaControl(parent)
87{
88}
89
90/*!
91 Destroys a media recorder control.
92*/
93
94QMediaRecorderControl::~QMediaRecorderControl()
95{
96}
97
98/*!
99 \fn QUrl QMediaRecorderControl::outputLocation() const
100
101 Returns the current output location being used.
102*/
103
104/*!
105 \fn bool QMediaRecorderControl::setOutputLocation(const QUrl &location)
106
107 Sets the output \a location and returns if this operation is successful.
108 If file at the output location already exists, it should be overwritten.
109
110 The \a location can be relative or empty;
111 in this case the service should use the system specific place and file naming scheme.
112
113 After recording has started, the backend should report the actual file location
114 with actualLocationChanged() signal.
115*/
116
117/*!
118 \fn QMediaRecorder::State QMediaRecorderControl::state() const
119
120 Return the current recording state.
121*/
122
123/*!
124 \fn QMediaRecorder::Status QMediaRecorderControl::status() const
125
126 Return the current recording status.
127*/
128
129/*!
130 \fn qint64 QMediaRecorderControl::duration() const
131
132 Return the current duration in milliseconds.
133*/
134
135/*!
136 \fn void QMediaRecorderControl::setState(QMediaRecorder::State state)
137
138 Set the media recorder \a state.
139*/
140
141/*!
142 \fn void QMediaRecorderControl::applySettings()
143
144 Commits the encoder settings and performs pre-initialization to reduce delays when recording
145 is started.
146*/
147
148/*!
149 \fn bool QMediaRecorderControl::isMuted() const
150
151 Returns true if the recorder is muted, and false if it is not.
152*/
153
154/*!
155 \fn void QMediaRecorderControl::setMuted(bool muted)
156
157 Sets the \a muted state of a media recorder.
158*/
159
160/*!
161 \fn qreal QMediaRecorderControl::volume() const
162
163 Returns the audio volume of a media recorder control.
164*/
165
166/*!
167 \fn void QMediaRecorderControl::setVolume(qreal volume)
168
169 Sets the audio \a volume of a media recorder control.
170
171 The volume is scaled linearly, ranging from \c 0 (silence) to \c 100 (full volume).
172*/
173
174/*!
175 \fn void QMediaRecorderControl::stateChanged(QMediaRecorder::State state)
176
177 Signals that the \a state of a media recorder has changed.
178*/
179
180/*!
181 \fn void QMediaRecorderControl::statusChanged(QMediaRecorder::Status status)
182
183 Signals that the \a status of a media recorder has changed.
184*/
185
186
187/*!
188 \fn void QMediaRecorderControl::durationChanged(qint64 duration)
189
190 Signals that the \a duration of the recorded media has changed.
191
192 This only emitted when there is a discontinuous change in the duration such as being reset to 0.
193*/
194
195/*!
196 \fn void QMediaRecorderControl::mutedChanged(bool muted)
197
198 Signals that the \a muted state of a media recorder has changed.
199*/
200
201/*!
202 \fn void QMediaRecorderControl::volumeChanged(qreal gain)
203
204 Signals that the audio \a gain value has changed.
205*/
206
207/*!
208 \fn void QMediaRecorderControl::actualLocationChanged(const QUrl &location)
209
210 Signals that the actual media \a location has changed.
211 This signal should be emitted at start of recording.
212*/
213
214/*!
215 \fn void QMediaRecorderControl::error(int error, const QString &errorString)
216
217 Signals that an \a error has occurred. The \a errorString describes the error.
218*/
219
220#include "moc_qmediarecordercontrol.cpp"
221QT_END_NAMESPACE
222
223