|
1 /* |
|
2 * Copyright (c) 2010 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 Files |
|
20 #include "LogPlayerTimer.h" |
|
21 |
|
22 // Contants |
|
23 // None |
|
24 |
|
25 // ========================= MEMBER FUNCTIONS ================================== |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CLogPlayerTimer::NewL() |
|
29 // Two-phased constructor. |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CLogPlayerTimer* CLogPlayerTimer::NewL(MLogPlayerTimeCallback* aCallback) |
|
33 { |
|
34 CLogPlayerTimer* logPlayerTimer = CLogPlayerTimer::NewLC(aCallback); |
|
35 CleanupStack::Pop(logPlayerTimer); |
|
36 return logPlayerTimer; |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CLogPlayerTimer::NewLC() |
|
41 // Two-phased constructor. |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 CLogPlayerTimer* CLogPlayerTimer::NewLC(MLogPlayerTimeCallback* aCallback) |
|
45 { |
|
46 CLogPlayerTimer* logPlayerTimer = new (ELeave) CLogPlayerTimer(aCallback); |
|
47 CleanupStack::PushL(logPlayerTimer); |
|
48 logPlayerTimer->ConstructL(); |
|
49 return logPlayerTimer; |
|
50 } |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CLogPlayerTimer::~CLogPlayerTimer() |
|
54 // Destructor. |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 CLogPlayerTimer::~CLogPlayerTimer() |
|
58 { |
|
59 } |
|
60 |
|
61 void CLogPlayerTimer::RunL() |
|
62 { |
|
63 iTimer->TimerCallback(); |
|
64 } |
|
65 |
|
66 void CLogPlayerTimer::StartTimer(const TTime& aTime) |
|
67 { |
|
68 At(aTime); |
|
69 } |
|
70 // ----------------------------------------------------------------------------- |
|
71 // CLogPlayerTimer::CLogPlayerTimer() |
|
72 // C++ default constructor can NOT contain any code, that might leave. |
|
73 // ----------------------------------------------------------------------------- |
|
74 // |
|
75 CLogPlayerTimer::CLogPlayerTimer(MLogPlayerTimeCallback* aTimer) |
|
76 : CTimer(EPriorityStandard), iTimer(aTimer) |
|
77 { |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CLogPlayerTimer::ConstructL() |
|
82 // Symbian 2nd phase constructor can leave. |
|
83 // ----------------------------------------------------------------------------- |
|
84 // |
|
85 void CLogPlayerTimer::ConstructL() |
|
86 { |
|
87 CTimer::ConstructL(); |
|
88 CActiveScheduler::Add(this); |
|
89 } |