inc/mpplaybackdata.h
changeset 22 ecf06a08d4d9
child 29 8192e5b5c935
equal deleted inserted replaced
20:82baf59ce8dd 22:ecf06a08d4d9
       
     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: Playback Data provider for playback view.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPPLAYBACKDATA_H
       
    19 #define MPPLAYBACKDATA_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QString>
       
    23 #include <QPixmap>
       
    24 
       
    25 //forward declartions
       
    26 
       
    27 class HbIcon;
       
    28 class ThumbnailManager;
       
    29 
       
    30 #if defined(BUILD_MPDATA_LIB)
       
    31 #define MPDATA_EXPORT Q_DECL_EXPORT
       
    32 #else
       
    33 #define MPDATA_EXPORT Q_DECL_IMPORT
       
    34 #endif
       
    35 
       
    36 class MPDATA_EXPORT MpPlaybackData : public QObject
       
    37 {
       
    38     Q_OBJECT
       
    39 
       
    40 public:
       
    41 
       
    42     enum SimplifiedState {
       
    43         Playing,
       
    44         Paused,
       
    45         Stopped
       
    46     };
       
    47 
       
    48     explicit MpPlaybackData( QObject *parent=0 );
       
    49     virtual ~MpPlaybackData();
       
    50 
       
    51     void setDuration( int duration );
       
    52     int duration() const;
       
    53     void setPosition( int position );
       
    54     int position() const;
       
    55 
       
    56     bool setTitle( const QString& title );
       
    57     const QString& title() const;
       
    58     bool setArtist( const QString& artist );
       
    59     const QString& artist() const;
       
    60     bool setAlbum( const QString& album );
       
    61     const QString& album() const;
       
    62     bool setUri( const QString& uri );
       
    63     const QString& uri() const;
       
    64 
       
    65     void setAlbumArtUri( const QString& albumArtUri );
       
    66     void albumArt( HbIcon& icon ) const;
       
    67 
       
    68     void setPlaybackState( const SimplifiedState state );
       
    69     MpPlaybackData::SimplifiedState playbackState() const;
       
    70 
       
    71     void commitPlaybackInfo();
       
    72 
       
    73 public slots:
       
    74 
       
    75     void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
       
    76 
       
    77 signals:
       
    78 
       
    79     void durationChanged();
       
    80     void positionChanged();
       
    81     void albumArtReady();
       
    82     void playbackStateChanged();
       
    83     void playbackInfoChanged();
       
    84 
       
    85 private:
       
    86 
       
    87     ThumbnailManager         *mThumbnailManager; //owned
       
    88     int                      mReqId;
       
    89 
       
    90     int                      mDuration;
       
    91     int                      mPosition;
       
    92     QString                  mTitle;
       
    93     QString                  mAlbum;
       
    94     QString                  mArtist;
       
    95     QString                  mUri;
       
    96     HbIcon                   *mAlbumArt;
       
    97     HbIcon                   *mDefaultAlbumArt;
       
    98     SimplifiedState          mPlaybackState;
       
    99 
       
   100     Q_DISABLE_COPY(MpPlaybackData)
       
   101 };
       
   102 
       
   103 #endif // MPPLAYBACKDATA_H