author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
parent 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 2 |
// All rights reserved. |
williamr@2 | 3 |
// This component and the accompanying materials are made available |
williamr@4 | 4 |
// under the terms of "Eclipse Public License v1.0" |
williamr@2 | 5 |
// which accompanies this distribution, and is available |
williamr@4 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 7 |
// |
williamr@2 | 8 |
// Initial Contributors: |
williamr@2 | 9 |
// Nokia Corporation - initial contribution. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// Contributors: |
williamr@2 | 12 |
// |
williamr@2 | 13 |
// Description: |
williamr@2 | 14 |
// |
williamr@2 | 15 |
|
williamr@2 | 16 |
#ifndef __MMFDATAPATHPROXY_H__ |
williamr@2 | 17 |
#define __MMFDATAPATHPROXY_H__ |
williamr@2 | 18 |
|
williamr@2 | 19 |
#include <e32base.h> |
williamr@2 | 20 |
#include <e32std.h> |
williamr@2 | 21 |
#include <ecom/ecom.h> |
williamr@2 | 22 |
#include <mmf/server/mmfdatapath.h> |
williamr@2 | 23 |
#include <mmf/server/mmfsubthreadbase.h> |
williamr@2 | 24 |
|
williamr@2 | 25 |
#define KMMFDataPathProxyVersion TVersion(8,0,0) |
williamr@2 | 26 |
|
williamr@2 | 27 |
/** |
williamr@2 | 28 |
The amount of time that is allowed for the datapath to close down before the its thread is killed. |
williamr@2 | 29 |
*/ |
williamr@2 | 30 |
#define KMMFDataPathProxyShutdownTimeout TTimeIntervalMicroSeconds32(10000000) |
williamr@2 | 31 |
|
williamr@2 | 32 |
|
williamr@2 | 33 |
/** |
williamr@2 | 34 |
@publishedAll |
williamr@2 | 35 |
@released |
williamr@2 | 36 |
|
williamr@2 | 37 |
Mixin class that the user of the class CMMFDataPathEventMonitor must derive from. |
williamr@2 | 38 |
|
williamr@2 | 39 |
@since 7.0s |
williamr@2 | 40 |
*/ |
williamr@2 | 41 |
class MMMFDataPathEventMonitorObserver |
williamr@2 | 42 |
{ |
williamr@2 | 43 |
public: |
williamr@2 | 44 |
|
williamr@2 | 45 |
/** |
williamr@2 | 46 |
Handles an event that has been generated by the datapath. |
williamr@2 | 47 |
|
williamr@2 | 48 |
Called by CMMFDataPathEventMonitor::RunL(). |
williamr@2 | 49 |
|
williamr@2 | 50 |
@param aEvent |
williamr@2 | 51 |
The event to be handled. |
williamr@2 | 52 |
|
williamr@2 | 53 |
@since 7.0s |
williamr@2 | 54 |
*/ |
williamr@2 | 55 |
virtual void HandleEvent(const TMMFEvent& aEvent) = 0; |
williamr@2 | 56 |
}; |
williamr@2 | 57 |
|
williamr@2 | 58 |
class RMMFDataPathProxy; //forward reference |
williamr@2 | 59 |
|
williamr@2 | 60 |
/** |
williamr@2 | 61 |
@publishedAll |
williamr@2 | 62 |
@released |
williamr@2 | 63 |
|
williamr@2 | 64 |
Active object utility class that can be used to monitor a datapath that is running in its own |
williamr@2 | 65 |
thread for events. If an event occurs, the client will be notified via the |
williamr@2 | 66 |
MMMFDataPathEventMonitorObserver interface. |
williamr@2 | 67 |
|
williamr@2 | 68 |
@since 7.0s |
williamr@2 | 69 |
*/ |
williamr@2 | 70 |
class CMMFDataPathEventMonitor : public CActive |
williamr@2 | 71 |
{ |
williamr@2 | 72 |
public: |
williamr@2 | 73 |
|
williamr@2 | 74 |
IMPORT_C static CMMFDataPathEventMonitor* NewL(MMMFDataPathEventMonitorObserver& aObserver, |
williamr@2 | 75 |
RMMFDataPathProxy& aMMFDataPathProxy); |
williamr@2 | 76 |
|
williamr@2 | 77 |
IMPORT_C ~CMMFDataPathEventMonitor(); |
williamr@2 | 78 |
|
williamr@2 | 79 |
IMPORT_C void Start(); |
williamr@2 | 80 |
|
williamr@2 | 81 |
IMPORT_C void RunL(); |
williamr@2 | 82 |
protected: |
williamr@2 | 83 |
|
williamr@2 | 84 |
void DoCancel(); |
williamr@2 | 85 |
private: |
williamr@2 | 86 |
|
williamr@2 | 87 |
/** |
williamr@2 | 88 |
Constructs a datapath event monitor object. |
williamr@2 | 89 |
|
williamr@2 | 90 |
@param aObserver |
williamr@2 | 91 |
A reference to the observer of the active object. The observer will be |
williamr@2 | 92 |
notified when an event occurs. |
williamr@2 | 93 |
@param aMMFDataPathProxy |
williamr@2 | 94 |
A reference to the datapath proxy class. |
williamr@2 | 95 |
|
williamr@2 | 96 |
@since 7.0s |
williamr@2 | 97 |
*/ |
williamr@2 | 98 |
CMMFDataPathEventMonitor(MMMFDataPathEventMonitorObserver& aObserver, |
williamr@2 | 99 |
RMMFDataPathProxy& aMMFDataPathProxy); |
williamr@2 | 100 |
private: |
williamr@2 | 101 |
MMMFDataPathEventMonitorObserver& iObserver; |
williamr@2 | 102 |
RMMFDataPathProxy& iMMFDataPathProxy; |
williamr@2 | 103 |
TMMFEventPckg iEventPckg; |
williamr@2 | 104 |
}; |
williamr@2 | 105 |
|
williamr@2 | 106 |
/** |
williamr@2 | 107 |
@publishedAll |
williamr@2 | 108 |
@released |
williamr@2 | 109 |
|
williamr@2 | 110 |
Proxy class used to create a datapath in a new subthread. |
williamr@2 | 111 |
*/ |
williamr@2 | 112 |
class RMMFDataPathProxy : public RMMFSubThreadBase |
williamr@2 | 113 |
|
williamr@2 | 114 |
{ |
williamr@2 | 115 |
public: |
williamr@2 | 116 |
|
williamr@2 | 117 |
/** |
williamr@2 | 118 |
Constuctor. |
williamr@2 | 119 |
*/ |
williamr@2 | 120 |
RMMFDataPathProxy() : RMMFSubThreadBase(KMMFDataPathProxyShutdownTimeout) {}; |
williamr@2 | 121 |
|
williamr@2 | 122 |
IMPORT_C TInt CreateSubThread(); |
williamr@2 | 123 |
|
williamr@2 | 124 |
IMPORT_C TInt LoadDataPath(); |
williamr@2 | 125 |
|
williamr@2 | 126 |
IMPORT_C TInt LoadDataPath(TMediaId aMediaId); |
williamr@2 | 127 |
|
williamr@2 | 128 |
IMPORT_C TInt LoadDataPath(TUid aCodecUid); |
williamr@2 | 129 |
|
williamr@2 | 130 |
IMPORT_C TInt LoadDataPath(TUid aCodecUid, TMediaId aMediaId); |
williamr@2 | 131 |
|
williamr@2 | 132 |
IMPORT_C TInt AddDataSource(MDataSource* aSource); |
williamr@2 | 133 |
|
williamr@2 | 134 |
IMPORT_C TInt AddDataSink(MDataSink* aSink); |
williamr@2 | 135 |
|
williamr@2 | 136 |
IMPORT_C TInt Prime(); |
williamr@2 | 137 |
|
williamr@2 | 138 |
IMPORT_C TInt Play(); |
williamr@2 | 139 |
|
williamr@2 | 140 |
IMPORT_C TInt Pause(); |
williamr@2 | 141 |
|
williamr@2 | 142 |
IMPORT_C TInt Stop(); |
williamr@2 | 143 |
|
williamr@2 | 144 |
IMPORT_C TInt GetPosition(TTimeIntervalMicroSeconds& aPosition) const; |
williamr@2 | 145 |
|
williamr@2 | 146 |
IMPORT_C TInt SetPosition(const TTimeIntervalMicroSeconds& aPosition); |
williamr@2 | 147 |
|
williamr@2 | 148 |
IMPORT_C TInt SetPlayWindow( const TTimeIntervalMicroSeconds& aStart, const TTimeIntervalMicroSeconds& aEnd ) ; |
williamr@2 | 149 |
|
williamr@2 | 150 |
IMPORT_C TInt ClearPlayWindow() ; |
williamr@2 | 151 |
|
williamr@2 | 152 |
IMPORT_C TInt State( TInt& aState ) ; |
williamr@2 | 153 |
|
williamr@2 | 154 |
IMPORT_C void Close(); |
williamr@2 | 155 |
}; |
williamr@2 | 156 |
|
williamr@4 | 157 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
williamr@4 | 158 |
#include <mmf/server/mmfdatapathproxyserver.h> |
williamr@4 | 159 |
#endif |
williamr@2 | 160 |
|
williamr@2 | 161 |
#endif |
williamr@4 | 162 |