|
1 /* |
|
2 * Copyright (c) 2006-2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @publishedPartner |
|
24 @released |
|
25 */ |
|
26 |
|
27 |
|
28 #ifndef MAUDIOSTREAMOBSERVER_H |
|
29 #define MAUDIOSTREAMOBSERVER_H |
|
30 |
|
31 #include <e32base.h> |
|
32 #include <a3f/a3fbase.h> |
|
33 #include <a3f/maudiostream.h> |
|
34 |
|
35 /** |
|
36 * An interface to a set of AudioStream callback functions. |
|
37 * |
|
38 * this serves as the method of communication between the client and the |
|
39 * AudioStream. |
|
40 * |
|
41 * The class is a mixin and is intended to be inherited by the client class |
|
42 * that is interested in observing the AudioStream operation. The functions |
|
43 * encapsulated by this class are called when specific events occur while |
|
44 * processing audio. |
|
45 */ |
|
46 class MAudioStreamObserver |
|
47 { |
|
48 public: |
|
49 /** |
|
50 * Handles audio stream state change event. |
|
51 * |
|
52 * @param aStream A reference to the stream whose state changed. |
|
53 * @param aReason A set of values describing why the state change occurred |
|
54 * corresponding to the system-wide error codes. The value will be KErrNone on successful calls. |
|
55 * @param aNewState indicating the state in which the audio stream has changed. |
|
56 */ |
|
57 virtual void StateEvent(MAudioStream& aStream , TInt aReason, TAudioState aNewState)=0; |
|
58 |
|
59 /** |
|
60 * Notifies that adding of processing unit to the stream has been completed successfully or otherwise. |
|
61 * |
|
62 * if the processing unit is added succesfully, then it must be removed from the |
|
63 * stream before the processing unit is removed from the context or before the stream is removed. |
|
64 * |
|
65 * @param aStream A reference to the stream to which the processing unit was added. |
|
66 * @param aInstance a pointer to the processing unit instance. |
|
67 * @param aError an error code. KErrNone on success. Otherwise one of the system wide error codes. |
|
68 */ |
|
69 virtual void AddProcessingUnitComplete(MAudioStream& aStream, MAudioProcessingUnit* aInstance, TInt aError)=0; |
|
70 |
|
71 /** |
|
72 * Notifies that removing of processing unit from the stream has been completed |
|
73 * successfully or otherwise. |
|
74 * |
|
75 * if the processing unit has been added succesfully, then it must be removed |
|
76 * from the stream, before the processing unit is removed from the |
|
77 * context or before the stream is removed. |
|
78 * |
|
79 * @param aStream A reference to the stream from which the processing unit has been removed. |
|
80 * @param aType the processing unit type. |
|
81 * @param aInstance a pointer to the processing unit instance. |
|
82 * @param aError an error code. KErrNone on success. Otherwise one of the system wide error codes. |
|
83 */ |
|
84 virtual void RemoveProcessingUnitComplete(MAudioStream& aStream, MAudioProcessingUnit* aInstance, TInt aError)=0; |
|
85 |
|
86 /** |
|
87 * Call-back indicating that is the last buffer has been processed by the sink. |
|
88 * |
|
89 * @param aStream A reference to the stream. |
|
90 */ |
|
91 virtual void ProcessingFinished (MAudioStream& aStream)=0; |
|
92 |
|
93 /** |
|
94 * Signals completion of a Flush() operation. |
|
95 * |
|
96 * @param aStream A reference to the stream on which Flush() was called. |
|
97 * @param aError an error code. KErrAbort if the associated stream has been unloaded, and the buffers cease to exist. |
|
98 */ |
|
99 virtual void FlushComplete (MAudioStream& aStream, TInt aError) = 0; |
|
100 |
|
101 }; |
|
102 |
|
103 #endif // MAUDIOSTREAMOBSERVER_H |