inc/mpplaybackdata.h
branchRCL_3
changeset 52 14979e23cb5e
equal deleted inserted replaced
50:26a1709b9fec 52:14979e23cb5e
       
     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 #include <hbicon.h>
       
    26 
       
    27 //forward declartions
       
    28 
       
    29 class ThumbnailManager;
       
    30 
       
    31 #if defined(BUILD_MPDATA_LIB)
       
    32 #define MPDATA_EXPORT Q_DECL_EXPORT
       
    33 #else
       
    34 #define MPDATA_EXPORT Q_DECL_IMPORT
       
    35 #endif
       
    36 
       
    37 class MPDATA_EXPORT MpPlaybackData : public QObject
       
    38 {
       
    39     Q_OBJECT
       
    40 
       
    41 public:
       
    42 
       
    43     enum SimplifiedState {
       
    44         NotPlaying,
       
    45         Playing,
       
    46         Paused,
       
    47         Stopped
       
    48     };
       
    49 
       
    50     explicit MpPlaybackData( QObject *parent=0 );
       
    51     virtual ~MpPlaybackData();
       
    52 
       
    53     void setDuration( int duration );
       
    54     int duration() const;
       
    55     void setPosition( int position );
       
    56     int position() const;
       
    57 
       
    58     bool setTitle( const QString& title );
       
    59     const QString& title() const;
       
    60     bool setArtist( const QString& artist );
       
    61     const QString& artist() const;
       
    62     bool setAlbum( const QString& album );
       
    63     const QString& album() const;
       
    64     bool setUri( const QString& uri );
       
    65     const QString& uri() const;
       
    66     void setAlbumArtUri( const QString& albumArtUri );
       
    67     void albumArt( HbIcon& icon ) const;
       
    68     bool setAlbumId( int id );
       
    69     int albumId();
       
    70     bool setId( int id );
       
    71     int id();
       
    72     bool setRealAudio( bool mode );
       
    73     bool realAudio();
       
    74     void setPlaybackState( const SimplifiedState state );
       
    75     MpPlaybackData::SimplifiedState playbackState() const;
       
    76 
       
    77     void commitPlaybackInfo();
       
    78     void resetData();
       
    79     void setCorrupted( int id );
       
    80     
       
    81 
       
    82 public slots:
       
    83 
       
    84     void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
       
    85 
       
    86 signals:
       
    87 
       
    88     void durationChanged();
       
    89     void positionChanged();
       
    90     void albumArtReady();
       
    91     void playbackStateChanged();
       
    92     void playbackInfoChanged();
       
    93     void fileCorrupted(int id );
       
    94     
       
    95 private:
       
    96 
       
    97     ThumbnailManager         *mThumbnailManager; //owned
       
    98     int                      mReqId;
       
    99 
       
   100     int                      mDuration;
       
   101     int                      mPosition;
       
   102     QString                  mTitle;
       
   103     QString                  mAlbum;
       
   104     QString                  mArtist;
       
   105     QString                  mUri;
       
   106     int                      mAlbumId;
       
   107     int                      mId;
       
   108     HbIcon                   mAlbumArt;
       
   109     SimplifiedState          mPlaybackState;
       
   110     bool                     mRealAudio;
       
   111 
       
   112     Q_DISABLE_COPY(MpPlaybackData)
       
   113 };
       
   114 
       
   115 #endif // MPPLAYBACKDATA_H