author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 27 Apr 2010 17:33:05 +0300 | |
branch | RCL_3 |
changeset 36 | c210248fa89d |
parent 23 | 50974a8b132e |
permissions | -rw-r--r-- |
5 | 1 |
/* |
2 |
* Copyright (c) 2007-2007 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 the License "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: Factory method for media types |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include <e32base.h> |
|
23
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
20 |
#include <MCLFItem.h> |
5 | 21 |
|
22 |
#include "mgmediaitemfactory.h" |
|
23 |
#include "mglinkfile.h" |
|
24 |
#include "mgmusicfile.h" |
|
25 |
#include "mgvideofile.h" |
|
26 |
#include "mgmediaitem.h" |
|
27 |
#include "mgmediafile.h" |
|
28 |
||
29 |
||
30 |
// --------------------------------------------------------------------------- |
|
31 |
// MgMediaItemFactory::NewMediaItemLC |
|
32 |
// Checks the media type and returns an instance of the appropriate media item |
|
33 |
// --------------------------------------------------------------------------- |
|
34 |
// |
|
35 |
CMgMediaItem* MgMediaItemFactory::GetMediaItemL( const MCLFItem& aClfItem ) |
|
36 |
{ |
|
37 |
TInt32 data( 0 ); |
|
38 |
CMgMediaItem* mediaItem = NULL; |
|
39 |
if( aClfItem.GetField( ECLFFieldIdMediaType, data ) == KErrNone ) |
|
40 |
{ |
|
41 |
switch ( data ) |
|
42 |
{ |
|
43 |
case ECLFMediaTypeStreamingURL: |
|
44 |
{ |
|
45 |
mediaItem = CMgLinkFile::NewL(); |
|
46 |
break; |
|
47 |
} |
|
48 |
case ECLFMediaTypeMusic: |
|
49 |
{ |
|
50 |
mediaItem = CMgMusicFile::NewL(); |
|
51 |
break; |
|
52 |
} |
|
53 |
case ECLFMediaTypeVideo: |
|
54 |
{ |
|
55 |
mediaItem = CMgVideoFile::NewL(); |
|
56 |
break; |
|
57 |
} |
|
58 |
default: |
|
59 |
{ |
|
60 |
mediaItem = CMgMediaFile::NewL(); |
|
61 |
break; |
|
62 |
} |
|
63 |
} |
|
64 |
} |
|
65 |
return mediaItem; |
|
66 |
} |
|
67 |
||
68 |
||
69 |
||
70 |
||
71 |
||
72 |
||
73 |