|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CHUNKPROCESSOR_H__ |
|
17 |
|
18 #define __CHUNKPROCESSOR_H__ |
|
19 /** @file |
|
20 @internalTechnology */ |
|
21 |
|
22 class MInputStream; |
|
23 class CMngPlayer; |
|
24 union TChunkId; |
|
25 |
|
26 class MChunkProcessor |
|
27 { |
|
28 public: |
|
29 virtual TBool OfferChunkType(const TChunkId& aChunkId)=0; |
|
30 virtual void Start(MInputStream& aInputStream, TRequestStatus& aRequest)=0; |
|
31 virtual void Stop()=0; |
|
32 virtual void Pause()=0; |
|
33 virtual void Resume()=0; |
|
34 |
|
35 virtual TInt AddSubProcessor(MChunkProcessor& aSubProcessor)=0; |
|
36 }; |
|
37 |
|
38 |
|
39 class CChunkProcessor: protected CActive, public MChunkProcessor |
|
40 { |
|
41 public: |
|
42 |
|
43 // from MChunkProcessor |
|
44 void Stop(); |
|
45 void Pause(); |
|
46 void Resume(); |
|
47 |
|
48 protected: |
|
49 CChunkProcessor(CMngPlayer& aMngPlayer); |
|
50 |
|
51 void NotifyCaller(TInt aErrCode); |
|
52 |
|
53 virtual void DoRunL()=0; |
|
54 void DoCancel(); |
|
55 TInt RunError(TInt aError); |
|
56 void RunL(); |
|
57 |
|
58 void RunAgain(); |
|
59 |
|
60 protected: |
|
61 MInputStream* iInputStream; |
|
62 TRequestStatus* iCallerRequest; |
|
63 MChunkProcessor* iSubProcessor; |
|
64 CMngPlayer& iMngPlayer; |
|
65 TBool iIsPaused; |
|
66 TBool iNeedRunAfterResume; |
|
67 }; |
|
68 |
|
69 #endif // ndef __CHUNKPROCESSOR_H__ |