-
Notifications
You must be signed in to change notification settings - Fork 2
/
PlayerKitDefines.h
104 lines (83 loc) · 2.81 KB
/
PlayerKitDefines.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* PlayerKitDefines.h
* PlayerKit
*
* Created by Peter MacWhinnie on 7/1/08.
* Copyright 2008 Roundabout Software. All rights reserved.
*
*/
#import <CoreFoundation/CoreFoundation.h>
#import <AudioToolbox/AudioToolbox.h>
#ifndef PlayerKitDefines_h_
#define PlayerKitDefines_h_ 1
#pragma mark Symbols
#if __cplusplus
# define PK_EXTERN extern "C"
#else
# define PK_EXTERN extern
#endif /* __cplusplus */
#define PK_INLINE static inline
#if __cplusplus
# ifndef PK_FINAL
# define PK_FINAL
# endif /* PK_FINAL */
# ifndef PK_PURE_VIRTUAL
# define PK_PURE_VIRTUAL =0
# endif /* PK_PURE_VIRTUAL */
#endif /* __cplusplus */
#if !defined(PK_VISIBILITY_PUBLIC) && !defined(PK_VISIBILITY_HIDDEN)
# if __GNUC__ >= 4
# define PK_VISIBILITY_PUBLIC __attribute__((visibility("default")))
# define PK_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
# else
# define PK_VISIBILITY_PUBLIC
# define PK_VISIBILITY_HIDDEN
# endif /* __GNUC__ >= 4 */
#endif /* !defined(PK_VISIBILITY_PUBLIC) && !defined(PK_VISIBILITY_HIDDEN) */
#pragma mark -
/*!
@abstract Whether or not a flag is set on a bitfield.
@param field The field to check for the flag on.
@param flag The flag.
*/
#define PK_FLAG_IS_SET(field, flag) ((flag & field) == flag)
#pragma mark -
#pragma mark Constants
//Errors:
//! @abstract The effects error domain used by PlayerKit.
PK_EXTERN CFStringRef const PKEffectsErrorDomain;
//! @abstract The playback error domain used by PlayerKit.
PK_EXTERN CFStringRef const PKPlaybackErrorDomain;
enum _PKPlaybackErrorDomainErrors {
//All errors should begin with 3000
//! @abstract The error given when an incompatible stream format is used in PKAudioPlayer.
kPKPlaybackErrorIncompatibleStreamFormat = (-300001),
};
#pragma mark -
/*!
@global kPKCanonicalSampleRate
@abstract The canonical sample rate used in PlayerKit.
*/
PK_EXTERN Float64 const kPKCanonicalSampleRate;
/*!
@global kPKCanonicalBaseBufferSize
@abstract The canonical buffer size used in PlayerKit.
*/
PK_EXTERN UInt64 const kPKCanonicalBaseBufferSize;
#pragma mark -
#pragma mark Error Handling
/*!
@abstract Returns a new CFError instance with a specified domain, error code, userInfo, and description.
@param domain The domain of the error.
@param errorCode The code of the error.
@param userInfo Any additional user info to attach to the error instance.
@param format A format string.
@param ... A comma separated list of arguments to substitute into `format`.
*/
PK_EXTERN CFErrorRef PKCopyError(CFStringRef domain, CFIndex errorCode, CFDictionaryRef userInfo, CFStringRef format, ...);
/*!
@function
@abstract Returns whether or not a specified audio stream format is canonical in the context of PKAudioPlayerEngine.
*/
PK_EXTERN Boolean PKStreamFormatIsCanonical(AudioStreamBasicDescription format);
#endif /* PlayerKitDefines_h_ */