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: Music Player now playing widget backend. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MPNOWPLAYINGBACKEND_H |
|
19 #define MPNOWPLAYINGBACKEND_H |
|
20 |
|
21 //includes |
|
22 #include <QObject> |
|
23 #include <QMetaType> |
|
24 |
|
25 //forward declartions |
|
26 class MpNowPlayingBackEndPrivate; |
|
27 |
|
28 enum SimplifiedPlayerState { |
|
29 NotPlaying, //When there is no source |
|
30 Playing, //When it is playing |
|
31 Paused //When is not in Playing State |
|
32 }; |
|
33 // Register so type can be used in signal and slot connection |
|
34 Q_DECLARE_METATYPE(SimplifiedPlayerState) |
|
35 |
|
36 //class declaration |
|
37 class MpNowPlayingBackEnd : public QObject |
|
38 { |
|
39 Q_OBJECT |
|
40 friend class MpNowPlayingBackEndPrivate; |
|
41 |
|
42 public: |
|
43 explicit MpNowPlayingBackEnd( long int playerId = 0 ); |
|
44 virtual ~MpNowPlayingBackEnd(); |
|
45 |
|
46 signals: |
|
47 void stateUpdate( SimplifiedPlayerState state ); |
|
48 void titleChanged( const QString &text ); |
|
49 void artistChanged( const QString &text ); |
|
50 |
|
51 public slots: |
|
52 void update(); |
|
53 void playPause(); |
|
54 |
|
55 private: |
|
56 Q_DISABLE_COPY(MpNowPlayingBackEnd) |
|
57 MpNowPlayingBackEndPrivate * const d_ptr; |
|
58 |
|
59 }; |
|
60 |
|
61 #endif // MPNOWPLAYINGBACKEND_H |
|