|
1 /* |
|
2 * Copyright (c) 2010 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: Implementation of UPnP Renderer config container class |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDES |
|
19 #include "upnprenderercfg.h" |
|
20 |
|
21 _LIT( KComponentLogfile, "upnprenderercfg.txt"); |
|
22 #include "upnplog.h" |
|
23 |
|
24 #define __FUNC_LOG __LOG8_1( "%s", __PRETTY_FUNCTION__ ); |
|
25 |
|
26 EXPORT_C CUpnpRendererCfg* CUpnpRendererCfg::NewL( const TDesC& aConfigFile, |
|
27 const TDesC8& aModelName, const TDesC8& aSrcMimeType ) |
|
28 { |
|
29 __FUNC_LOG; |
|
30 |
|
31 CUpnpRendererCfg* self = CUpnpRendererCfg::NewLC( aConfigFile, |
|
32 aModelName, aSrcMimeType ); |
|
33 CleanupStack::Pop( self ); |
|
34 return self; |
|
35 } |
|
36 |
|
37 EXPORT_C CUpnpRendererCfg* CUpnpRendererCfg::NewLC( const TDesC& aConfigFile, |
|
38 const TDesC8& aModelName, const TDesC8& aSrcMimeType ) |
|
39 { |
|
40 __FUNC_LOG; |
|
41 |
|
42 CUpnpRendererCfg* self = new( ELeave ) CUpnpRendererCfg(); |
|
43 CleanupStack::PushL( self ); |
|
44 self->ConstructL( aConfigFile, aModelName, aSrcMimeType ); |
|
45 return self; |
|
46 } |
|
47 |
|
48 EXPORT_C CUpnpRendererCfg::~CUpnpRendererCfg() |
|
49 { |
|
50 __FUNC_LOG; |
|
51 |
|
52 delete iConfigFile; |
|
53 delete iModelName; |
|
54 delete iSrcMimeType; |
|
55 delete iPipeline; |
|
56 delete iProtocolInfo; |
|
57 } |
|
58 |
|
59 CUpnpRendererCfg::CUpnpRendererCfg() |
|
60 : iSizeMultiplier( KErrNotFound ) |
|
61 { |
|
62 __FUNC_LOG; |
|
63 } |
|
64 |
|
65 void CUpnpRendererCfg::ConstructL( const TDesC& aConfigFile, const TDesC8& aModelName, |
|
66 const TDesC8& aSrcMimeType ) |
|
67 { |
|
68 __FUNC_LOG; |
|
69 |
|
70 iConfigFile = aConfigFile.AllocL(); |
|
71 iModelName = aModelName.AllocL(); |
|
72 iSrcMimeType = aSrcMimeType.AllocL(); |
|
73 } |
|
74 |
|
75 EXPORT_C const TDesC8& CUpnpRendererCfg::Pipeline() const |
|
76 { |
|
77 __FUNC_LOG; |
|
78 |
|
79 if( !iPipeline ) |
|
80 { |
|
81 return KNullDesC8; |
|
82 } |
|
83 else |
|
84 { |
|
85 return *iPipeline; |
|
86 } |
|
87 } |
|
88 |
|
89 EXPORT_C const TDesC8& CUpnpRendererCfg::ProtocolInfo() const |
|
90 { |
|
91 __FUNC_LOG; |
|
92 |
|
93 if( !iProtocolInfo ) |
|
94 { |
|
95 return KNullDesC8; |
|
96 } |
|
97 else |
|
98 { |
|
99 return *iProtocolInfo; |
|
100 } |
|
101 } |
|
102 |
|
103 EXPORT_C TReal CUpnpRendererCfg::SizeMultiplier() const |
|
104 { |
|
105 __FUNC_LOG; |
|
106 |
|
107 return iSizeMultiplier; |
|
108 } |
|
109 |
|
110 // end of file |