|
1 /* |
|
2 * Copyright (c) 2009 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 #ifndef IRQMEDIAPLAYER_H_ |
|
18 #define IRQMEDIAPLAYER_H_ |
|
19 |
|
20 #include <QObject> |
|
21 #include "irqenums.h" |
|
22 |
|
23 class IRQPlayerAdapterInterface; |
|
24 class IRQMetaData; |
|
25 class CStereoWidening; |
|
26 |
|
27 /** |
|
28 * This class provides the interface to IR Media Player component |
|
29 */ |
|
30 |
|
31 class IRQMediaPlayer : public QObject |
|
32 { |
|
33 Q_OBJECT |
|
34 |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Constructor |
|
39 */ |
|
40 IMPORT_C IRQMediaPlayer(); |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 ~IRQMediaPlayer(); |
|
46 |
|
47 /** |
|
48 * Returns the current volume of playback, it's a percentage |
|
49 * @return int |
|
50 */ |
|
51 IMPORT_C int getVolume(); |
|
52 |
|
53 public slots: |
|
54 |
|
55 /** |
|
56 * Plays a radio station |
|
57 */ |
|
58 IMPORT_C void playStation(const QString &aUrl, int aApId); |
|
59 |
|
60 /** |
|
61 * Stops playback |
|
62 */ |
|
63 IMPORT_C void stop(); |
|
64 |
|
65 /** |
|
66 * Sets the volume to player, it's a percentage |
|
67 */ |
|
68 IMPORT_C void setVolume(int aVolume); |
|
69 |
|
70 /** |
|
71 * Turns on the stereo effect |
|
72 */ |
|
73 IMPORT_C void enableStereoEffect(); |
|
74 |
|
75 /** |
|
76 * Turns off the stereo effect |
|
77 */ |
|
78 IMPORT_C void disableStereoEffect(); |
|
79 |
|
80 signals: |
|
81 |
|
82 /** |
|
83 * Notifies the successful connection with a radio station |
|
84 */ |
|
85 void connectionEstablished(int aBitrate); |
|
86 |
|
87 /** |
|
88 * Notifies the error |
|
89 */ |
|
90 void errorOccured(IRQError aError); |
|
91 |
|
92 /** |
|
93 * Notifies the buffering status |
|
94 */ |
|
95 void percentageBuffered(int aPercentage); |
|
96 |
|
97 /** |
|
98 * Notifies the meta data |
|
99 */ |
|
100 void metaDataReceived(IRQMetaData& aIRMetaData); |
|
101 |
|
102 /** |
|
103 * Gets the preset volume, it's a percentage |
|
104 */ |
|
105 void volumeExpected(int& aVolume); |
|
106 |
|
107 private: |
|
108 /** |
|
109 * Turns on the stereo effect |
|
110 */ |
|
111 void enableStereoEffectL(); |
|
112 |
|
113 private: |
|
114 |
|
115 /** |
|
116 * Player adpater interface |
|
117 */ |
|
118 IRQPlayerAdapterInterface* iPlayer; |
|
119 |
|
120 /** |
|
121 * Used for handling Stereo Mode |
|
122 */ |
|
123 CStereoWidening* iStereoEffect; |
|
124 }; |
|
125 |
|
126 #endif /* IRQMEDIAPLAYER_H_ */ |