QCameraFeedbackControl Class
The QCameraFeedbackControl class allows controlling feedback (sounds etc) during camera operation 更多...
头文件: | #include <QCameraFeedbackControl> |
qmake: | QT += multimedia |
开始支持版本: | Qt 5.0 |
基类: | QMediaControl |
公有类型
enum | EventType { ViewfinderStarted, ViewfinderStopped, ImageCaptured, ImageSaved, ..., AutoFocusFailed } |
公有函数
~QCameraFeedbackControl() | |
virtual bool | isEventFeedbackEnabled(EventType event) const = 0 |
virtual bool | isEventFeedbackLocked(EventType event) const = 0 |
virtual void | resetEventFeedback(EventType event) = 0 |
virtual bool | setEventFeedbackEnabled(EventType event, bool enabled) = 0 |
virtual bool | setEventFeedbackSound(EventType event, const QString &filePath) = 0 |
- 32 个公有函数继承自 QObject
受保护的函数
QCameraFeedbackControl(QObject *parent = Q_NULLPTR) |
- 9 个受保护的函数继承自 QObject
Macros
其他继承的成员
- 1 个属性继承自 QObject
- 1 个公有槽函数继承自 QObject
- 2 个信号继承自 QObject
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
The QCameraFeedbackControl class allows controlling feedback (sounds etc) during camera operation
When using a camera, there are several times when some form of feedback to the user is given - for example, when an image is taken, or when recording is started. You can enable or disable some of this feedback, or adjust what sound might be played for these actions.
In some cases it may be undesirable to play a sound effect - for example, when initiating video recording the sound itself may be recorded.
Note: In some countries or regions, feedback sounds or other indications (e.g. a red light) are mandatory during camera operation. In these cases, you can check isEventFeedbackLocked
to check if that type of feedback can be modified. Any attempts to change a locked feedback type will be ignored.
The interface name of QCameraFeedbackControl is org.qt-project.qt.camerafeedbackcontrol/5.0
as defined in QCameraFeedbackControl_iid.
参见 QCamera.
成员类型
enum QCameraFeedbackControl::EventType
This enumeration describes certain events that occur during camera usage. You can associate some form of feedback to be given when the event occurs, or check whether feedback for this event is enabled or locked so that changes cannot be made.
Constant | Value | Description |
---|---|---|
QCameraFeedbackControl::ViewfinderStarted | 1 | The viewfinder stream was started (even if not visible) |
QCameraFeedbackControl::ViewfinderStopped | 2 | The viewfinder stream was stopped |
QCameraFeedbackControl::ImageCaptured | 3 | An image was captured but not yet fully processed |
QCameraFeedbackControl::ImageSaved | 4 | An image is fully available and saved somewhere. |
QCameraFeedbackControl::ImageError | 5 | An error occurred while capturing an image |
QCameraFeedbackControl::RecordingStarted | 6 | Video recording has started |
QCameraFeedbackControl::RecordingInProgress | 7 | Video recording is in progress |
QCameraFeedbackControl::RecordingStopped | 8 | Video recording has stopped |
QCameraFeedbackControl::AutoFocusInProgress | 9 | The camera is trying to automatically focus |
QCameraFeedbackControl::AutoFocusLocked | 10 | The camera has automatically focused successfully |
QCameraFeedbackControl::AutoFocusFailed | 11 | The camera was unable to focus automatically |
成员函数
[protected]
QCameraFeedbackControl::QCameraFeedbackControl(QObject *parent = Q_NULLPTR)
Constructs a camera feedback control object with parent.
QCameraFeedbackControl::~QCameraFeedbackControl()
Destroys the camera feedback control object.
[pure virtual]
bool QCameraFeedbackControl::isEventFeedbackEnabled(EventType event) const
Returns true if the feedback for event is enabled.
This function was introduced in Qt 5.0.
[pure virtual]
bool QCameraFeedbackControl::isEventFeedbackLocked(EventType event) const
Returns true if the feedback setting for event is locked. This may be true because of legal compliance issues, or because configurability of this event's feedback is not supported.
This function was introduced in Qt 5.0.
[pure virtual]
void QCameraFeedbackControl::resetEventFeedback(EventType event)
Restores the feedback setting for this event to its default setting.
This function was introduced in Qt 5.0.
[pure virtual]
bool QCameraFeedbackControl::setEventFeedbackEnabled(EventType event, bool enabled)
Turns on feedback for the specific event if enabled is true, otherwise disables the feedback. Returns true if the feedback could be modified, or false otherwise (e.g. this feedback type is locked).
This function was introduced in Qt 5.0.
参见 isEventFeedbackEnabled().
[pure virtual]
bool QCameraFeedbackControl::setEventFeedbackSound(EventType event, const QString &filePath)
When the given event occurs, the sound effect referenced by filePath will be played instead of the default sound.
If this feedback type is locked, or if the supplied path is inaccessible, this function will return false. In addition, some forms of feedback may be non-auditory (e.g. a red light, or a vibration), and false may be returned in this case.
The file referenced should be linear PCM (WAV format).
Note: In the case that a valid file path to an unsupported file is given, this function will return true but the feedback will use the original setting.
This function was introduced in Qt 5.0.
宏
QCameraFeedbackControl_iid
org.qt-project.qt.camerafeedbackcontrol/5.0
Defines the interface name of the QCameraFeedbackControl class.