mirror of
https://github.com/encounter/SDL.git
synced 2025-12-11 06:27:44 +00:00
Initial Apple TV / tvOS support.
The Apple TV remote is currently exposed as a joystick with its touch surface treated as two axes. Key presses are also generated when its buttons and touch surface are used. A new hint has been added to help deal with deciding whether to background the app when the remote's menu button is pressed: SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.
This commit is contained in:
@@ -274,7 +274,7 @@ static int open_capture_devices = 0;
|
||||
|
||||
static void update_audio_session()
|
||||
{
|
||||
#if !MACOSX_COREAUDIO
|
||||
#if !MACOSX_COREAUDIO && !TARGET_OS_TV
|
||||
/* !!! FIXME: move this to AVAudioSession. This is deprecated, and the new version is available as of (ancient!) iOS 3.0 */
|
||||
UInt32 category;
|
||||
if (open_playback_devices && open_capture_devices) {
|
||||
@@ -569,8 +569,8 @@ prepare_audioqueue(_THIS)
|
||||
/* We're running! */
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
audioqueue_thread(void *arg)
|
||||
{
|
||||
SDL_AudioDevice *this = (SDL_AudioDevice *) arg;
|
||||
@@ -725,9 +725,11 @@ COREAUDIO_Init(SDL_AudioDriverImpl * impl)
|
||||
!!! FIXME: do this when a device is opened, and deinitialize when all devices close.
|
||||
*/
|
||||
/* !!! FIXME: move this to AVAudioSession. This is deprecated, and the new version is available as of (ancient!) iOS 3.0 */
|
||||
#if !TARGET_OS_TV
|
||||
AudioSessionInitialize(NULL, NULL, NULL, nil);
|
||||
UInt32 category = kAudioSessionCategory_AmbientSound;
|
||||
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(UInt32), &category);
|
||||
#endif /* !TARGET_OS_TV */
|
||||
#endif
|
||||
|
||||
impl->ProvidesOwnCallbackThread = 1;
|
||||
|
||||
Reference in New Issue
Block a user