Move qt_cam_copy_register to QtCamera
[harmattan/cameraplus] / lib / qtcamzoom.cpp
index 3411179..4eaa481 100644 (file)
@@ -1,7 +1,7 @@
 /*!
  * This file is part of CameraPlus.
  *
- * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -119,7 +119,15 @@ bool QtCamZoom::setValue(qreal zoom) {
 }
 
 qreal QtCamZoom::minimumValue() {
-  // TODO: hardcoded
+  if (!d_ptr->bin) {
+    return 1.0;
+  }
+
+  GParamSpec *pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(d_ptr->bin), "max-zoom");
+  if (pspec && G_IS_PARAM_SPEC_FLOAT(pspec)) {
+    return G_PARAM_SPEC_FLOAT(pspec)->minimum;
+  }
+
   return 1.0;
 }