upnpavcontroller/upnpavcontrollerserver/src/upnpdevicerepository.cpp
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     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:      storage for devices with extended information
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include "upnpdevicerepository.h"
       
    25 
       
    26 #include "upnpavdeviceextended.h"
       
    27 
       
    28 #include <upnpservice.h>
       
    29 #include <upnpdevice.h>
       
    30 #include <upnpavcontrolpoint.h>
       
    31 
       
    32 // CONSTANTS
       
    33 _LIT8( KSearch,                     "Search" );
       
    34 _LIT8( KVolume,                     "Volume" );
       
    35 _LIT8( KCreateObject,               "CreateObject" );
       
    36 _LIT8( KPause,                      "Pause");
       
    37 _LIT8( KSetVolume,                  "SetVolume");
       
    38 _LIT8( KGetVolume,                  "GetVolume");
       
    39 _LIT8( KGetMute,                    "GetMute");
       
    40 _LIT8( KSetMute,                    "SetMute");
       
    41 _LIT8( KMediaServer,                "MediaServer" );
       
    42 _LIT8( KFriendlyName,               "friendlyName" );
       
    43 _LIT8( KAVTransportService,         "AVTransport" );
       
    44 _LIT8( KRenderingControlService,    "RenderingControl" );
       
    45 _LIT8( KSetNextUri,                 "SetNextAVTransportURI" );
       
    46 _LIT8( KDestroyObject,              "DestroyObject" );
       
    47 _LIT8( KDlnaDoc,                    "dlna:X_DLNADOC" );
       
    48 _LIT8( KDlnaCap,                    "dlna:X_DLNACAP" );
       
    49 _LIT8( KAudioUpload,                "audio-upload" );
       
    50 _LIT8( KImageUpload,                "image-upload" );
       
    51 _LIT8( KVideoUpload,                "av-upload" );
       
    52 _LIT8( KCreateChildContainer,       "create-child-container" );
       
    53 _LIT8( KDMS,                        "DMS" );
       
    54 _LIT8( KDMP,                        "DMP" );
       
    55 _LIT8( KDMR,                        "DMR" );
       
    56 
       
    57 const TInt KFirstSubscription = 1;
       
    58 
       
    59 _LIT( KComponentLogfile, "upnpavcontrollerserver.txt");
       
    60 #include "upnplog.h"
       
    61 
       
    62 // ============================ MEMBER FUNCTIONS ============================
       
    63 
       
    64 // --------------------------------------------------------------------------
       
    65 // CUPnPDeviceRepository::NewL
       
    66 // See upnpdevicerepository.h
       
    67 // --------------------------------------------------------------------------
       
    68 CUPnPDeviceRepository* CUPnPDeviceRepository::NewL
       
    69     (
       
    70     CUpnpAVControlPoint& aControlPoint
       
    71     )
       
    72     {
       
    73     CUPnPDeviceRepository* rep= new(ELeave)
       
    74         CUPnPDeviceRepository( aControlPoint );
       
    75     CleanupStack::PushL( rep );
       
    76     rep->ConstructL();
       
    77     CleanupStack::Pop();
       
    78     return rep;
       
    79     }
       
    80 
       
    81 // --------------------------------------------------------------------------
       
    82 // CUPnPDeviceRepository::~CUPnPDeviceRepository
       
    83 // See upnpdevicerepository.h
       
    84 // --------------------------------------------------------------------------
       
    85 CUPnPDeviceRepository::~CUPnPDeviceRepository()
       
    86     {     
       
    87     iDevices.ResetAndDestroy();
       
    88     iDevices.Close();
       
    89     }
       
    90     
       
    91 // --------------------------------------------------------------------------
       
    92 // CUPnPDeviceRepository::CUPnPDeviceRepository
       
    93 // See upnpdevicerepository.h
       
    94 // --------------------------------------------------------------------------
       
    95 CUPnPDeviceRepository::CUPnPDeviceRepository
       
    96     (
       
    97     CUpnpAVControlPoint& aControlPoint
       
    98     ):
       
    99     iControlPoint( aControlPoint ),
       
   100     iIsWlanActive( ETrue )    
       
   101     {
       
   102     }
       
   103     
       
   104 // --------------------------------------------------------------------------
       
   105 // CUPnPDeviceRepository::ConstructL
       
   106 // See upnpdevicerepository.h
       
   107 // --------------------------------------------------------------------------
       
   108 void CUPnPDeviceRepository::ConstructL()
       
   109     {
       
   110     __LOG( "CUPnPDeviceRepository::ConstructL" );
       
   111     }
       
   112 
       
   113 // --------------------------------------------------------------------------
       
   114 // CUPnPDeviceRepository::AddDeviceL
       
   115 // See upnpdevicerepository.h
       
   116 // --------------------------------------------------------------------------
       
   117 void CUPnPDeviceRepository::AddDeviceL( CUpnpDevice& aDevice )
       
   118     {
       
   119     __LOG( "CUPnPDeviceRepository::AddDeviceL" );
       
   120         
       
   121     CUpnpAVDeviceExtended* dev = CUpnpAVDeviceExtended::NewL();
       
   122     CleanupStack::PushL( dev );
       
   123     
       
   124     // Check if it's a dlna device
       
   125     TPtrC8 ptr = aDevice.GetProperty( KDlnaDoc );
       
   126     if( ptr.Length() > 0 )
       
   127         {
       
   128         __LOG( "Dlna compatible device!" );
       
   129         // It's a dlna device
       
   130         dev->SetDlnaCompatible( ETrue );
       
   131         
       
   132         if( ptr.FindC( KDMS ) != KErrNotFound )
       
   133             {
       
   134             dev->SetDLNADeviceType( CUpnpAVDeviceExtended::EDMS );
       
   135             }
       
   136         else if( ptr.FindC( KDMR ) != KErrNotFound )
       
   137             {
       
   138             dev->SetDLNADeviceType( CUpnpAVDeviceExtended::EDMR );
       
   139             }
       
   140         else if( ptr.FindC( KDMP ) != KErrNotFound )
       
   141             {
       
   142             dev->SetDLNADeviceType( CUpnpAVDeviceExtended::EDMP );
       
   143             }        
       
   144         
       
   145         // Check dlna capabilities
       
   146         ptr.Set( aDevice.GetProperty( KDlnaCap ) );
       
   147         if( ptr.Find( KAudioUpload ) != KErrNotFound )        
       
   148             {
       
   149             __LOG( "Audio upload supported!" );
       
   150             dev->SetAudioUpload( ETrue );
       
   151             }
       
   152         if( ptr.Find( KImageUpload ) != KErrNotFound )
       
   153             {
       
   154             __LOG( "Image upload supported!" );
       
   155             dev->SetImageUpload( ETrue );
       
   156             }
       
   157         if( ptr.Find( KVideoUpload ) != KErrNotFound )
       
   158             {
       
   159             __LOG( "Video upload supported!" );
       
   160             dev->SetVideoUpload( ETrue );
       
   161             }
       
   162         if( ptr.Find( KCreateChildContainer ) != KErrNotFound )
       
   163             {
       
   164             __LOG( "Create child container supported!" );
       
   165             dev->SetCreateChildContainer( ETrue );
       
   166             }        
       
   167         }   
       
   168         
       
   169     if( aDevice.DeviceType().Find( KMediaServer ) != KErrNotFound )
       
   170         {
       
   171         dev->SetDeviceType( CUpnpAVDevice::EMediaServer );
       
   172         }
       
   173     else
       
   174         {
       
   175         dev->SetDeviceType( CUpnpAVDevice::EMediaRenderer );
       
   176         }
       
   177 
       
   178     dev->SetFriendlyNameL( aDevice.DescriptionProperty( KFriendlyName ) );
       
   179 
       
   180     dev->SetUuidL( aDevice.Uuid() );   
       
   181     
       
   182     dev->SetLocal( aDevice.Local() );
       
   183     
       
   184     ParseDeviceServicesL( aDevice, *dev );
       
   185     CleanupStack::Pop( dev );
       
   186     iDevices.Append( dev );
       
   187     }
       
   188     
       
   189 // --------------------------------------------------------------------------
       
   190 // CUPnPDeviceRepository::AddProtocolInfoL
       
   191 // See upnpdevicerepository.h
       
   192 // --------------------------------------------------------------------------
       
   193 CUpnpAVDeviceExtended& CUPnPDeviceRepository::AddProtocolInfoL(
       
   194     const TDesC8& aUuid, const TDesC8& aSource, const TDesC8& aSink )
       
   195     {
       
   196     __LOG( "CUPnPDeviceRepository::AddProtocolInfoL" );
       
   197     
       
   198     // Find the device
       
   199     TInt count = iDevices.Count();
       
   200     CUpnpAVDeviceExtended* dev = NULL;
       
   201     for( TInt i = 0; i < count; i++ )
       
   202         {
       
   203         if( iDevices[ i ]->Uuid() == aUuid )
       
   204             {
       
   205             dev = iDevices[ i ];
       
   206             i = count;
       
   207             }
       
   208         }
       
   209     if( dev )
       
   210         {
       
   211         if( dev->DeviceType() == CUpnpAVDevice::EMediaServer )
       
   212             {
       
   213             dev->SetSourceProtocolInfoL( aSource );
       
   214             dev->SetSinkProtocolInfoL( aSink );
       
   215             dev->SetCapabilitiesBySupportedMimeTypesL( aSource );
       
   216             }
       
   217         else
       
   218             {
       
   219             dev->SetSourceProtocolInfoL( aSource );
       
   220             dev->SetSinkProtocolInfoL( aSink );
       
   221             dev->SetCapabilitiesBySupportedMimeTypesL( aSink );    
       
   222             }
       
   223         dev->SetPInfoReceived( ETrue );        
       
   224         }
       
   225     else
       
   226         {
       
   227         User::Leave( KErrNotFound );
       
   228         }    
       
   229     return *dev;
       
   230     }
       
   231 
       
   232 // --------------------------------------------------------------------------
       
   233 // CUPnPDeviceRepository::Remove
       
   234 // See upnpdevicerepository.h
       
   235 // --------------------------------------------------------------------------
       
   236 void CUPnPDeviceRepository::Remove( const TDesC8& aUuid )
       
   237     {
       
   238     __LOG( "CUPnPDeviceRepository::Remove" );
       
   239     
       
   240     TInt count = iDevices.Count();
       
   241     for( TInt i = 0; i < count; i++ )
       
   242         {
       
   243         if( iDevices[ i ]->Uuid() == aUuid )
       
   244             {
       
   245             delete iDevices[ i ];
       
   246             iDevices.Remove( i );
       
   247             i = count;
       
   248             }
       
   249         }
       
   250     
       
   251     }
       
   252 
       
   253 // --------------------------------------------------------------------------
       
   254 // CUPnPDeviceRepository::FindDeviceL
       
   255 // See upnpdevicerepository.h
       
   256 // --------------------------------------------------------------------------
       
   257 CUpnpAVDeviceExtended& CUPnPDeviceRepository::FindDeviceL(
       
   258     const TDesC8& aUuid )
       
   259     {
       
   260     __LOG( "CUPnPDeviceRepository::FindDeviceL" );
       
   261     
       
   262     CUpnpAVDeviceExtended* tmp = NULL;
       
   263     TInt count = iDevices.Count();
       
   264     for( TInt i = 0; i < count; i++ )
       
   265         {
       
   266         if( iDevices[ i ]->Uuid() == aUuid )
       
   267             {
       
   268             tmp = iDevices[ i ];
       
   269             i = count;
       
   270             }
       
   271         }
       
   272     if( !tmp )
       
   273         {
       
   274         __LOG( "FindDeviceL - not found" );
       
   275         
       
   276         User::Leave( KErrNotFound );
       
   277         }
       
   278     return *tmp;    
       
   279     }
       
   280 
       
   281 // --------------------------------------------------------------------------
       
   282 // CUPnPDeviceRepository::DeviceList
       
   283 // See upnpdevicerepository.h
       
   284 // --------------------------------------------------------------------------
       
   285 const RPointerArray<CUpnpAVDeviceExtended>&
       
   286     CUPnPDeviceRepository::DeviceList() const
       
   287     {
       
   288     __LOG( "CUPnPDeviceRepository::DeviceList" );
       
   289     
       
   290     return iDevices;
       
   291     }
       
   292    
       
   293 // --------------------------------------------------------------------------
       
   294 // CUPnPDeviceRepository::SubscribeDeviceL
       
   295 // See upnpdevicerepository.h
       
   296 // --------------------------------------------------------------------------
       
   297 void CUPnPDeviceRepository::SubscribeDeviceL( const TDesC8& aUuid )
       
   298     {
       
   299     __LOG( "CUPnPDeviceRepository::SubscribeDeviceL" );
       
   300     __LOG8( aUuid );
       
   301     
       
   302     // Find the device and increase subscription count/check if we have
       
   303     // subscribed already
       
   304     TInt count = iDevices.Count();
       
   305     TInt subscriptionCount = KErrNotFound;
       
   306     TInt index;
       
   307     for( index = 0; index < count; index++ )
       
   308         {
       
   309         if( aUuid.Compare( iDevices[ index ]->Uuid() ) == 0 )
       
   310             {
       
   311             subscriptionCount = iDevices[ index ]->IncreaseSubscriptionCount();
       
   312             index = count;
       
   313             }
       
   314         }
       
   315     if( subscriptionCount == KFirstSubscription )
       
   316         {
       
   317         __LOG( "SubscribeDeviceL - First subscription" ); 
       
   318         
       
   319         // Start subsciption for AVTransport and RenderingControl services
       
   320         // Find the device
       
   321         const RPointerArray<CUpnpDevice>& devList =
       
   322             iControlPoint.DeviceList();
       
   323         count = devList.Count();
       
   324         for( index = 0; index < count; index++ )
       
   325             {
       
   326             if( aUuid.Compare( devList[ index ]->Uuid() ) == 0 )
       
   327                 {
       
   328                 break;
       
   329                 }
       
   330             }
       
   331 
       
   332         // Find the AVTransport service and subscribe
       
   333         RPointerArray<CUpnpService>& servList =
       
   334             devList[ index ]->ServiceList();
       
   335         count = servList.Count();
       
   336         CUpnpService* tempService = NULL;
       
   337         for( index = 0; index < count; index++ )
       
   338             {
       
   339             if( servList[ index ]->ServiceType().Find(
       
   340                 KAVTransportService ) >= 0 )
       
   341                 {
       
   342                 tempService = servList[ index ];
       
   343                 index = count;
       
   344                 }
       
   345             }
       
   346         if( tempService && iIsWlanActive )
       
   347             {
       
   348             // AVTransport service found for the device, subscribe
       
   349             __LOG( "SubscribeDeviceL - Subscribe for AVTransport" ); 
       
   350             iControlPoint.SubscribeL( tempService ); 
       
   351             }
       
   352         else
       
   353             {     
       
   354             // Service not found, can't subscribe
       
   355             __LOG( "SubscribeDeviceL - AVTransport service not found" );
       
   356             }
       
   357             
       
   358         tempService = NULL;
       
   359         for( index = 0; index < count; index++ )
       
   360             {
       
   361             if( servList[ index ]->ServiceType().Find(
       
   362                 KRenderingControlService ) >= 0 )
       
   363                 {
       
   364                 tempService = servList[ index ];
       
   365                 index = count;
       
   366                 }
       
   367             }
       
   368         if( tempService && iIsWlanActive )
       
   369             {
       
   370             // RenderingControl service found for the device, subscribe
       
   371             __LOG( "SubscribeDeviceL - Subscribe for RenderingControl" ); 
       
   372             iControlPoint.SubscribeL( tempService ); 
       
   373             }
       
   374         else
       
   375             {     
       
   376             // Service not found, can't subscribe
       
   377             __LOG( "SubscribeDeviceL - RenderingControl service not found" );
       
   378             }                    
       
   379         }
       
   380     else if( subscriptionCount == KErrNotFound ) 
       
   381         {
       
   382         __LOG( "SubscribeDeviceL - device not found" );
       
   383         }
       
   384     else
       
   385         {
       
   386         // Subscribed already, do nothing
       
   387         __LOG( "SubscribeDeviceL - Subscription done already, ignoring!" ); 
       
   388         }        
       
   389     }
       
   390     
       
   391 // --------------------------------------------------------------------------
       
   392 // CUPnPDeviceRepository::UnSubscribeDeviceL
       
   393 // See upnpdevicerepository.h
       
   394 // --------------------------------------------------------------------------
       
   395 void CUPnPDeviceRepository::UnSubscribeDeviceL( const TDesC8& aUuid )
       
   396     {
       
   397     __LOG( "CUPnPDeviceRepository::UnSubscribeDeviceL" );
       
   398     __LOG8( aUuid );
       
   399     
       
   400     // Find the device and decrease subscription count/check if it's needed
       
   401     // to unsubscribe
       
   402     TInt count = iDevices.Count();
       
   403     TInt subscriptionCount = KErrNotFound;
       
   404     TInt index;
       
   405     for( index = 0; index < count; index++ )
       
   406         {
       
   407         if( aUuid.Compare( iDevices[ index ]->Uuid() ) == 0 )
       
   408             {
       
   409             subscriptionCount = 
       
   410                 iDevices[ index ]->DecreaseSubscriptionCount();
       
   411             index = count;
       
   412             }
       
   413         }    
       
   414     
       
   415     if( subscriptionCount == 0 )
       
   416         {   
       
   417         // Start unsubsciption for AVTransport and RenderingControl services
       
   418         // Find the device
       
   419         const RPointerArray<CUpnpDevice>& devList =
       
   420             iControlPoint.DeviceList();
       
   421         count = devList.Count();
       
   422         for( index = 0; index < count; index++ )
       
   423             {
       
   424             if( aUuid.Compare( devList[ index ]->Uuid() ) == 0 )
       
   425                 {
       
   426                 break;
       
   427                 }
       
   428             }
       
   429 
       
   430         // Find the AVTransport service and unsubscribe
       
   431         RPointerArray<CUpnpService>& servList =
       
   432             devList[ index ]->ServiceList();
       
   433         count = servList.Count();
       
   434         CUpnpService* tempService = NULL;
       
   435         for( index = 0; index < count; index++ )
       
   436             {
       
   437             if( servList[ index ]->ServiceType().Find(
       
   438                 KAVTransportService ) >= 0 )
       
   439                 {
       
   440                 tempService = servList[ index ];
       
   441                 index = count;
       
   442                 }
       
   443             }
       
   444         if( tempService && iIsWlanActive )
       
   445             {
       
   446             // AVTransport service found for the device, unsubscribe
       
   447             __LOG( "UnSubscribeDeviceL - UnSubscribe AVTransport" ); 
       
   448             iControlPoint.UnsubscribeL( tempService ); 
       
   449             }
       
   450         else
       
   451             {     
       
   452             // Service not found, can't unsubscribe
       
   453             __LOG( "UnSubscribeDeviceL - AVTransport service not found" );
       
   454             }
       
   455             
       
   456         tempService = NULL;
       
   457         for( index = 0; index < count; index++ )
       
   458             {
       
   459             if( servList[ index ]->ServiceType().Find(
       
   460                 KRenderingControlService ) >= 0 )
       
   461                 {
       
   462                 tempService = servList[ index ];
       
   463                 index = count;
       
   464                 }
       
   465             }
       
   466         if( tempService && iIsWlanActive )
       
   467             {
       
   468             // RenderingControl service found for the device, subscribe
       
   469             __LOG( "UnSubscribeDeviceL - UnSubscribe RenderingControl" ); 
       
   470             iControlPoint.UnsubscribeL( tempService ); 
       
   471             }
       
   472         else
       
   473             {     
       
   474             // Service not found, can't subscribe
       
   475             __LOG( "UnSubscribeDeviceL - RenderingControl service not\
       
   476 found" );
       
   477             }                    
       
   478         }
       
   479     else if( subscriptionCount == KErrNotFound ) 
       
   480         {
       
   481         __LOG( "UnSubscribeDeviceL - device not found" );
       
   482         }
       
   483     else
       
   484         {
       
   485         // No need to unsubscibe
       
   486         }           
       
   487     }
       
   488 
       
   489 void CUPnPDeviceRepository::ConnectionLost()
       
   490     {
       
   491     __LOG( "CUPnPDeviceRepository::ConnectionLost" );
       
   492     iIsWlanActive = EFalse;
       
   493     iDevices.ResetAndDestroy();
       
   494     }
       
   495 
       
   496 TBool CUPnPDeviceRepository::IsWlanActive()
       
   497     {
       
   498     __LOG1( "CUPnPDeviceRepository::IsWlanActive, %d", (TInt)iIsWlanActive );
       
   499     return iIsWlanActive;
       
   500     }
       
   501 
       
   502 // --------------------------------------------------------------------------
       
   503 // CUPnPDeviceRepository::ParseDeviceServicesL
       
   504 // See upnpdevicerepository.h
       
   505 // --------------------------------------------------------------------------
       
   506 void CUPnPDeviceRepository::ParseDeviceServicesL( CUpnpDevice& aSource,
       
   507     CUpnpAVDeviceExtended& aTarget )
       
   508     {
       
   509     __LOG( "CUPnPDeviceRepository::ParseDeviceServicesL" );
       
   510     
       
   511     TBool createObjectSupported = EFalse;
       
   512     TBool getMuteSupported = EFalse;
       
   513     TBool setMuteSupported = EFalse;
       
   514     TBool getVolumeSupported = EFalse;
       
   515     TBool setVolumeSupported = EFalse;
       
   516 
       
   517     RPointerArray<CUpnpService>services = aSource.ServiceList();
       
   518 
       
   519     TInt i;
       
   520     TInt count = services.Count(); 
       
   521     for( i = 0; i < count; i++ )
       
   522         {
       
   523         // Get max volume if it exists
       
   524         CUpnpStateVariable* volumeState = 
       
   525                 services[ i ]->StateVariable( KVolume );
       
   526 
       
   527         // If volume info found, save it to the device
       
   528         if( volumeState )
       
   529             {
       
   530             TInt maxVolume = volumeState->MaxValue();
       
   531             // If max volume not defined, it is set to 100
       
   532             if( maxVolume == KErrNotFound )
       
   533                 {
       
   534                 maxVolume = 100;
       
   535                 }
       
   536             aTarget.SetMaxVolume( maxVolume );
       
   537             }
       
   538 
       
   539         // Get the actions
       
   540         RPointerArray<CUpnpAction> actions;
       
   541         services[ i ]->GetActionList( actions );
       
   542 
       
   543         // Go through the action elements
       
   544         TInt j;
       
   545         TInt count2 = actions.Count();
       
   546         for( j = 0; j < count2; j++ )
       
   547             {
       
   548             TDesC8& actionName = actions[ j ]->Name();
       
   549 
       
   550             if( actionName != KNullDesC8 )
       
   551                 {
       
   552                 if( actionName.Find( KCreateObject ) >= 0 )
       
   553                     {
       
   554                     createObjectSupported = ETrue;
       
   555                     }
       
   556                 if( actionName.Compare( KSearch ) == 0 )
       
   557                     {
       
   558                     aTarget.SetSearchCapability( ETrue );
       
   559                     }
       
   560                 if( actionName.Find( KPause ) >= 0 )
       
   561                     {
       
   562                     aTarget.SetPauseCapability( ETrue );
       
   563                     }
       
   564                 if( actionName.Find( KGetVolume ) >= 0 )
       
   565                     {
       
   566                     getVolumeSupported = ETrue;
       
   567                     }
       
   568                 if( actionName.Find( KSetVolume ) >= 0 )
       
   569                     {
       
   570                     setVolumeSupported = ETrue;
       
   571                     }
       
   572                 if( actionName.Find( KGetMute ) >= 0 )
       
   573                     {
       
   574                     getMuteSupported = ETrue;
       
   575                     }
       
   576                 if( actionName.Find( KSetMute ) >= 0 )
       
   577                     {
       
   578                     setMuteSupported = ETrue;
       
   579                     }
       
   580                 if( actionName.Find( KSetNextUri ) >= 0 )
       
   581                     {
       
   582                     aTarget.SetNextAVTransportUri( ETrue );
       
   583                     }
       
   584                 if( actionName.Find( KDestroyObject ) >= 0 )
       
   585                     {
       
   586                     aTarget.SetDestroyObject( ETrue );
       
   587                     }                    
       
   588                 }
       
   589             }
       
   590         }
       
   591 
       
   592     // Set copy support
       
   593     if( createObjectSupported )
       
   594         {
       
   595         aTarget.SetCopyCapability( ETrue );
       
   596         }
       
   597 
       
   598     // Set volume support
       
   599     if( getVolumeSupported &&
       
   600         setVolumeSupported )
       
   601         {
       
   602         aTarget.SetVolumeCapability( ETrue );
       
   603         }
       
   604 
       
   605     // Set mute support
       
   606     if( getMuteSupported &&
       
   607         setMuteSupported )
       
   608         {
       
   609         aTarget.SetMuteCapability( ETrue );
       
   610         }
       
   611     }        
       
   612 
       
   613 // end of file