sl@0: /* sl@0: * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: sl@0: #ifndef MAUDIOSTREAMOBSERVER_H sl@0: #define MAUDIOSTREAMOBSERVER_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: * An interface to a set of AudioStream callback functions. sl@0: * sl@0: * this serves as the method of communication between the client and the sl@0: * AudioStream. sl@0: * sl@0: * The class is a mixin and is intended to be inherited by the client class sl@0: * that is interested in observing the AudioStream operation. The functions sl@0: * encapsulated by this class are called when specific events occur while sl@0: * processing audio. sl@0: */ sl@0: class MAudioStreamObserver sl@0: { sl@0: public: sl@0: /** sl@0: * Handles audio stream state change event. sl@0: * sl@0: * @param aStream A reference to the stream whose state changed. sl@0: * @param aReason A set of values describing why the state change occurred sl@0: * corresponding to the system-wide error codes. The value will be KErrNone on successful calls. sl@0: * @param aNewState indicating the state in which the audio stream has changed. sl@0: */ sl@0: virtual void StateEvent(MAudioStream& aStream , TInt aReason, TAudioState aNewState)=0; sl@0: sl@0: /** sl@0: * Notifies that adding of processing unit to the stream has been completed successfully or otherwise. sl@0: * sl@0: * if the processing unit is added succesfully, then it must be removed from the sl@0: * stream before the processing unit is removed from the context or before the stream is removed. sl@0: * sl@0: * @param aStream A reference to the stream to which the processing unit was added. sl@0: * @param aInstance a pointer to the processing unit instance. sl@0: * @param aError an error code. KErrNone on success. Otherwise one of the system wide error codes. sl@0: */ sl@0: virtual void AddProcessingUnitComplete(MAudioStream& aStream, MAudioProcessingUnit* aInstance, TInt aError)=0; sl@0: sl@0: /** sl@0: * Notifies that removing of processing unit from the stream has been completed sl@0: * successfully or otherwise. sl@0: * sl@0: * if the processing unit has been added succesfully, then it must be removed sl@0: * from the stream, before the processing unit is removed from the sl@0: * context or before the stream is removed. sl@0: * sl@0: * @param aStream A reference to the stream from which the processing unit has been removed. sl@0: * @param aType the processing unit type. sl@0: * @param aInstance a pointer to the processing unit instance. sl@0: * @param aError an error code. KErrNone on success. Otherwise one of the system wide error codes. sl@0: */ sl@0: virtual void RemoveProcessingUnitComplete(MAudioStream& aStream, MAudioProcessingUnit* aInstance, TInt aError)=0; sl@0: sl@0: /** sl@0: * Call-back indicating that is the last buffer has been processed by the sink. sl@0: * sl@0: * @param aStream A reference to the stream. sl@0: */ sl@0: virtual void ProcessingFinished (MAudioStream& aStream)=0; sl@0: sl@0: /** sl@0: * Signals completion of a Flush() operation. sl@0: * sl@0: * @param aStream A reference to the stream on which Flush() was called. sl@0: * @param aError an error code. KErrAbort if the associated stream has been unloaded, and the buffers cease to exist. sl@0: */ sl@0: virtual void FlushComplete (MAudioStream& aStream, TInt aError) = 0; sl@0: sl@0: }; sl@0: sl@0: #endif // MAUDIOSTREAMOBSERVER_H