piggz / harbour-advanced-camera

GNU General Public License v2.0
16 stars 22 forks source link

Handle more than one rear camera #106

Closed zipotron closed 3 years ago

zipotron commented 3 years ago

Hello, I tested the app in a Xperia 10 II, phone that have 3 rear cameras with different lens. The app is just handling one of them, could be nice to have a button to switch between the rear cameras, as well already have a button for switch between front and rear camera... BTW, front camera is not working (with stock sailfish app is working). Thanks for the app!

spag commented 3 years ago

The cameraId has changed from a string (primary, secondary) to an integer, allowing to accommodate for devices with more than two cameras.

As a quick fix, replacing the following lines in /usr/share/harbour-advanced-camera/qml/pages/CameraUI.qml allows for all 4 cameras on the Xperia 10II to be used:

out:

settings.global.cameraId = settings.global.cameraId
=== "primary" ? "secondary" : "primary"

in:

if (parseInt(settings.global.cameraId) + 1 == settings.global.cameraCount) settings.global.cameraId = "0";
else settings.global.cameraId = parseInt(settings.global.cameraId) + 1;

This is just a bodge but it's probably enough to illustrate the concept.

llelectronics commented 3 years ago

See: https://github.com/piggz/harbour-advanced-camera/pull/107

piggz commented 3 years ago

Now implemented