X-Git-Url: http://cgit.sxemacs.org/?p=harmattan%2Fcameraplus;a=blobdiff_plain;f=qml%2Fdata.js;h=b3481ef6fcbd053c552a02b3ccacbe0767614426;hp=d1723ff2c079f537130e4e20b9faab12c78b58dd;hb=6d882ccfda5ef536140c82884feecf0ce4a905f5;hpb=8fda608e8809c2b5c1b0db2a10e6099b73759ce8 diff --git a/qml/data.js b/qml/data.js index d1723ff..b3481ef 100644 --- a/qml/data.js +++ b/qml/data.js @@ -3,7 +3,7 @@ /*! * This file is part of CameraPlus. * - * Copyright (C) 2012 Mohammed Sameer + * Copyright (C) 2012-2013 Mohammed Sameer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -77,6 +77,14 @@ var __vsm = [ "icon-m-camera-video-night-selected", "icon-m-camera-video-night"] ]; +var __flash = [ + [Flash.Auto,"icon-m-camera-flash-auto-selected", "icon-m-camera-flash-auto"], + [Flash.On, "icon-m-camera-flash-always-selected", "icon-m-camera-flash-always"], + [Flash.Off, "icon-m-camera-flash-off-selected", "icon-m-camera-flash-off"], + [Flash.RedEye, "icon-m-camera-flash-red-eye-selected", "icon-m-camera-flash-red-eye"] +]; + +// ISO var __iso = [ [0, "icon-m-camera-iso-auto"], [100, "icon-m-camera-iso-100"], @@ -85,6 +93,26 @@ var __iso = [ [800, "icon-m-camera-iso-800"] ]; +// Image resolutions +var __image = [ + ["3:2", "low", "icon-m-camera-resolution-3m"], + ["3:2", "medium", "icon-m-camera-resolution-6m"], + ["3:2", "high", "icon-m-camera-resolution-7m"], + ["4:3", "low", "icon-m-camera-resolution-3m"], + ["4:3", "medium", "icon-m-camera-resolution-6m"], + ["4:3", "high", "icon-m-camera-resolution-8m"], + ["16:9", "low", "icon-m-camera-resolution-3m"], + ["16:9", "medium", "icon-m-camera-resolution-6m"], + ["16:9", "high", "icon-m-camera-resolution-7m"] +]; + +// Video resolutions +var __video = [ + ["low", "icon-m-camera-video-low-resolution"], + ["medium", "icon-m-camera-video-fine-resolution"], + ["high", "icon-m-camera-video-high-resolution"], +]; + function filterData(val, data, item) { var x = 0; var i = data.length; @@ -144,13 +172,29 @@ function vsmName(sm) { } function isoIcon(value) { + return filterData(value, __iso, 1); +} + +function imageIcon(aspect, res) { var x = 0; - var len = __iso.length; + var len = __image.length; for (x = 0; x < len; x++) { - if (__iso[x][0] == value) { - return __iso[x][1]; + if (__image[x][0] == aspect && __image[x][1] == res) { + return __image[x][2]; } } return ""; } + +function videoIcon(res) { + return filterData(res, __video, 1); +} + +function flashIcon(val) { + return filterData(val, __flash, 2); +} + +function flashPressedIcon(val) { + return filterData(val, __flash, 1); +}