1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/a3facf/inc/maudiostreamobserver.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,103 @@
1.4 +/*
1.5 +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +
1.24 +/**
1.25 + @file
1.26 + @publishedPartner
1.27 + @released
1.28 +*/
1.29 +
1.30 +
1.31 +#ifndef MAUDIOSTREAMOBSERVER_H
1.32 +#define MAUDIOSTREAMOBSERVER_H
1.33 +
1.34 +#include <e32base.h>
1.35 +#include <a3f/a3fbase.h>
1.36 +#include <a3f/maudiostream.h>
1.37 +
1.38 +/**
1.39 + * An interface to a set of AudioStream callback functions.
1.40 + *
1.41 + * this serves as the method of communication between the client and the
1.42 + * AudioStream.
1.43 + *
1.44 + * The class is a mixin and is intended to be inherited by the client class
1.45 + * that is interested in observing the AudioStream operation. The functions
1.46 + * encapsulated by this class are called when specific events occur while
1.47 + * processing audio.
1.48 + */
1.49 +class MAudioStreamObserver
1.50 + {
1.51 +public:
1.52 + /**
1.53 + * Handles audio stream state change event.
1.54 + *
1.55 + * @param aStream A reference to the stream whose state changed.
1.56 + * @param aReason A set of values describing why the state change occurred
1.57 + * corresponding to the system-wide error codes. The value will be KErrNone on successful calls.
1.58 + * @param aNewState indicating the state in which the audio stream has changed.
1.59 + */
1.60 + virtual void StateEvent(MAudioStream& aStream , TInt aReason, TAudioState aNewState)=0;
1.61 +
1.62 + /**
1.63 + * Notifies that adding of processing unit to the stream has been completed successfully or otherwise.
1.64 + *
1.65 + * if the processing unit is added succesfully, then it must be removed from the
1.66 + * stream before the processing unit is removed from the context or before the stream is removed.
1.67 + *
1.68 + * @param aStream A reference to the stream to which the processing unit was added.
1.69 + * @param aInstance a pointer to the processing unit instance.
1.70 + * @param aError an error code. KErrNone on success. Otherwise one of the system wide error codes.
1.71 + */
1.72 + virtual void AddProcessingUnitComplete(MAudioStream& aStream, MAudioProcessingUnit* aInstance, TInt aError)=0;
1.73 +
1.74 + /**
1.75 + * Notifies that removing of processing unit from the stream has been completed
1.76 + * successfully or otherwise.
1.77 + *
1.78 + * if the processing unit has been added succesfully, then it must be removed
1.79 + * from the stream, before the processing unit is removed from the
1.80 + * context or before the stream is removed.
1.81 + *
1.82 + * @param aStream A reference to the stream from which the processing unit has been removed.
1.83 + * @param aType the processing unit type.
1.84 + * @param aInstance a pointer to the processing unit instance.
1.85 + * @param aError an error code. KErrNone on success. Otherwise one of the system wide error codes.
1.86 + */
1.87 + virtual void RemoveProcessingUnitComplete(MAudioStream& aStream, MAudioProcessingUnit* aInstance, TInt aError)=0;
1.88 +
1.89 + /**
1.90 + * Call-back indicating that is the last buffer has been processed by the sink.
1.91 + *
1.92 + * @param aStream A reference to the stream.
1.93 + */
1.94 + virtual void ProcessingFinished (MAudioStream& aStream)=0;
1.95 +
1.96 + /**
1.97 + * Signals completion of a Flush() operation.
1.98 + *
1.99 + * @param aStream A reference to the stream on which Flush() was called.
1.100 + * @param aError an error code. KErrAbort if the associated stream has been unloaded, and the buffers cease to exist.
1.101 + */
1.102 + virtual void FlushComplete (MAudioStream& aStream, TInt aError) = 0;
1.103 +
1.104 + };
1.105 +
1.106 +#endif // MAUDIOSTREAMOBSERVER_H