1
헤드폰이 모노 터치에서 분리되어 있는지 감지하는 방법이 있습니까? AudioSessionAddPropertyListener
메서드를 찾으려고하지만 표시되지 않습니다. 이 방법은 무엇을 포팅 했습니까? 여기 헤드폰 연결 해제 - 모노 터치
사람이 작업을 수행하는 방법에 대한 코드를보고 싶은 경우, 다음을 수행 할 수 있습니다
AudioSession.PropertyListener p = delegate(AudioSessionProperty prop, int size, IntPtr data) {
NSDictionary propertyDictionary = new NSDictionary(data);
if (propertyDictionary.ContainsKey(NSObject.FromObject("OutputDeviceDidChange_OldRoute")))
{
string oldRoute = propertyDictionary.ValueForKey(new NSString("OutputDeviceDidChange_OldRoute")).ToString();
if (oldRoute == "Headphone")
{
if (audioPlayer != null)
{
audioPlayer.Pause();
}
}
}
};
AudioSession.AddListener(AudioSessionProperty.AudioRouteChange, p);
우수. 그것이 내가 필요한 것입니다. API가 어떻게 매핑되는지 (MonoTouch와 기본 호출 간) 보려는 지점이 있습니까? – user472292
Miguel의 rosetta stone http://tirania.org/tmp/rosetta.html은 (Objective-C) 선택자를 다룰 때 가장 좋은 자료이지만 현재 C 라이브러리의 pinvokes를 보여주지는 않습니다. 일반적으로 바인딩은 MonoDevelop IDE 자동 완성을 사용하면 가능성이있는 후보를 제안해야하는 정도로 이름을 비슷하게 유지합니다. – poupou