Update contrib.
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
21 #ifndef CDEVTONECONTROL_H
22 #define CDEVTONECONTROL_H
26 #include "cdevcommoncontrol.h"
28 #include <a3f/maudiodatasupplier.h>
29 #include <a3f/maudioprocessingunitobserver.h>
30 #include <a3f/tonedata.h>
31 #include <a3f/a3f_trace_utils.h>
34 class MMMFBufferSource;
41 * @lib mmfdevsoundadaptation.lib
44 NONSHARABLE_CLASS(CDevToneControl) :public CDevCommonControl,
45 public MMMFAudioDataSupplier
51 * Releases all resources and deletes all objects owned by this instance.
55 static CDevToneControl* NewL(CDevAudio* aDevAudio, MDevSoundAdaptationObserver& aDevSoundObserver);
57 void ConstructL(CDevAudio* aDevAudio, MDevSoundAdaptationObserver& aDevSoundObserver);
59 // from base class CDevAudioControl
62 * Initialize playing state control components
66 virtual TInt Initialize(TUid aFormat);
69 * Initializes and starts the wanted operation (Play, Record, TonePlay).
73 virtual TInt ProcessInit();
76 * Processes the data (PlayData, RecordData).
80 virtual void ProcessData();
82 // from base class MMMFAudioDataSupplier
84 * Request a buffer to be filled with audio data by the data supplier.
86 * The supplier should fill the buffer as quickly as possible and then call
87 * MBufferSource::BufferFilled() passing the filled buffer as a parameter.
89 * @param aSource a pointer to the source requesting the buffer
90 * @param aBuffer a pointer to the buffer to fill
92 virtual void BufferToBeFilled(MMMFBufferSource* aSource, CMMFBuffer* aBuffer);
95 * Indicates that all buffers previously requested by this source have become
96 * invalid and must not be used.
98 * @param aSource the source whose previous buffer requests should be ignored.
100 virtual void DiscardBuffers(MMMFBufferSource* aSource);
103 * Indicates that last buffer has been processed
106 * @param aSource the source
109 void ProcessingFinished(MAudioStream& /*aStream*/);
112 * Saves tonedata for later use
113 * This includes information about tone type, data, length, etc.
119 TInt SetToneData(TToneData& aToneData);
122 // from CDevCommonControl
123 void FinishWithError(TInt aError);
126 * Called when a ProcessingFinished callback is received
129 * @param TBool& aAyncCompletion
130 * @return an error code KErrNone if successful
132 virtual TInt ProcessingFinishedReceived(TBool& aAyncCompletion);
134 virtual TInt ProcessingError(TBool& aAyncCompletion);
142 * Casted convenience pointer to DevAudio::iAudioSource
145 MMMFBufferSource *iBufferSource;
148 * Information about tone.
154 #endif // CDEVTONECONTROL_H