sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
#ifndef CDEVCOMMONCONTROL_H
|
sl@0
|
19 |
#define CDEVCOMMONCONTROL_H
|
sl@0
|
20 |
|
sl@0
|
21 |
#include "cdevaudiocontrol.h"
|
sl@0
|
22 |
#include <a3f/a3f_trace_utils.h>
|
sl@0
|
23 |
#include <a3f/maudioprocessingunitobserver.h>
|
sl@0
|
24 |
|
sl@0
|
25 |
/**
|
sl@0
|
26 |
* CDevCommonControl
|
sl@0
|
27 |
*
|
sl@0
|
28 |
* Common functionality required by:
|
sl@0
|
29 |
* CDevPlayControl
|
sl@0
|
30 |
* CDevRecordControl
|
sl@0
|
31 |
* CDevToneControl
|
sl@0
|
32 |
*
|
sl@0
|
33 |
* @lib mmfdevsoundadaptation.lib
|
sl@0
|
34 |
* @since
|
sl@0
|
35 |
*/
|
sl@0
|
36 |
|
sl@0
|
37 |
NONSHARABLE_CLASS(CDevCommonControl) : public CDevAudioControl,
|
sl@0
|
38 |
public MAudioProcessingUnitObserver
|
sl@0
|
39 |
{
|
sl@0
|
40 |
public:
|
sl@0
|
41 |
CDevCommonControl();
|
sl@0
|
42 |
~CDevCommonControl();
|
sl@0
|
43 |
|
sl@0
|
44 |
// from CDevAudioControl
|
sl@0
|
45 |
TInt Stop();
|
sl@0
|
46 |
TInt Pause();
|
sl@0
|
47 |
TInt Resume();
|
sl@0
|
48 |
|
sl@0
|
49 |
// from MAudioProcessingUnitObserver
|
sl@0
|
50 |
void StateEvent(MAudioStream& aStream, TInt aError, TAudioState aNewState);
|
sl@0
|
51 |
void ProcessingUnitError(MAudioProcessingUnit* aInstance, TInt aError);
|
sl@0
|
52 |
|
sl@0
|
53 |
// from MAudioContextObserver
|
sl@0
|
54 |
void ContextEvent(TUid aEvent, TInt aError);
|
sl@0
|
55 |
|
sl@0
|
56 |
protected:
|
sl@0
|
57 |
// methods introduced by this class
|
sl@0
|
58 |
virtual void FinishWithError(TInt aError) = 0;
|
sl@0
|
59 |
|
sl@0
|
60 |
private:
|
sl@0
|
61 |
// Internal functions which together implement CDevCommonControl::ContextEvent
|
sl@0
|
62 |
void ContextEventUpdateWithoutStateEventNoError();
|
sl@0
|
63 |
void ContextEventUpdateWithoutStateEventButWithError(TInt aError);
|
sl@0
|
64 |
void ContextEventUpdateWithStateEventNoError();
|
sl@0
|
65 |
void ContextEventStateDevSoundAdaptorLoading();
|
sl@0
|
66 |
void ContextEventStateDevSoundAdaptorUnloading();
|
sl@0
|
67 |
void ContextEventStateDevSoundAdaptorStopping();
|
sl@0
|
68 |
void ContextEventStateDevSoundAdaptorUninitializing();
|
sl@0
|
69 |
void ContextEventStateDevSoundAdaptorBeingPreempted();
|
sl@0
|
70 |
void ContextEventPauseResumeSequenceDueToEmptyBuffers(TBool aFlush);
|
sl@0
|
71 |
void ContextEventUpdateWithStateEventAndError(TInt aError);
|
sl@0
|
72 |
void ContextEventUpdateComplete(TInt aError);
|
sl@0
|
73 |
void ContextEventPreEmption(TUid aEvent, TInt aError);
|
sl@0
|
74 |
void ContextEventAbort(TInt aError);
|
sl@0
|
75 |
void ContextEventErrorStateDevSoundAdaptorActivating(TInt aError);
|
sl@0
|
76 |
void ContextEventErrorStateDevSoundAdaptorBeingPreempted();
|
sl@0
|
77 |
void ContextEventAsynchronousPlayCompletion(TInt aError);
|
sl@0
|
78 |
void ContextEventAsynchronousInitializeComplete(TInt aError);
|
sl@0
|
79 |
void ContextEventStopDevSoundNotifications();
|
sl@0
|
80 |
|
sl@0
|
81 |
private:
|
sl@0
|
82 |
TBool iBeingPreempted;
|
sl@0
|
83 |
TBool iPreemptionClash;
|
sl@0
|
84 |
};
|
sl@0
|
85 |
|
sl@0
|
86 |
#endif // CDEVCOMMONCONTROL_H
|
sl@0
|
87 |
|
sl@0
|
88 |
// end of file
|