|
1 /* |
|
2 * Copyright (c) 2007 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <DrmAudioSamplePlayer.h> |
|
20 |
|
21 #include "DRMPlayServerTest.h" |
|
22 |
|
23 #ifdef __WINS__ |
|
24 _LIT( KTestFile, "c:\\data\\drm\\test.wma" ); |
|
25 #else |
|
26 _LIT( KTestFile, "e:\\drm\\test.wma" ); |
|
27 #endif |
|
28 |
|
29 // ================= MEMBER FUNCTIONS ========================================== |
|
30 |
|
31 CDRMPlayServerTest::CDRMPlayServerTest() |
|
32 { |
|
33 } |
|
34 |
|
35 |
|
36 void CDRMPlayServerTest::ConstructL() |
|
37 { |
|
38 iWait = new (ELeave) CActiveSchedulerWait(); |
|
39 iDrmPlayerUtility = CDrmPlayerUtility::NewL( *this, |
|
40 0, |
|
41 EMdaPriorityPreferenceNone ); |
|
42 } |
|
43 |
|
44 CDRMPlayServerTest::~CDRMPlayServerTest() |
|
45 { |
|
46 delete iWait; |
|
47 delete iDrmPlayerUtility; |
|
48 } |
|
49 |
|
50 CDRMPlayServerTest* CDRMPlayServerTest::NewLC() |
|
51 { |
|
52 CDRMPlayServerTest* self = new( ELeave ) CDRMPlayServerTest(); |
|
53 CleanupStack::PushL( self ); |
|
54 self->ConstructL(); |
|
55 return self; |
|
56 } |
|
57 |
|
58 TInt CDRMPlayServerTest::ExecutePlayServerTest() |
|
59 { |
|
60 iError = KErrNone; |
|
61 TRAP( iError, iDrmPlayerUtility->OpenFileL( KTestFile ) ); |
|
62 if ( iError ) |
|
63 { |
|
64 return iError; |
|
65 } |
|
66 iWait->Start(); |
|
67 return iError; |
|
68 } |
|
69 |
|
70 void CDRMPlayServerTest::MdapcInitComplete( |
|
71 TInt aError, |
|
72 const TTimeIntervalMicroSeconds& /*aDuration*/ ) |
|
73 { |
|
74 iWait->AsyncStop(); |
|
75 iError = aError; |
|
76 } |
|
77 |
|
78 void CDRMPlayServerTest::MdapcPlayComplete( TInt aError ) |
|
79 { |
|
80 iWait->AsyncStop(); |
|
81 iError = aError; |
|
82 } |
|
83 |
|
84 // End of File |
|
85 |