mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp
branchRCL_3
changeset 23 e42293e811d8
parent 20 4aca42fa4eb1
child 24 6c1dfe4da5dd
equal deleted inserted replaced
22:b034b1c214c2 23:e42293e811d8
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  Extracts metadata from a file
    14 * Description:  Extracts metadata from a file
    15 *  Version     : %version: da1mmcf#38.1.4.2.6.1.14 % << Don't touch! Updated by Synergy at check-out.
    15 *  Version     : %version: da1mmcf#38.1.4.2.6.1.15 % << Don't touch! Updated by Synergy at check-out.
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 #include <e32base.h>
    19 #include <e32base.h>
    20 #include <badesca.h>
    20 #include <badesca.h>
   430                 
   430                 
   431                     MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL- duration = %i", duration);  
   431                     MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL- duration = %i", duration);  
   432                     }
   432                     }
   433                 break;
   433                 break;
   434                 }
   434                 }
       
   435             case EMetaDataSampleRate:     
       
   436                 {                  
       
   437                 const TDesC& mimeType = iMedia->ValueText( KMPXMediaGeneralMimeType );
       
   438                 MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL, mimeType = %S", &mimeType);   
       
   439                 
       
   440                 // Verify if WMA, get the sample rate
       
   441                 if( mimeType.Compare(KWmaMimeType) == 0 || mimeType.Compare(KWmaCafMimeType) == 0 )
       
   442                     {
       
   443                     MPX_DEBUG1("CMPXMetadataExtractor::SetMediaPropertiesL- WMA");                         
       
   444 
       
   445                     // Perform the sample rate conversion
       
   446                     TLex lexer( *value );
       
   447                     TInt32 sampleRate ( 0 );
       
   448                     lexer.Val( sampleRate );         
       
   449                     
       
   450                     iMedia->SetTObjectValueL<TUint>( KMPXMediaAudioSamplerate,
       
   451                                                       sampleRate );
       
   452                            
       
   453                     MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL- sample rate = %i", sampleRate);  
       
   454                     }
       
   455                 break;
       
   456                 }
       
   457             case EMetaDataBitRate:     
       
   458                 {                  
       
   459                 const TDesC& mimeType = iMedia->ValueText( KMPXMediaGeneralMimeType );
       
   460                 MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL, mimeType = %S", &mimeType);   
       
   461                 
       
   462                 // Verify if WMA, get the duration
       
   463                 if( mimeType.Compare(KWmaMimeType) == 0 || mimeType.Compare(KWmaCafMimeType) == 0 )
       
   464                     {
       
   465                     MPX_DEBUG1("CMPXMetadataExtractor::SetMediaPropertiesL- WMA");                         
       
   466 
       
   467                     // Perform the duration conversion
       
   468                     TLex lexer( *value );
       
   469                     TInt32 bitRate ( 0 );
       
   470                     lexer.Val( bitRate );   
       
   471                 
       
   472                     iMedia->SetTObjectValueL<TUint>( KMPXMediaAudioBitrate,
       
   473                                                      bitRate );
       
   474                 
       
   475                     MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL- duration = %i", bitRate);  
       
   476                     }
       
   477                 break;
       
   478                 }
   435             case EMetaDataOriginalArtist:  // fall through
   479             case EMetaDataOriginalArtist:  // fall through
   436             case EMetaDataVendor:          // fall through
   480             case EMetaDataVendor:          // fall through
   437             case EMetaDataRating:          // fall through
   481             case EMetaDataRating:          // fall through
   438             case EMetaDataUniqueFileIdentifier:  // fall through
   482             case EMetaDataUniqueFileIdentifier:  // fall through
   439             case EMetaDataDate:            // fall through
   483             case EMetaDataDate:            // fall through