Here's how I did it in Python, took some testing.
https://www.guardiani.us/projects/kagu/changeset/670
The SVN Kagu now pauses playback if the headphones are disconnected.
On 10/18/07, Austin Che <[EMAIL PROTECTED]> wrote:
>
> > g_io_add_watch() if you're using glib, inotify if you're not (man
> > inotify(7)).
> >
> > Regards: David
>
> Thanks for the suggestion but I can't get this to work. If I use:
> GIOChannel *io =
> g_io_channel_new_file("/sys/devices/platform/gpio-switch/headphone/state",
> "r", NULL);
> g_io_add_watch(io, G_IO_IN|G_IO_OUT|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
> test_io_watch, NULL);
>
> and I print out the GIOCondition in test_io_watch, I get a
> constant stream (number 10) with nothing extra seen when the headphone
> is plugged in or out. Using individual conditions leads to either
> the function never being triggered or always being triggered. What
> should I be watching for?
> _______________________________________________
> maemo-developers mailing list
> [email protected]
> https://lists.maemo.org/mailman/listinfo/maemo-developers
>
--
Kemal
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers