views:

299

answers:

1

I've tried looking through the documentation, but I can't seem to find (or recognize) what I'm looking for.

The iPhone and iPod Touch have a momentary switch on the headphones, which I believe is called the "remote" (please correct me if I'm wrong). It is used to start/stop/forward/back for music or to pickup/end a phone call. I'd like to know when this switch is clicked in my native application.

In which framework and classes would I find this?

+1  A: 

I don't believe this functionality is supported by any current framework.

If your application has iPod playback during execution you could register for MPMusicPlayerController notifications - Music Player Notifications

This will notify you of the playback state changes you mention above. However, it will not tell you whether the state was changed via the remote or the UI. But it's the only way that I know of to 'guess' if the remote button was clicked - I use this method in one of my own apps.

Chris Gummer
Just to be clear... I can detect that the player has changed state (started or stopped) but not why or how. Well, it doesn't matter for me, I think. I'm not really concerned about controlling music playback. All I care about is using this as an input device. Maybe I can have it control playback of a "silent" sound file. That would probably work. Thanks.
Adam Hawkes