maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Camera Events (https://talk.maemo.org/showthread.php?t=54993)

Dak 2010-06-03 02:39

Camera Events
 
How can I hook into the same event that the Camera app uses - when you slide the shutter open it launches the app. I would like to open a popup window when the shutter is opened, and close it when the shutter is subsequently closed.

I could poll the same file the Healthcheck app uses (/sys/devices/platform/gpio-switch/cam_shutter/state), but this is not really satisfactory for my purposes.

I would also like to temporarily disable the Camera app from launching while my app is running...

...is there any DBus hackery I can use?

noobmonkey 2010-06-03 08:08

Re: Camera Events
 
Quote:

Originally Posted by Dak (Post 696992)
How can I hook into the same event that the Camera app uses - when you slide the shutter open it launches the app. I would like to open a popup window when the shutter is opened, and close it when the shutter is subsequently closed.

I could poll the same file the Healthcheck app uses (/sys/devices/platform/gpio-switch/cam_shutter/state), but this is not really satisfactory for my purposes.

I would also like to temporarily disable the Camera app from launching while my app is running...

...is there any DBus hackery I can use?

i'd suggest either looking at the code of the lens shutter app or asking the coder :)
Seems like he's almost done what you need in a way :)
http://maemo.org/packages/view/lens-cover-reminder-sp/

zolakt 2010-06-03 09:28

Re: Camera Events
 
You can disable the camera app with:
dsmetool -k /usr/bin/camera-ui

And turn it back on with:
dsmetool -t /usr/bin/camera-ui

This doesn't actually disable it. It disables starting the camera app on lens open event. You can call the camera app manually through DBUS if you want.

If you are working with Qt you can override your form close event, to turn camera app back on, when you are done with your app. Don't know about GTK, but it should be pretty similar.

hqh 2010-06-03 09:30

Re: Camera Events
 
The lens cover event is available through HAL, see the sources of shortcutd.


All times are GMT. The time now is 04:14.

vBulletin® Version 3.8.8