|
1 /* |
|
2 * Copyright (c) 2005 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: Manipulates the priority of a Player. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAMMSPRIORITYCONTROL_H |
|
20 #define CAMMSPRIORITYCONTROL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "cammscontrol.h" |
|
24 #include <mmmaplayerstatelistener.h> |
|
25 |
|
26 // CONSTANTS |
|
27 _LIT(KAMMSPriorityControl, "PriorityControl"); |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * |
|
33 * Controls for the priority. |
|
34 * This class delegates priority setting calls to RMMFController. |
|
35 * |
|
36 * |
|
37 * @since 3.0 |
|
38 */ |
|
39 NONSHARABLE_CLASS(CAMMSPriorityControl) |
|
40 : public CAMMSControl, public MMMAPlayerStateListener |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * @param aPlayer Player that has this control. |
|
47 */ |
|
48 static CAMMSPriorityControl* NewLC(CMMAPlayer* aPlayer); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 ~CAMMSPriorityControl(); |
|
54 |
|
55 public: // New functions |
|
56 |
|
57 /** |
|
58 * Sets the priority. |
|
59 * |
|
60 * @param aPriority The new priority to be set. |
|
61 */ |
|
62 void SetPriorityL(TInt aPriority); |
|
63 |
|
64 /** |
|
65 * Gets the priority. |
|
66 * |
|
67 * @return The set priority. |
|
68 */ |
|
69 TInt Priority(); |
|
70 |
|
71 public: // From MMMAPlayerStateListener |
|
72 |
|
73 void StateChanged(TInt aState); |
|
74 |
|
75 public: // Functions from base classes |
|
76 |
|
77 const TDesC& ClassName() const; |
|
78 |
|
79 protected: // New functions |
|
80 |
|
81 /** |
|
82 * Scales the given AMMS priority to MMF priority |
|
83 * and sets it to MMF if the priority has changed. |
|
84 * @param aAmmsPriority AMMS priority to be set. |
|
85 */ |
|
86 void SetPriorityToMmfL(TInt aAmmsPriority); |
|
87 |
|
88 private: |
|
89 /** |
|
90 * C++ constructor. |
|
91 * @param aPlayer Player that has this control. |
|
92 */ |
|
93 CAMMSPriorityControl(CMMAPlayer* aPlayer); |
|
94 |
|
95 /** |
|
96 * Symbian 2nd phase constructor. |
|
97 */ |
|
98 void ConstructL(); |
|
99 |
|
100 private: // data |
|
101 |
|
102 // Priority cannot be set if player is REALIZED. The priority is set |
|
103 // when the player is prefetched. |
|
104 |
|
105 TInt iVisiblePriority; // Priority visible in AMMS. |
|
106 |
|
107 TInt iActualPriority; // Priority set in MMF. |
|
108 |
|
109 }; |
|
110 |
|
111 #endif // CAMMSPRIORITYCONTROL_H |
|
112 |
|
113 |