Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
1ea43749
Commit
1ea43749
authored
Aug 23, 2011
by
Ryan C. Gordon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned out functions deprecated in Mac OS X 10.6 SDK.
parent
51254fce
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
197 additions
and
64 deletions
+197
-64
SDL_coreaudio.c
src/audio/coreaudio/SDL_coreaudio.c
+39
-28
SDL_cocoamodes.h
src/video/cocoa/SDL_cocoamodes.h
+1
-1
SDL_cocoamodes.m
src/video/cocoa/SDL_cocoamodes.m
+157
-35
No files found.
src/audio/coreaudio/SDL_coreaudio.c
View file @
1ea43749
...
...
@@ -67,16 +67,20 @@ findDevId(const char *name, AudioDeviceID devId, void *_data)
static
void
build_device_list
(
int
iscapture
,
addDevFn
addfn
,
void
*
addfndata
)
{
Boolean
outWritable
=
0
;
OSStatus
result
=
noErr
;
UInt32
size
=
0
;
AudioDeviceID
*
devs
=
NULL
;
UInt32
i
=
0
;
UInt32
max
=
0
;
result
=
AudioHardwareGetPropertyInfo
(
kAudioHardwarePropertyDevices
,
&
size
,
&
outWritable
);
AudioObjectPropertyAddress
addr
=
{
kAudioHardwarePropertyDevices
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElementMaster
};
result
=
AudioObjectGetPropertyDataSize
(
kAudioObjectSystemObject
,
&
addr
,
0
,
NULL
,
&
size
);
if
(
result
!=
kAudioHardwareNoError
)
return
;
...
...
@@ -84,8 +88,8 @@ build_device_list(int iscapture, addDevFn addfn, void *addfndata)
if
(
devs
==
NULL
)
return
;
result
=
Audio
HardwareGetProperty
(
kAudioHardwarePropertyDevices
,
&
size
,
devs
);
result
=
Audio
ObjectGetPropertyData
(
kAudioObjectSystemObject
,
&
addr
,
0
,
NULL
,
&
size
,
devs
);
if
(
result
!=
kAudioHardwareNoError
)
return
;
...
...
@@ -98,9 +102,11 @@ build_device_list(int iscapture, addDevFn addfn, void *addfndata)
int
usable
=
0
;
CFIndex
len
=
0
;
result
=
AudioDeviceGetPropertyInfo
(
dev
,
0
,
iscapture
,
kAudioDevicePropertyStreamConfiguration
,
&
size
,
&
outWritable
);
addr
.
mScope
=
iscapture
?
kAudioDevicePropertyScopeInput
:
kAudioDevicePropertyScopeOutput
;
addr
.
mSelector
=
kAudioDevicePropertyStreamConfiguration
;
result
=
AudioObjectGetPropertyDataSize
(
dev
,
&
addr
,
0
,
NULL
,
&
size
);
if
(
result
!=
noErr
)
continue
;
...
...
@@ -108,9 +114,8 @@ build_device_list(int iscapture, addDevFn addfn, void *addfndata)
if
(
buflist
==
NULL
)
continue
;
result
=
AudioDeviceGetProperty
(
dev
,
0
,
iscapture
,
kAudioDevicePropertyStreamConfiguration
,
&
size
,
buflist
);
result
=
AudioObjectGetPropertyData
(
dev
,
&
addr
,
0
,
NULL
,
&
size
,
buflist
);
if
(
result
==
noErr
)
{
UInt32
j
;
...
...
@@ -127,11 +132,9 @@ build_device_list(int iscapture, addDevFn addfn, void *addfndata)
if
(
!
usable
)
continue
;
size
=
sizeof
(
CFStringRef
);
result
=
AudioDeviceGetProperty
(
dev
,
0
,
iscapture
,
kAudioDevicePropertyDeviceNameCFString
,
&
size
,
&
cfstr
);
addr
.
mSelector
=
kAudioObjectPropertyName
;
size
=
sizeof
(
CFStringRef
);
result
=
AudioObjectGetPropertyData
(
dev
,
&
addr
,
0
,
NULL
,
&
size
,
&
cfstr
);
if
(
result
!=
kAudioHardwareNoError
)
continue
;
...
...
@@ -183,13 +186,19 @@ find_device_by_name(_THIS, const char *devname, int iscapture)
UInt32
alive
=
0
;
pid_t
pid
=
0
;
AudioObjectPropertyAddress
addr
=
{
0
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElementMaster
};
if
(
devname
==
NULL
)
{
size
=
sizeof
(
AudioDeviceID
);
const
AudioHardwarePropertyID
propid
=
size
=
sizeof
(
AudioDeviceID
);
addr
.
mSelector
=
((
iscapture
)
?
kAudioHardwarePropertyDefaultInputDevice
:
kAudioHardwarePropertyDefaultOutputDevice
);
result
=
AudioHardwareGetProperty
(
propid
,
&
size
,
&
devid
);
kAudioHardwarePropertyDefaultOutputDevice
);
result
=
AudioObjectGetPropertyData
(
kAudioObjectSystemObject
,
&
addr
,
0
,
NULL
,
&
size
,
&
devid
);
CHECK_RESULT
(
"AudioHardwareGetProperty (default device)"
);
}
else
{
FindDevIdData
data
;
...
...
@@ -203,10 +212,12 @@ find_device_by_name(_THIS, const char *devname, int iscapture)
devid
=
data
.
devId
;
}
size
=
sizeof
(
alive
);
result
=
AudioDeviceGetProperty
(
devid
,
0
,
iscapture
,
kAudioDevicePropertyDeviceIsAlive
,
&
size
,
&
alive
);
addr
.
mSelector
=
kAudioDevicePropertyDeviceIsAlive
;
addr
.
mScope
=
iscapture
?
kAudioDevicePropertyScopeInput
:
kAudioDevicePropertyScopeOutput
;
size
=
sizeof
(
alive
);
result
=
AudioObjectGetPropertyData
(
devid
,
&
addr
,
0
,
NULL
,
&
size
,
&
alive
);
CHECK_RESULT
(
"AudioDeviceGetProperty (kAudioDevicePropertyDeviceIsAlive)"
);
...
...
@@ -215,9 +226,9 @@ find_device_by_name(_THIS, const char *devname, int iscapture)
return
0
;
}
size
=
sizeof
(
pid
)
;
result
=
AudioDeviceGetProperty
(
devid
,
0
,
iscapture
,
kAudioDevicePropertyHogMode
,
&
size
,
&
pid
);
addr
.
mSelector
=
kAudioDevicePropertyHogMode
;
size
=
sizeof
(
pid
);
result
=
AudioObjectGetPropertyData
(
devid
,
&
addr
,
0
,
NULL
,
&
size
,
&
pid
);
/* some devices don't support this property, so errors are fine here. */
if
((
result
==
noErr
)
&&
(
pid
!=
-
1
))
{
...
...
src/video/cocoa/SDL_cocoamodes.h
View file @
1ea43749
...
...
@@ -30,7 +30,7 @@ typedef struct
typedef
struct
{
CFDictionaryRef
moderef
;
const
void
*
moderef
;
}
SDL_DisplayModeData
;
extern
void
Cocoa_InitModes
(
_THIS
);
...
...
src/video/cocoa/SDL_cocoamodes.m
View file @
1ea43749
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment