mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-12-16 11:54:21 +08:00
CoreAudio iOS/tvOS: Use AVFoundation instead of AudioSession. Fixes audio on tvOS.
Note that linking with AVFoundation is now required if you don't disable SDL_audio compilation on iOS and tvOS.
This commit is contained in:
@@ -31,6 +31,14 @@
|
||||
FA8B4BA71967072800F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
|
||||
FA8B4BA81967073400F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
|
||||
FA8B4BA91967073D00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
|
||||
FABA34D41D8B5E5600915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
|
||||
FABA34D61D8B5E5A00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
|
||||
FABA34D81D8B5E7700915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D71D8B5E7700915323 /* AVFoundation.framework */; };
|
||||
FABA34D91D8B5E7B00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
|
||||
FABA34DA1D8B5E7F00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
|
||||
FABA34DB1D8B5E8500915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
|
||||
FABA34DC1D8B5E8900915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
|
||||
FABA34DD1D8B5E8D00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
|
||||
FAE0E96A1BAF96A00098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
|
||||
FAE0E96C1BAF96A90098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
|
||||
FAE0E96D1BAF96AF0098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
|
||||
@@ -213,6 +221,8 @@
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
FA30DE961BBF59D9009C397F /* Happy-TV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Happy-TV.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
|
||||
FABA34D31D8B5E5600915323 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
|
||||
FABA34D71D8B5E7700915323 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS10.0.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; };
|
||||
FAE0E9691BAF96A00098DFA4 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
|
||||
FD15FCB20E086866003BDF25 /* Happy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Happy.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
FD1B48920E313154007AB34E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; };
|
||||
@@ -253,6 +263,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FABA34D41D8B5E5600915323 /* AVFoundation.framework in Frameworks */,
|
||||
FD1B48DD0E313255007AB34E /* libSDL2.a in Frameworks */,
|
||||
FAE0E96A1BAF96A00098DFA4 /* GameController.framework in Frameworks */,
|
||||
FA8B4BA31967070A00F8EB7C /* CoreMotion.framework in Frameworks */,
|
||||
@@ -270,6 +281,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FABA34D81D8B5E7700915323 /* AVFoundation.framework in Frameworks */,
|
||||
FA30DEB71BBF5BB8009C397F /* libSDL2.a in Frameworks */,
|
||||
FA30DEC81BBF5C14009C397F /* GameController.framework in Frameworks */,
|
||||
FA30DEC91BBF5C14009C397F /* AudioToolbox.framework in Frameworks */,
|
||||
@@ -286,6 +298,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FABA34D61D8B5E5A00915323 /* AVFoundation.framework in Frameworks */,
|
||||
FD1B49980E313261007AB34E /* libSDL2.a in Frameworks */,
|
||||
FAE0E96C1BAF96A90098DFA4 /* GameController.framework in Frameworks */,
|
||||
FA8B4BA41967071300F8EB7C /* CoreMotion.framework in Frameworks */,
|
||||
@@ -303,6 +316,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FABA34D91D8B5E7B00915323 /* AVFoundation.framework in Frameworks */,
|
||||
FD1B499C0E313269007AB34E /* libSDL2.a in Frameworks */,
|
||||
FAE0E96D1BAF96AF0098DFA4 /* GameController.framework in Frameworks */,
|
||||
FA8B4BA51967071A00F8EB7C /* CoreMotion.framework in Frameworks */,
|
||||
@@ -320,6 +334,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FABA34DD1D8B5E8D00915323 /* AVFoundation.framework in Frameworks */,
|
||||
FDB652000E43D1F300F688B5 /* libSDL2.a in Frameworks */,
|
||||
FAE0E9711BAF96BB0098DFA4 /* GameController.framework in Frameworks */,
|
||||
FA8B4BA91967073D00F8EB7C /* CoreMotion.framework in Frameworks */,
|
||||
@@ -337,6 +352,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FABA34DA1D8B5E7F00915323 /* AVFoundation.framework in Frameworks */,
|
||||
FD1B499E0E31326C007AB34E /* libSDL2.a in Frameworks */,
|
||||
FAE0E96E1BAF96B10098DFA4 /* GameController.framework in Frameworks */,
|
||||
FA8B4BA61967072100F8EB7C /* CoreMotion.framework in Frameworks */,
|
||||
@@ -354,6 +370,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FABA34DC1D8B5E8900915323 /* AVFoundation.framework in Frameworks */,
|
||||
FD1B49A20E313273007AB34E /* libSDL2.a in Frameworks */,
|
||||
FAE0E9701BAF96B80098DFA4 /* GameController.framework in Frameworks */,
|
||||
FA8B4BA81967073400F8EB7C /* CoreMotion.framework in Frameworks */,
|
||||
@@ -371,6 +388,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FABA34DB1D8B5E8500915323 /* AVFoundation.framework in Frameworks */,
|
||||
FD1B49A00E313270007AB34E /* libSDL2.a in Frameworks */,
|
||||
FAE0E96F1BAF96B50098DFA4 /* GameController.framework in Frameworks */,
|
||||
FA8B4BA71967072800F8EB7C /* CoreMotion.framework in Frameworks */,
|
||||
@@ -428,6 +446,8 @@
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FABA34D71D8B5E7700915323 /* AVFoundation.framework */,
|
||||
FABA34D31D8B5E5600915323 /* AVFoundation.framework */,
|
||||
FAE0E9691BAF96A00098DFA4 /* GameController.framework */,
|
||||
FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */,
|
||||
FDF0D7220E12D31800247964 /* AudioToolbox.framework */,
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
56A6703818565E760007D20F /* SDL_dynapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 56A6703418565E760007D20F /* SDL_dynapi.h */; };
|
||||
56C181DF17C44D5E00406AE3 /* SDL_filesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 56C181DE17C44D5E00406AE3 /* SDL_filesystem.h */; };
|
||||
56C181E217C44D7A00406AE3 /* SDL_sysfilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */; };
|
||||
56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */; };
|
||||
56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */; };
|
||||
56EA86FC13E9EC2B002E47EB /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */; };
|
||||
56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E0118A8EE200A56AA6 /* SDL_power.c */; };
|
||||
56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; };
|
||||
@@ -147,7 +147,7 @@
|
||||
FA1DC2731C62BE65008F99A0 /* SDL_uikitclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DC2711C62BE65008F99A0 /* SDL_uikitclipboard.m */; };
|
||||
FAB5981D1BB5C31500BE72C5 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */; };
|
||||
FAB5981E1BB5C31500BE72C5 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */; };
|
||||
FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */; };
|
||||
FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */; };
|
||||
FAB598211BB5C31500BE72C5 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B91D0DD52EDC00FB1D6B /* SDL_dummyaudio.c */; };
|
||||
FAB598231BB5C31500BE72C5 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */; };
|
||||
FAB598251BB5C31500BE72C5 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */; };
|
||||
@@ -368,7 +368,7 @@
|
||||
56A6703418565E760007D20F /* SDL_dynapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_dynapi.h; path = ../../src/dynapi/SDL_dynapi.h; sourceTree = "<group>"; };
|
||||
56C181DE17C44D5E00406AE3 /* SDL_filesystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_filesystem.h; sourceTree = "<group>"; };
|
||||
56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_sysfilesystem.m; path = ../../src/filesystem/cocoa/SDL_sysfilesystem.m; sourceTree = "<group>"; };
|
||||
56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_coreaudio.c; path = coreaudio/SDL_coreaudio.c; sourceTree = "<group>"; };
|
||||
56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_coreaudio.m; path = coreaudio/SDL_coreaudio.m; sourceTree = "<group>"; };
|
||||
56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_coreaudio.h; path = coreaudio/SDL_coreaudio.h; sourceTree = "<group>"; };
|
||||
56ED04E0118A8EE200A56AA6 /* SDL_power.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_power.c; path = ../../src/power/SDL_power.c; sourceTree = SOURCE_ROOT; };
|
||||
56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_syspower.m; path = ../../src/power/uikit/SDL_syspower.m; sourceTree = SOURCE_ROOT; };
|
||||
@@ -683,7 +683,7 @@
|
||||
56EA86F813E9EBF9002E47EB /* coreaudio */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */,
|
||||
56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */,
|
||||
56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */,
|
||||
);
|
||||
name = coreaudio;
|
||||
@@ -1255,7 +1255,7 @@
|
||||
files = (
|
||||
FAB5981D1BB5C31500BE72C5 /* SDL_atomic.c in Sources */,
|
||||
FAB5981E1BB5C31500BE72C5 /* SDL_spinlock.c in Sources */,
|
||||
FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.c in Sources */,
|
||||
FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.m in Sources */,
|
||||
FAB598211BB5C31500BE72C5 /* SDL_dummyaudio.c in Sources */,
|
||||
FAB598231BB5C31500BE72C5 /* SDL_audio.c in Sources */,
|
||||
FAB598251BB5C31500BE72C5 /* SDL_audiocvt.c in Sources */,
|
||||
@@ -1441,7 +1441,7 @@
|
||||
0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */,
|
||||
0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */,
|
||||
04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */,
|
||||
56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */,
|
||||
56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.m in Sources */,
|
||||
93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */,
|
||||
AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */,
|
||||
AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -57,7 +57,6 @@
|
||||
04BD000912E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; };
|
||||
04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; };
|
||||
04BD001112E6671800899322 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */; };
|
||||
04BD001812E6671800899322 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; };
|
||||
04BD001912E6671800899322 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; };
|
||||
04BD002612E6671800899322 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; };
|
||||
04BD002712E6671800899322 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; };
|
||||
@@ -210,7 +209,6 @@
|
||||
04BD022512E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; };
|
||||
04BD022C12E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; };
|
||||
04BD022D12E6671800899322 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */; };
|
||||
04BD023412E6671800899322 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; };
|
||||
04BD023512E6671800899322 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; };
|
||||
04BD024212E6671800899322 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; };
|
||||
04BD024312E6671800899322 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; };
|
||||
@@ -695,7 +693,6 @@
|
||||
DB313FFF17554B71006C0E22 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7512E6671700899322 /* SDL_spinlock.c */; };
|
||||
DB31400017554B71006C0E22 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; };
|
||||
DB31400117554B71006C0E22 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; };
|
||||
DB31400217554B71006C0E22 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; };
|
||||
DB31400317554B71006C0E22 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; };
|
||||
DB31400417554B71006C0E22 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB612E6671700899322 /* SDL_audiocvt.c */; };
|
||||
DB31400517554B71006C0E22 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB712E6671700899322 /* SDL_audiodev.c */; };
|
||||
@@ -810,6 +807,7 @@
|
||||
FA73671D19A540EF004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; };
|
||||
FA73671E19A54140004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; };
|
||||
FA73671F19A54144004122E4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73671C19A540EF004122E4 /* CoreVideo.framework */; };
|
||||
FABA34C71D8B5DB100915323 /* SDL_coreaudio.m in Sources */ = {isa = PBXBuildFile; fileRef = FABA34C61D8B5DB100915323 /* SDL_coreaudio.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -854,7 +852,6 @@
|
||||
04BDFD8912E6671700899322 /* SDL_diskaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_diskaudio.h; sourceTree = "<group>"; };
|
||||
04BDFD9412E6671700899322 /* SDL_dummyaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dummyaudio.c; sourceTree = "<group>"; };
|
||||
04BDFD9512E6671700899322 /* SDL_dummyaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dummyaudio.h; sourceTree = "<group>"; };
|
||||
04BDFDA012E6671700899322 /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_coreaudio.c; sourceTree = "<group>"; };
|
||||
04BDFDA112E6671700899322 /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_coreaudio.h; sourceTree = "<group>"; };
|
||||
04BDFDB412E6671700899322 /* SDL_audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audio.c; sourceTree = "<group>"; };
|
||||
04BDFDB512E6671700899322 /* SDL_audio_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_c.h; sourceTree = "<group>"; };
|
||||
@@ -1102,6 +1099,7 @@
|
||||
F59C710600D5CB5801000001 /* SDL.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SDL.info; sourceTree = "<group>"; };
|
||||
F5A2EF3900C6A39A01000001 /* BUGS.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = BUGS.txt; path = ../../BUGS.txt; sourceTree = SOURCE_ROOT; };
|
||||
FA73671C19A540EF004122E4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = "<absolute>"; };
|
||||
FABA34C61D8B5DB100915323 /* SDL_coreaudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_coreaudio.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -1334,8 +1332,8 @@
|
||||
04BDFD9F12E6671700899322 /* coreaudio */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
04BDFDA012E6671700899322 /* SDL_coreaudio.c */,
|
||||
04BDFDA112E6671700899322 /* SDL_coreaudio.h */,
|
||||
FABA34C61D8B5DB100915323 /* SDL_coreaudio.m */,
|
||||
);
|
||||
path = coreaudio;
|
||||
sourceTree = "<group>";
|
||||
@@ -2396,7 +2394,6 @@
|
||||
04BDFFFC12E6671800899322 /* SDL_spinlock.c in Sources */,
|
||||
04BD000812E6671800899322 /* SDL_diskaudio.c in Sources */,
|
||||
04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */,
|
||||
04BD001812E6671800899322 /* SDL_coreaudio.c in Sources */,
|
||||
04BD002612E6671800899322 /* SDL_audio.c in Sources */,
|
||||
04BD002812E6671800899322 /* SDL_audiocvt.c in Sources */,
|
||||
04BD002912E6671800899322 /* SDL_audiodev.c in Sources */,
|
||||
@@ -2432,6 +2429,7 @@
|
||||
04BD00A812E6671800899322 /* SDL_string.c in Sources */,
|
||||
04BD00BD12E6671800899322 /* SDL_syscond.c in Sources */,
|
||||
04BD00BE12E6671800899322 /* SDL_sysmutex.c in Sources */,
|
||||
FABA34C71D8B5DB100915323 /* SDL_coreaudio.m in Sources */,
|
||||
04BD00C012E6671800899322 /* SDL_syssem.c in Sources */,
|
||||
04BD00C112E6671800899322 /* SDL_systhread.c in Sources */,
|
||||
04BD00CA12E6671800899322 /* SDL_thread.c in Sources */,
|
||||
@@ -2515,7 +2513,6 @@
|
||||
04BD021812E6671800899322 /* SDL_spinlock.c in Sources */,
|
||||
04BD022412E6671800899322 /* SDL_diskaudio.c in Sources */,
|
||||
04BD022C12E6671800899322 /* SDL_dummyaudio.c in Sources */,
|
||||
04BD023412E6671800899322 /* SDL_coreaudio.c in Sources */,
|
||||
04BD024212E6671800899322 /* SDL_audio.c in Sources */,
|
||||
04BD024412E6671800899322 /* SDL_audiocvt.c in Sources */,
|
||||
04BD024512E6671800899322 /* SDL_audiodev.c in Sources */,
|
||||
@@ -2634,7 +2631,6 @@
|
||||
DB313FFF17554B71006C0E22 /* SDL_spinlock.c in Sources */,
|
||||
DB31400017554B71006C0E22 /* SDL_diskaudio.c in Sources */,
|
||||
DB31400117554B71006C0E22 /* SDL_dummyaudio.c in Sources */,
|
||||
DB31400217554B71006C0E22 /* SDL_coreaudio.c in Sources */,
|
||||
DB31400317554B71006C0E22 /* SDL_audio.c in Sources */,
|
||||
DB31400417554B71006C0E22 /* SDL_audiocvt.c in Sources */,
|
||||
DB31400517554B71006C0E22 /* SDL_audiodev.c in Sources */,
|
||||
|
||||
@@ -27,6 +27,7 @@ Xcode-iOS project. Those are:
|
||||
-CoreAudio.framework
|
||||
-CoreMotion.framework
|
||||
-GameController.framework
|
||||
-AVFoundation.framework
|
||||
|
||||
All of these frameworks are part of the iOS SDK, not part of the core OS X
|
||||
system.
|
||||
|
||||
@@ -405,5 +405,6 @@ SDL_project "SDL2"
|
||||
"$(SDKROOT)/Foundation.framework",
|
||||
"$(SDKROOT)/CoreAudio.framework",
|
||||
"$(SDKROOT)/CoreMotion.framework",
|
||||
"$(SDKROOT)/GameController.framework"
|
||||
"$(SDKROOT)/GameController.framework",
|
||||
"$(SDKROOT)/AVFoundation.framework",
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
#if MACOSX_COREAUDIO
|
||||
#include <CoreAudio/CoreAudio.h>
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#else
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#endif
|
||||
|
||||
#include <AudioToolbox/AudioToolbox.h>
|
||||
|
||||
@@ -272,21 +272,45 @@ device_list_changed(AudioObjectID systemObj, UInt32 num_addr, const AudioObjectP
|
||||
static int open_playback_devices = 0;
|
||||
static int open_capture_devices = 0;
|
||||
|
||||
static void update_audio_session()
|
||||
#if !MACOSX_COREAUDIO
|
||||
static BOOL update_audio_session()
|
||||
{
|
||||
#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) {
|
||||
category = kAudioSessionCategory_PlayAndRecord;
|
||||
} else if (open_capture_devices) {
|
||||
category = kAudioSessionCategory_RecordAudio;
|
||||
} else { /* nothing open, or just playing audio. */
|
||||
category = kAudioSessionCategory_AmbientSound;
|
||||
@autoreleasepool {
|
||||
AVAudioSession *session = [AVAudioSession sharedInstance];
|
||||
NSString *category;
|
||||
NSError *err = nil;
|
||||
|
||||
if (open_playback_devices && open_capture_devices) {
|
||||
category = AVAudioSessionCategoryPlayAndRecord;
|
||||
} else if (open_capture_devices) {
|
||||
category = AVAudioSessionCategoryRecord;
|
||||
} else {
|
||||
/* Set category to ambient so that other music continues playing.
|
||||
You can change this at runtime in your own code if you need different
|
||||
behavior. If this is common, we can add an SDL hint for this. */
|
||||
category = AVAudioSessionCategoryAmbient;
|
||||
}
|
||||
|
||||
if (open_playback_devices + open_capture_devices == 1) {
|
||||
if (![session setActive:YES error:&err]) {
|
||||
NSString *desc = err.description;
|
||||
SDL_SetError("Could not activate Audio Session: %s", desc.UTF8String);
|
||||
return NO;
|
||||
}
|
||||
} else if (!open_playback_devices && !open_capture_devices) {
|
||||
[session setActive:NO error:nil];
|
||||
}
|
||||
|
||||
if (![session setCategory:category error:&err]) {
|
||||
NSString *desc = err.description;
|
||||
SDL_SetError("Could not set Audio Session category: %s", desc.UTF8String);
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof (UInt32), &category);
|
||||
#endif
|
||||
|
||||
return YES;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* The AudioQueue callback */
|
||||
@@ -444,7 +468,10 @@ COREAUDIO_CloseDevice(_THIS)
|
||||
} else {
|
||||
open_playback_devices--;
|
||||
}
|
||||
|
||||
#if !MACOSX_COREAUDIO
|
||||
update_audio_session();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MACOSX_COREAUDIO
|
||||
@@ -620,7 +647,12 @@ COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
|
||||
} else {
|
||||
open_playback_devices++;
|
||||
}
|
||||
update_audio_session();
|
||||
|
||||
#if !MACOSX_COREAUDIO
|
||||
if (!update_audio_session()) {
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Setup a AudioStreamBasicDescription with the requested format */
|
||||
SDL_zerop(strdesc);
|
||||
@@ -718,18 +750,6 @@ COREAUDIO_Init(SDL_AudioDriverImpl * impl)
|
||||
#else
|
||||
impl->OnlyHasDefaultOutputDevice = 1;
|
||||
impl->OnlyHasDefaultCaptureDevice = 1;
|
||||
|
||||
/* Set category to ambient sound so that other music continues playing.
|
||||
You can change this at runtime in your own code if you need different
|
||||
behavior. If this is common, we can add an SDL hint for this.
|
||||
!!! 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