upnpavcontrolpoint/avcpengineclient/src/upnpavcpenginemsclient.cpp
changeset 0 7f85d04be362
child 30 5ec426854821
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /** @file
       
     2 * Copyright (c) 2005-2006 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:  Class used for accessing MS's metadata.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <e32math.h>
       
    21 #include "upnpavcpenginemsclient.h"
       
    22 
       
    23 // -----------------------------------------------------------------------------
       
    24 // RUpnpAVCPEngineMSClient::RUpnpAVCPEngineMSClient
       
    25 // C++ default constructor can NOT contain any code, that
       
    26 // might leave.
       
    27 // -----------------------------------------------------------------------------
       
    28 //
       
    29 EXPORT_C RUpnpAVCPEngineMSClient::RUpnpAVCPEngineMSClient()
       
    30     :RUpnpAVCPEngineClient()
       
    31     {
       
    32     }
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // RUpnpAVCPEngineMSClient::GetDeviceListL
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 EXPORT_C TInt RUpnpAVCPEngineMSClient::GetDeviceListL(RArray<TAVDevice>& aDeviceList) 
       
    39 	{    
       
    40     TInt id;
       
    41     TInt size;
       
    42     TPckg<TInt> idPckg(id); 
       
    43     TPckg<TInt> sizePckg(size); 
       
    44     SendReceive(EPrepareDeviceList,TIpcArgs(&idPckg,&sizePckg));
       
    45     if ( size > 0 )   
       
    46     	{        
       
    47         TAVDevice* devices = new(ELeave)TAVDevice[size];
       
    48         TPtr8 result(reinterpret_cast<TUint8*>(devices), sizeof(TAVDevice)*size, sizeof(TAVDevice)*size);
       
    49         SendReceive(EDownloadDeviceList,TIpcArgs(id, &result));
       
    50 
       
    51         for (TInt i = 0; i < size; i++) 
       
    52         	{
       
    53            	aDeviceList.Append(devices[i]);
       
    54         	}
       
    55         delete[] devices;
       
    56     	}
       
    57     return size;
       
    58 	}
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // RUpnpAVCPEngineMSClient::PrepareMetadataL
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 void RUpnpAVCPEngineMSClient::PrepareMetadataL(const TDesC8& aUUID, const TDesC8& aPathName, TPckg<TInt>& aIdPckg, TPckg<TInt>& aSizePckg) 
       
    65 	{    
       
    66     User::LeaveIfError( SendReceive(EPrepareMetadata,TIpcArgs(&aIdPckg,&aSizePckg, &aUUID, &aPathName )) );
       
    67 	}
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // RUpnpAVCPEngineMSClient::PrepareMetadata
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 void RUpnpAVCPEngineMSClient::PrepareMetadata(TRequestStatus& aStatus, const TDesC8& aUUID, const TDesC8& aPathName, TPckg<TInt>& aIdPckg, TPckg<TInt>& aSizePckg) 
       
    74 	{    
       
    75     SendReceive(EPrepareMetadata,TIpcArgs(&aIdPckg,&aSizePckg, &aUUID, &aPathName ), aStatus) ;
       
    76 	}
       
    77 	
       
    78 // -----------------------------------------------------------------------------
       
    79 // RUpnpAVCPEngineMSClient::DownloadMetadataL
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 void RUpnpAVCPEngineMSClient::DownloadMetadataL(TInt aId, TDes8& aMetaData) 
       
    83 	{           
       
    84 	User::LeaveIfError( SendReceive(EDownloadMetadata,TIpcArgs(aId, &aMetaData)));
       
    85     }
       
    86     
       
    87 // -----------------------------------------------------------------------------
       
    88 // RUpnpAVCPEngineMSClient::DownloadMetadataL
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 void RUpnpAVCPEngineMSClient::DownloadMetadata(TRequestStatus& aStatus, TInt aId, TDes8& aMetaData) 
       
    92 	{           
       
    93 	SendReceive(EDownloadMetadata,TIpcArgs(aId, &aMetaData), aStatus);
       
    94     }
       
    95 	    	
       
    96 // -----------------------------------------------------------------------------
       
    97 // RUpnpAVCPEngineMSClient::SetMetadataL
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 void RUpnpAVCPEngineMSClient::SetMetadataL(const TDesC8& aUUID, const TDesC8& aPathName, const TDesC8& aOldMetaData, const TDesC8& aNewMetaData) 
       
   101 	{
       
   102     User::LeaveIfError( SendReceive(ESetMetadata,TIpcArgs(&aUUID, &aPathName, &aOldMetaData, &aNewMetaData) ) );   
       
   103 	}
       
   104 	
       
   105 // -----------------------------------------------------------------------------
       
   106 // RUpnpAVCPEngineMSClient::SetMetadata
       
   107 // -----------------------------------------------------------------------------
       
   108 //
       
   109 void RUpnpAVCPEngineMSClient::SetMetadata(TRequestStatus& aStatus, const TDesC8& aUUID, const TDesC8& aPathName, const TDesC8& aOldMetaData, const TDesC8& aNewMetaData) 
       
   110 	{
       
   111     SendReceive(ESetMetadata,TIpcArgs(&aUUID, &aPathName, &aOldMetaData, &aNewMetaData), aStatus);   
       
   112 	}	
       
   113 
       
   114 //  End of File