|
1 /* |
|
2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This header specifies the implementation of BT Audio Adaptation API. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __BTAUDIOSTREAMINPUTADAPTATION_H__ |
|
20 #define __BTAUDIOSTREAMINPUTADAPTATION_H__ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32std.h> |
|
24 #include "btaudiostreaminputbase.h" |
|
25 |
|
26 /** |
|
27 * This class implements the interface specified by CBTAudioStreamInputBase. |
|
28 * |
|
29 * This class contains the stub implementation of the CAudioStreamInputAdaptation, |
|
30 * that inherits from CBTAudioStreamInputBase. |
|
31 * |
|
32 * To the user it seems as if he's operating with the base class, because he calls, |
|
33 * but in practice the class he uses is an instance of this class. |
|
34 * |
|
35 * @lib btaudioadaptation.lib |
|
36 * @since S60 v3.1 |
|
37 */ |
|
38 NONSHARABLE_CLASS(CBTAudioStreamInputAdaptation) : public CBTAudioStreamInputBase |
|
39 { |
|
40 public: |
|
41 static CBTAudioStreamInputAdaptation* NewL( MBTAudioStreamObserver& aStreamObserver, MBTAudioErrorObserver& aErrorObserver ); |
|
42 virtual ~CBTAudioStreamInputAdaptation(); |
|
43 |
|
44 public: |
|
45 /** |
|
46 * From CBTAudioStreamInputBase. |
|
47 * This method is called when the client has processed the buffer it got |
|
48 * from the Receive method. |
|
49 * |
|
50 * See BT Audio Adaptation API and BT Audio Adaptation Design specifications |
|
51 * for detailed explanation. |
|
52 * |
|
53 * @since S60 v3.1 |
|
54 * @param aBuffer refers to the buffer that was received earlier in the Receive method. |
|
55 * @return void |
|
56 */ |
|
57 IMPORT_C void BufferEmptied( const TDesC8& aBuffer ); |
|
58 |
|
59 /** |
|
60 * From CBTAudioStreamInputBase. |
|
61 * This method is for connecting to the audio subsystem. |
|
62 * |
|
63 * See BT Audio Adaptation API and BT Audio Adaptation Design specifications |
|
64 * for detailed explanation. |
|
65 * |
|
66 * @since S60 v3.1 |
|
67 * @param void. |
|
68 * @return a Symbian OS wide error code. |
|
69 */ |
|
70 IMPORT_C TInt Connect(); |
|
71 |
|
72 /** |
|
73 * From CBTAudioStreamInputBase. |
|
74 * This method is for disconnecting from the audio subsystem. |
|
75 * |
|
76 * See BT Audio Adaptation API and BT Audio Adaptation Design specifications |
|
77 * for detailed explanation. |
|
78 * |
|
79 * @since S60 v3.1 |
|
80 * @param void. |
|
81 * @return void |
|
82 */ |
|
83 IMPORT_C void Disconnect(); |
|
84 |
|
85 /** |
|
86 * From CBTAudioStreamInputBase. |
|
87 * This method is for passing the custom interfaces that are |
|
88 * needed sometimes for configuring the hardware encoder. |
|
89 * |
|
90 * See BT Audio Adaptation API and BT Audio Adaptation Design specifications |
|
91 * for detailed explanation. |
|
92 * |
|
93 * @since S60 v3.1 |
|
94 * @param aInterfaceId specifies the id of custom interface that the client |
|
95 * wants to get. |
|
96 * @return A pointer to the requested interface. Client must cast it into a correct class. |
|
97 */ |
|
98 IMPORT_C TAny* EncoderInterface(TUid aInterfaceId); |
|
99 |
|
100 /** |
|
101 * From CBTAudioStreamInputBase. |
|
102 * This method is for choosing the encoder for the audio data. |
|
103 * |
|
104 * See BT Audio Adaptation API and BT Audio Adaptation Design specifications |
|
105 * for detailed explanation. |
|
106 * |
|
107 * @since S60 v3.1 |
|
108 * @param aDesiredFourCC specifies the encoder that the client wants to use. |
|
109 * @return a Symbian OS wide error code. |
|
110 */ |
|
111 IMPORT_C TInt SetFormat(TFourCC aDesiredFourCC); |
|
112 |
|
113 /** |
|
114 * From CBTAudioStreamInputBase. |
|
115 * This method is for starting the recording from the audio subsystem. |
|
116 * |
|
117 * See BT Audio Adaptation API and BT Audio Adaptation Design specifications |
|
118 * for detailed explanation. |
|
119 * |
|
120 * @since S60 v3.1 |
|
121 * @param void. |
|
122 * @return a Symbian OS wide error code. |
|
123 */ |
|
124 IMPORT_C TInt Start(); |
|
125 |
|
126 /** |
|
127 * From CBTAudioStreamInputBase. |
|
128 * This method is for stopping the recording from the audio subsystem. |
|
129 * |
|
130 * See BT Audio Adaptation API and BT Audio Adaptation Design specifications |
|
131 * for detailed explanation. |
|
132 * |
|
133 * @since S60 v3.1 |
|
134 * @param void. |
|
135 * @return a Symbian OS wide error code. |
|
136 */ |
|
137 IMPORT_C void Stop(); |
|
138 |
|
139 private: |
|
140 CBTAudioStreamInputAdaptation(MBTAudioStreamObserver& aStreamObserver, MBTAudioErrorObserver& aErrorObserver); |
|
141 void ConstructL(); |
|
142 void RunL(); |
|
143 void DoCancel(); |
|
144 }; |
|
145 |
|
146 #endif |