|
1 #ifndef SVPBENGINE_H |
|
2 #define SVPBENGINE_H |
|
3 |
|
4 #include <qobject> |
|
5 #include <mpxplaybackobserver.h> |
|
6 #include "svpbsurfacecontainer.h" |
|
7 |
|
8 class MMPXPlaybackUtility; |
|
9 |
|
10 enum SvpbEngineState |
|
11 { |
|
12 Disconnected = 0, |
|
13 Connected, // == Stopped |
|
14 Initializing, |
|
15 MediaRequested, |
|
16 PlayRequested, |
|
17 Playing, |
|
18 PauseRequested, |
|
19 Paused, |
|
20 StopRequested |
|
21 }; |
|
22 |
|
23 class SvpbEngine : public QObject, |
|
24 public MMPXPlaybackObserver, |
|
25 public MMPXPlaybackCallback |
|
26 { |
|
27 Q_OBJECT |
|
28 |
|
29 public: |
|
30 SvpbEngine(QObject *parent=0); |
|
31 virtual ~SvpbEngine(); |
|
32 |
|
33 void connectMPX(); |
|
34 void disconnectMPX(); |
|
35 |
|
36 void setSurfaceContainer(SvpbSurfaceContainer *surfaceContainer); |
|
37 |
|
38 signals: |
|
39 void finished(); |
|
40 |
|
41 public slots: |
|
42 void togglePause(); |
|
43 void stop(); |
|
44 |
|
45 private: // From MMPXPlaybackObserver |
|
46 void HandlePlaybackMessage(CMPXMessage* aMessage, TInt aErr); |
|
47 |
|
48 private: // from MMPXPlaybackCallback |
|
49 void HandlePropertyL(TMPXPlaybackProperty aProperty, TInt aValue, TInt aError); |
|
50 void HandleSubPlayerNamesL(TUid aPlayer, const MDesCArray* aSubPlayers, |
|
51 TBool aComplete, TInt aError); |
|
52 void HandleMediaL(const CMPXMedia& aProperties, TInt aError); |
|
53 |
|
54 private: |
|
55 void mpxPbStateChanged(TMPXPlaybackState type, int err); |
|
56 void requestMedia(); |
|
57 |
|
58 private: // data |
|
59 SvpbSurfaceContainer *mSurfaceContainer; |
|
60 SvpbEngineState mState; |
|
61 MMPXPlaybackUtility *mPlaybackUtility; |
|
62 TMPXPlaybackState mMpxPbState; |
|
63 }; |
|
64 |
|
65 #endif // SVPBENGINE_H |