3 #ifndef QT_CAM_CAPABILITY_P_H
4 #define QT_CAM_CAPABILITY_P_H
7 #include "qtcamdevice.h"
8 #include "qtcamdevice_p.h"
10 class QtCamCapabilityPrivate {
12 QtCamCapabilityPrivate(QtCamDevice *d, const QtCamCapability::Capability& c, const QString& p) :
23 QtCamCapabilityPrivate(QtCamDevice *d, const QtCamCapability::Capability& c) :
33 virtual ~QtCamCapabilityPrivate() {
37 void startMonitoring() {
39 QString p = QString("notify::%1").arg(prop);
40 handler = g_signal_connect(src, p.toAscii().data(), G_CALLBACK(camera_src_notify), this);
44 void stopMonitoring() {
46 g_signal_handler_disconnect(src, handler);
50 bool intValue(int *val) {
55 g_object_get(src, prop.toAscii().data(), val, NULL);
60 bool setIntValue(int val) {
73 g_object_set(src, prop.toAscii().data(), val, NULL);
78 bool floatValue(qreal *val) {
83 g_object_get(src, prop.toAscii().data(), val, NULL);
88 bool setFloatValue(qreal val) {
97 if (qFuzzyCompare(old, val)) {
101 g_object_set(src, prop.toAscii().data(), val, NULL);
106 static void camera_src_notify(GObject *gobject, GParamSpec *pspec, QtCamCapabilityPrivate *d) {
110 QMetaObject::invokeMethod(d->q_ptr, "valueChanged", Qt::QueuedConnection);
114 QtCamCapability::Capability cap;
119 QtCamCapability *q_ptr;
122 #endif /* QT_CAM_CAPABILITY_P_H */