|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Progressive Download Utility |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __PDPROPERTIES_H__ |
|
21 #define __PDPROPERTIES_H__ |
|
22 |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 #include <f32file.h> |
|
26 #include "AudioPdPlayUtility.h" |
|
27 |
|
28 //Forward Declaration |
|
29 |
|
30 |
|
31 class CPdProperties :public CBase, |
|
32 public MAudioPdPlayUtilityCallback |
|
33 { |
|
34 public: |
|
35 |
|
36 IMPORT_C static CPdProperties* NewL(); |
|
37 IMPORT_C static CPdProperties* NewLC(); |
|
38 |
|
39 IMPORT_C ~CPdProperties(); |
|
40 |
|
41 IMPORT_C CAudioPdPlayUtility* OpenL(const TDesC& aFileName,MAudioPdPlayUtilityCallback& aCallback); |
|
42 IMPORT_C CAudioPdPlayUtility* OpenL(const RFile& aFileHandle,MAudioPdPlayUtilityCallback& aCallback); |
|
43 |
|
44 private: |
|
45 CPdProperties(); |
|
46 void ConstructL(); |
|
47 void HandleDownloadEventL(TUint aTransactionID, |
|
48 TBrCtlDownloadEvent aEvent, |
|
49 TUint aValue); |
|
50 |
|
51 TInt CalculatePercentageDownloaded(); |
|
52 void SavePosition(); |
|
53 void HandleDownloadUpdateL(); |
|
54 |
|
55 // This function is no where used. Remove it. |
|
56 //void StartPaused(); |
|
57 void StartPlaying(); |
|
58 |
|
59 void Playing(); |
|
60 void Paused(); |
|
61 |
|
62 //From MMdaAudioPlayerCallback |
|
63 void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration); |
|
64 void MapcPlayComplete(TInt aError); |
|
65 |
|
66 enum TState |
|
67 { |
|
68 EStopped, |
|
69 /*EOpening,*/ |
|
70 /*EPaused,*/ |
|
71 EStoppedAutoResume, /* State which will automatically re-start playback*/ |
|
72 EPlaying |
|
73 }; |
|
74 |
|
75 TTimeIntervalMicroSeconds iTimePosition; |
|
76 MAudioPdPlayUtilityCallback* iCallback; |
|
77 CAudioPdPlayUtility* iAudioPdPlayUtility; |
|
78 HBufC* iFileName; |
|
79 RFile iFileHandle; |
|
80 TBool iFileOpened; |
|
81 TInt iAttemptsToOpen; |
|
82 TBool iUseFileHandle; |
|
83 //TInt iError; /* Not used */ |
|
84 TInt iFileSize; |
|
85 TInt iBytesDownloaded; |
|
86 TInt iFileBytePosition; |
|
87 TBool iDownloadCompleted; |
|
88 enum TState iState; |
|
89 TInt iPercentageToBuffer; |
|
90 TBool iOpenInProgress; |
|
91 }; |
|
92 |
|
93 #endif |
|
94 |
|
95 // End of file |