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 #include "mpnowplayingbackend.h" |
|
19 #include "mpnowplayingbackend_p.h" |
|
20 #include "mptrace.h" |
|
21 |
|
22 /*! |
|
23 \internal |
|
24 \class MpNowPlayingBackEnd |
|
25 \brief Wraps the playback utility and provides separation for QT and Symbian code. |
|
26 |
|
27 This class wraps the playback utility on the MPX Framework to provide a simple |
|
28 interface and separation of QT and Symbian code. |
|
29 */ |
|
30 |
|
31 /*! |
|
32 \internal |
|
33 \fn MpNowPlayingBackEnd::stateUpdate( SimplifiedPlayerState state ) |
|
34 |
|
35 MpNowPlayingBackEndPrivate emits this signal when the simplified playback |
|
36 state changes. |
|
37 */ |
|
38 |
|
39 /*! |
|
40 \internal |
|
41 \fn MpNowPlayingBackEnd::titleChanged( const QString &text ) |
|
42 |
|
43 MpNowPlayingBackEndPrivate emits this signal when there is a new song |
|
44 playing and the title becomes available. |
|
45 */ |
|
46 |
|
47 /*! |
|
48 \internal |
|
49 \fn MpNowPlayingBackEnd::artistChanged( const QString &text ) |
|
50 |
|
51 MpNowPlayingBackEndPrivate emits this signal when there is a new song |
|
52 playing and the artist name becomes available. |
|
53 */ |
|
54 |
|
55 /*! |
|
56 \internal |
|
57 \enum SimplifiedPlayerState |
|
58 |
|
59 This enum defines a set of simplified playback states. |
|
60 */ |
|
61 |
|
62 /*! |
|
63 \internal |
|
64 Constructs the now playing back end. |
|
65 */ |
|
66 MpNowPlayingBackEnd::MpNowPlayingBackEnd( long int playerId ) |
|
67 :d_ptr( new MpNowPlayingBackEndPrivate( playerId, this ) ) |
|
68 { |
|
69 TX_ENTRY_ARGS( "Player ID =" << playerId ) |
|
70 TX_EXIT |
|
71 } |
|
72 |
|
73 /*! |
|
74 \internal |
|
75 Destructs the now playing back end. |
|
76 */ |
|
77 MpNowPlayingBackEnd::~MpNowPlayingBackEnd() |
|
78 { |
|
79 TX_ENTRY |
|
80 delete d_ptr; |
|
81 TX_EXIT |
|
82 } |
|
83 |
|
84 /*! |
|
85 \internal |
|
86 Updates the widget with the latest playback information. |
|
87 */ |
|
88 void MpNowPlayingBackEnd::update() |
|
89 { |
|
90 TX_ENTRY |
|
91 d_ptr->update(); |
|
92 TX_EXIT |
|
93 } |
|
94 |
|
95 |
|
96 /*! |
|
97 \internal |
|
98 Sends a play/pause command. |
|
99 */ |
|
100 void MpNowPlayingBackEnd::playPause() |
|
101 { |
|
102 TX_ENTRY |
|
103 d_ptr->playPause(); |
|
104 TX_EXIT |
|
105 } |
|