The QMediaRecorderControl class provides access to the recording functionality of a QMediaService . 更多...
| 頭: | #include <QMediaRecorderControl> |
| qmake: | QT += multimedia |
| 繼承: | QMediaControl |
該類已過時。 提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。
| virtual | ~QMediaRecorderControl () |
| virtual void | applySettings () = 0 |
| virtual qint64 | duration () const = 0 |
| virtual bool | isMuted () const = 0 |
| virtual QUrl | outputLocation () const = 0 |
| virtual bool | setOutputLocation (const QUrl & location ) = 0 |
| virtual QMediaRecorder::State | state () const = 0 |
| virtual QMediaRecorder::Status | status () const = 0 |
| virtual qreal | volume () const = 0 |
| virtual void | setMuted (bool muted ) = 0 |
| virtual void | setState (QMediaRecorder::State state ) = 0 |
| virtual void | setVolume (qreal volume ) = 0 |
| void | actualLocationChanged (const QUrl & location ) |
| void | durationChanged (qint64 duration ) |
| void | error (int error , const QString & errorString ) |
| void | mutedChanged (bool muted ) |
| void | stateChanged (QMediaRecorder::State state ) |
| void | statusChanged (QMediaRecorder::Status status ) |
| void | volumeChanged (qreal gain ) |
| QMediaRecorderControl (QObject * parent = nullptr) |
| QMediaRecorderControl_iid |
Generally you will use the QMediaRecorder class in application code - this class is mostly used when implementing a new QMediaService or if there is access to specific low level functionality not otherwise present in QMediaRecorder .
若 QMediaService can record media it will implement QMediaRecorderControl. This control provides a means to set the output location , and record, pause and stop recording via the setState () method. It also provides feedback on the duration of the recording.
The interface name of QMediaRecorderControl is
org.qt-project.qt.mediarecordercontrol/5.0
作為定義在
QMediaRecorderControl_iid
.
另請參閱 QMediaService::requestControl () 和 QMediaRecorder .
[protected]
QMediaRecorderControl::
QMediaRecorderControl
(
QObject
*
parent
= nullptr)
Constructs a media recorder control with the given parent .
[signal]
void
QMediaRecorderControl::
actualLocationChanged
(const
QUrl
&
location
)
Signals that the actual media location has changed. This signal should be emitted at start of recording.
[signal]
void
QMediaRecorderControl::
durationChanged
(
qint64
duration
)
發射信號,當 duration of the recorded media has changed.
This only emitted when there is a discontinuous change in the duration such as being reset to 0.
[signal]
void
QMediaRecorderControl::
error
(
int
error
, const
QString
&
errorString
)
發射信號,當 error 齣現。 errorString describes the error.
[signal]
void
QMediaRecorderControl::
mutedChanged
(
bool
muted
)
發射信號,當 muted state of a media recorder has changed.
[pure virtual slot]
void
QMediaRecorderControl::
setMuted
(
bool
muted
)
設置 muted state of a media recorder.
另請參閱 isMuted ().
[pure virtual slot]
void
QMediaRecorderControl::
setState
(
QMediaRecorder::State
state
)
Set the media recorder state .
另請參閱 state ().
[pure virtual slot]
void
QMediaRecorderControl::
setVolume
(
qreal
volume
)
設置音頻 volume of a media recorder control.
The volume is scaled linearly, ranging from
0
(無聲) 到
100
(full volume).
另請參閱 volume ().
[signal]
void
QMediaRecorderControl::
stateChanged
(
QMediaRecorder::State
state
)
發射信號,當 state of a media recorder has changed.
[signal]
void
QMediaRecorderControl::
statusChanged
(
QMediaRecorder::Status
status
)
發射信號,當 status of a media recorder has changed.
[signal]
void
QMediaRecorderControl::
volumeChanged
(
qreal
gain
)
發射信號,當音頻 gain value has changed.
[虛擬]
QMediaRecorderControl::
~QMediaRecorderControl
()
Destroys a media recorder control.
[pure virtual]
void
QMediaRecorderControl::
applySettings
()
Commits the encoder settings and performs pre-initialization to reduce delays when recording is started.
[pure virtual]
qint64
QMediaRecorderControl::
duration
() const
Return the current duration in milliseconds.
[pure virtual]
bool
QMediaRecorderControl::
isMuted
() const
Returns true if the recorder is muted, and false if it is not.
[pure virtual]
QUrl
QMediaRecorderControl::
outputLocation
() const
Returns the current output location being used.
另請參閱 setOutputLocation ().
[pure virtual]
bool
QMediaRecorderControl::
setOutputLocation
(const
QUrl
&
location
)
Sets the output location and returns if this operation is successful. If file at the output location already exists, it should be overwritten.
The location can be relative or empty; in this case the service should use the system specific place and file naming scheme.
After recording has started, the backend should report the actual file location with actualLocationChanged () 信號。
另請參閱 outputLocation ().
[pure virtual]
QMediaRecorder::State
QMediaRecorderControl::
state
() const
Return the current recording state.
另請參閱 setState ().
[pure virtual]
QMediaRecorder::Status
QMediaRecorderControl::
status
() const
Return the current recording status.
[pure virtual]
qreal
QMediaRecorderControl::
volume
() const
Returns the audio volume of a media recorder control.
另請參閱 setVolume ().
org.qt-project.qt.mediarecordercontrol/5.0
定義接口名為 QMediaRecorderControl 類。