|
1 /* |
|
2 * Copyright (c) 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: Mic stream to DevSound. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSPMICROPHONE_H |
|
20 #define CSPMICROPHONE_H |
|
21 |
|
22 #include "cspdevsound.h" |
|
23 |
|
24 /** |
|
25 * Provides mic functionality. |
|
26 * |
|
27 */ |
|
28 NONSHARABLE_CLASS( CSPMicrophone ): public CSPDevSound |
|
29 { |
|
30 |
|
31 public: |
|
32 |
|
33 static CSPMicrophone* NewL( MCSPDevSoundObserver& aObserver ); |
|
34 |
|
35 virtual ~CSPMicrophone(); |
|
36 |
|
37 /** |
|
38 * Determines mic mute state. |
|
39 * |
|
40 * |
|
41 * @return ETrue - mic is muted, EFalse - mic is not muted. |
|
42 */ |
|
43 TBool IsMuted(); |
|
44 |
|
45 /** |
|
46 * Set mic muted. |
|
47 * |
|
48 * |
|
49 */ |
|
50 void SetMuted(); |
|
51 |
|
52 /** |
|
53 * Set mic unmuted. |
|
54 * |
|
55 * |
|
56 */ |
|
57 void SetUnmuted(); |
|
58 |
|
59 // from base class MDevSoundObserver |
|
60 |
|
61 /** |
|
62 * From MDevSoundObserver |
|
63 * Notification from Devsound that stream (mic) is |
|
64 * activated successfully. |
|
65 * |
|
66 * |
|
67 */ |
|
68 void BufferToBeEmptied( CMMFBuffer* aBuffer ); |
|
69 |
|
70 /** |
|
71 * From MDevSoundObserver |
|
72 * Notification from devsound that downstream(mic) activation |
|
73 * feiled. |
|
74 * |
|
75 * |
|
76 */ |
|
77 void RecordError( TInt aError ); |
|
78 |
|
79 private: |
|
80 |
|
81 // from base class MCSPDevSound |
|
82 |
|
83 /** |
|
84 * From MCSPDevSound. |
|
85 * Tries to activate the mic stream. |
|
86 * |
|
87 * |
|
88 */ |
|
89 void DoActivateL(); |
|
90 |
|
91 protected: |
|
92 |
|
93 CSPMicrophone( MCSPDevSoundObserver& aObserver ); |
|
94 |
|
95 void ConstructL(); |
|
96 |
|
97 }; |
|
98 |
|
99 #endif // CSPMICROPHONE_H |