~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/maccore/src/AVFoundation/AVAudioSession.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// Copyright 2009, Novell, Inc.
2
2
// Copyright 2010, Novell, Inc.
 
3
// Copyright 2011, 2011 Xamarin Inc
3
4
//
4
5
// Permission is hereby granted, free of charge, to any person obtaining
5
6
// a copy of this software and associated documentation files (the
26
27
 
27
28
namespace MonoMac.AVFoundation {
28
29
 
 
30
#if !MONOMAC
29
31
        public partial class AVAudioSession {
30
32
 
31
33
                [Obsolete ("Use SetActive(bool, out NSError) instead")]
35
37
                        return SetActive (beActive, out outError);
36
38
                }
37
39
 
38
 
                public bool SetActive (bool beActive, out NSError outError)
39
 
                {
40
 
                        unsafe {
41
 
                                IntPtr errhandle;
42
 
                                IntPtr ptrtohandle = (IntPtr) (&errhandle);
43
 
 
44
 
                                if (SetActive (beActive, ptrtohandle)){
45
 
                                        outError = null;
46
 
                                        return true;
47
 
                                } else {
48
 
                                        outError = (NSError) Runtime.GetNSObject (errhandle);
49
 
                                        return false;
50
 
                                }
51
 
                        }                       
52
 
                }
53
 
 
54
 
                [Since (4,0)]
55
 
                public bool SetActive (bool beActive, AVAudioSessionFlags flags, out NSError outError)
56
 
                {
57
 
                        unsafe {
58
 
                                IntPtr errhandle;
59
 
                                IntPtr ptrtohandle = (IntPtr) (&errhandle);
60
 
 
61
 
                                if (_SetActive (beActive, (int) flags, ptrtohandle)){
62
 
                                        outError = null;
63
 
                                        return true;
64
 
                                } else {
65
 
                                        outError = (NSError) Runtime.GetNSObject (errhandle);
66
 
                                        return false;
67
 
                                }
68
 
                        }                       
69
 
                }
70
40
 
71
41
                [Obsolete ("Use SetCategory(bool, out NSError) instead")]
72
42
                public bool SetCategory (NSString theCategory, NSError outError)
75
45
                        return SetCategory (theCategory, out outError);
76
46
                }
77
47
 
78
 
                public bool SetCategory (NSString theCategory, out NSError outError)
79
 
                {
80
 
                        unsafe {
81
 
                                IntPtr errhandle;
82
 
                                IntPtr ptrtohandle = (IntPtr) (&errhandle);
83
 
 
84
 
                                if (SetCategory (theCategory, ptrtohandle)){
85
 
                                        outError = null;
86
 
                                        return true;
87
 
                                } else {
88
 
                                        outError = (NSError) Runtime.GetNSObject (errhandle);
89
 
                                        return false;
90
 
                                }
91
 
                        }                       
92
 
                }
93
 
 
94
 
                [Obsolete ("Use SetPreferredHardwareSampleRate(bool, out NSError) instead")]
 
48
                [Obsolete ("Use SetPreferredSampleRate(bool, out NSError) on iOS 6.0 instead")]
95
49
                public bool SetPreferredHardwareSampleRate (double sampleRate, NSError outError)
96
50
                {
97
51
                        // Effectively discarded due to original binding error
98
52
                        return SetPreferredHardwareSampleRate (sampleRate, out outError);
99
53
                }
100
54
 
101
 
                public bool SetPreferredHardwareSampleRate (double sampleRate, out NSError outError)
102
 
                {
103
 
                        unsafe {
104
 
                                IntPtr errhandle;
105
 
                                IntPtr ptrtohandle = (IntPtr) (&errhandle);
106
 
 
107
 
                                if (SetPreferredHardwareSampleRate (sampleRate, ptrtohandle)){
108
 
                                        outError = null;
109
 
                                        return true;
110
 
                                } else {
111
 
                                        outError = (NSError) Runtime.GetNSObject (errhandle);
112
 
                                        return false;
113
 
                                }
114
 
                        }                       
115
 
                }
116
 
 
117
55
                [Obsolete ("Use SetPreferredIOBufferDuration(bool, out NSError) instead")]
118
56
                public bool SetPreferredIOBufferDuration (double duration, NSError outError)
119
57
                {
120
58
                        // Effectively discarded due to original binding error
121
59
                        return SetPreferredIOBufferDuration (duration, out outError);
122
60
                }
123
 
 
124
 
                public bool SetPreferredIOBufferDuration (double duration, out NSError outError)
125
 
                {
126
 
                        unsafe {
127
 
                                IntPtr errhandle;
128
 
                                IntPtr ptrtohandle = (IntPtr) (&errhandle);
129
 
 
130
 
                                if (SetPreferredIOBufferDuration (duration, ptrtohandle)){
131
 
                                        outError = null;
132
 
                                        return true;
133
 
                                } else {
134
 
                                        outError = (NSError) Runtime.GetNSObject (errhandle);
135
 
                                        return false;
136
 
                                }
137
 
                        }                       
138
 
                }
139
 
                
140
61
        }
 
62
#endif
141
63
}