mpserviceplugins/m3uplaylistplugin/inc/mpxm3uplaylistexporter.h
changeset 25 3ec52facab4d
parent 19 4e84c994a771
equal deleted inserted replaced
22:ecf06a08d4d9 25:3ec52facab4d
    33 *  if the client wishes to export another m3u playlist file.
    33 *  if the client wishes to export another m3u playlist file.
    34 */
    34 */
    35 class CMPXM3uPlaylistExporter : public CActive
    35 class CMPXM3uPlaylistExporter : public CActive
    36     {
    36     {
    37 public: // Constructors and destructor
    37 public: // Constructors and destructor
    38 
    38     
    39     /**
    39     /**
    40     * Two-phased constructor
    40     * Two-phased constructor
    41     *
    41     *
    42     * @param aFs a file session handle
    42     * @param aFs a file session handle
    43     * @param aObserver reference to the playlist plugin observer
    43     * @param aObserver reference to the playlist plugin observer
    56     /**
    56     /**
    57     * Destructor
    57     * Destructor
    58     */
    58     */
    59     IMPORT_C virtual ~CMPXM3uPlaylistExporter();
    59     IMPORT_C virtual ~CMPXM3uPlaylistExporter();
    60 
    60 
    61 
    61     
    62 protected:
    62 protected:
    63 
    63 
    64     /**
    64     /**
    65     * Constructor
    65     * Constructor
    66     *
    66     *
    67     * @param aFs a file session handle
    67     * @param aFs a file session handle
    68     * @param aObserver reference to the playlist plugin observer
    68     * @param aObserver reference to the playlist plugin observer
    69     * @param aPlaylist playlist to be externalized
    69     * @param aPlaylist playlist to be externalized
    70     * @param aStatus caller's request status
    70     * @param aStatus caller's request status
    71     * @return object of constructed
    71     * @return object of constructed    
    72     */
    72     */
    73     IMPORT_C CMPXM3uPlaylistExporter(
    73     IMPORT_C CMPXM3uPlaylistExporter(
    74         RFs* aFs,
    74         RFs* aFs,
    75         MMPXPlaylistPluginObserver* aObserver,
    75         MMPXPlaylistPluginObserver* aObserver,
    76         const CMPXMedia& aPlaylist,
    76         const CMPXMedia& aPlaylist,
    77         TRequestStatus& aStatus );
    77         TRequestStatus& aStatus );
    78 
    78     
    79     /**
    79     /**
    80     * 2nd phase constructor
    80     * 2nd phase constructor
    81     *
    81     *
    82     * @param aFilePath File path for where the playlist should be placed
    82     * @param aFilePath File path for where the playlist should be placed
    83     */
    83     */
    84     IMPORT_C virtual void ConstructL(
    84     IMPORT_C virtual void ConstructL(
    85         const TDesC& aFilePath);
    85         const TDesC& aFilePath);    
    86 
    86    
    87     /**
    87     /**
    88     *  From CActive
    88     *  From CActive
    89     *  Handles an active object's request completion event
    89     *  Handles an active object's request completion event
    90     */
    90     */
    91     IMPORT_C virtual void RunL();
    91     IMPORT_C virtual void RunL();
    98 
    98 
    99     /**
    99     /**
   100     * Does a step of the task
   100     * Does a step of the task
   101     */
   101     */
   102     IMPORT_C virtual void DoTaskStep();
   102     IMPORT_C virtual void DoTaskStep();
   103 
   103     
   104 private:
   104 private:
   105 
   105 
   106     /**
   106     /**
   107     * externalize a set number of the medias. This will be called until all
   107     * externalize a set number of the medias. This will be called until all
   108     * the given medias have been processed
   108     * the given medias have been processed
   109     */
   109     */
   110     void ExternalizeL();
   110     void ExternalizeL();
   111 
   111     
   112     /**
   112     /**
   113     * Populates iLines with HBufC8's each representing one line of playlist
   113     * Populates iLines with HBufC8's each representing one line of playlist
   114     * file.
   114     * file.
   115     */
   115     */
   116     void PopulateLineArrayL();
   116     void PopulateLineArrayL();
   133     void CreateExtentedInfoLineL(
   133     void CreateExtentedInfoLineL(
   134             const CMPXMedia& aMedia);
   134             const CMPXMedia& aMedia);
   135 
   135 
   136     /**
   136     /**
   137     * Creates a string containing iItem's relative or absolute path (path
   137     * Creates a string containing iItem's relative or absolute path (path
   138     * is relative if the audio clip is stored to the same directory, or
   138     * is relative if the audio clip is stored to the same directory, or 
   139     * it's sub-directories, as the playlist file). The stirng is stored to
   139     * it's sub-directories, as the playlist file). The stirng is stored to
   140     * iLine.
   140     * iLine.
   141     */
   141     */
   142     void CreatePathLineL(
   142     void CreatePathLineL(
   143             const CMPXMedia& aMedia,
   143             const CMPXMedia& aMedia,
   164     /**
   164     /**
   165     * Notify client of the specified error through MMPXPlaylistPluginObserver
   165     * Notify client of the specified error through MMPXPlaylistPluginObserver
   166     * interface
   166     * interface
   167     */
   167     */
   168     void NotifyClient(TInt aError);
   168     void NotifyClient(TInt aError);
   169 
   169          
   170 protected:    // Data
   170 protected:    // Data
   171 
   171 
   172     const CMPXMedia&                    iPlaylist;
   172     const CMPXMedia&                    iPlaylist;
   173     CMPXMediaArray*                     iMedias;
   173     CMPXMediaArray*                     iMedias;
   174     HBufC*                              iPlaylistFilePath;
   174     HBufC*                              iPlaylistFilePath;
   179     RPointerArray<HBufC8>               iLines;
   179     RPointerArray<HBufC8>               iLines;
   180     HBufC*                              iLine;
   180     HBufC*                              iLine;
   181 
   181 
   182     RFs*                                iFs;       // not owned
   182     RFs*                                iFs;       // not owned
   183     MMPXPlaylistPluginObserver*         iObserver; // not owned
   183     MMPXPlaylistPluginObserver*         iObserver; // not owned
   184 
   184     
   185     TInt                                iCurrentMedia;
   185     TInt                                iCurrentMedia;
   186     TBool                               iMoreToDo;
   186     TBool                               iMoreToDo;
   187 
   187 
   188     TRequestStatus*                     iCallerStatus;
   188     TRequestStatus*                     iCallerStatus;    
   189     };
   189     };
   190 
   190 
   191 #endif   // MPXM3UPLAYLISTIMPORTER_H
   191 #endif   // MPXM3UPLAYLISTIMPORTER_H
       
   192             
   192 
   193 
   193