mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp
changeset 45 09978a29cfde
parent 40 4a1905d205a2
child 48 b7b49303d0c0
--- a/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp	Fri Jun 25 17:07:52 2010 -0500
+++ b/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp	Fri Jul 09 17:03:16 2010 -0500
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  Extracts metadata from a file
-*  Version     : %version: da1mmcf#38.1.4.2.6.1.5.3.4 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: da1mmcf#38.1.4.2.6.1.5.3.5 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -432,6 +432,50 @@
                     }
                 break;
                 }
+            case EMetaDataSampleRate:     
+                {                  
+                const TDesC& mimeType = iMedia->ValueText( KMPXMediaGeneralMimeType );
+                MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL, mimeType = %S", &mimeType);   
+                
+                // Verify if WMA, get the sample rate
+                if( mimeType.Compare(KWmaMimeType) == 0 || mimeType.Compare(KWmaCafMimeType) == 0 )
+                    {
+                    MPX_DEBUG1("CMPXMetadataExtractor::SetMediaPropertiesL- WMA");                         
+
+                    // Perform the sample rate conversion
+                    TLex lexer( *value );
+                    TInt32 sampleRate ( 0 );
+                    lexer.Val( sampleRate );         
+                    
+                    iMedia->SetTObjectValueL<TUint>( KMPXMediaAudioSamplerate,
+                                                      sampleRate );
+                           
+                    MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL- sample rate = %i", sampleRate);  
+                    }
+                break;
+                }
+            case EMetaDataBitRate:     
+                {                  
+                const TDesC& mimeType = iMedia->ValueText( KMPXMediaGeneralMimeType );
+                MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL, mimeType = %S", &mimeType);   
+                
+                // Verify if WMA, get the duration
+                if( mimeType.Compare(KWmaMimeType) == 0 || mimeType.Compare(KWmaCafMimeType) == 0 )
+                    {
+                    MPX_DEBUG1("CMPXMetadataExtractor::SetMediaPropertiesL- WMA");                         
+
+                    // Perform the duration conversion
+                    TLex lexer( *value );
+                    TInt32 bitRate ( 0 );
+                    lexer.Val( bitRate );   
+                
+                    iMedia->SetTObjectValueL<TUint>( KMPXMediaAudioBitrate,
+                                                     bitRate );
+                
+                    MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL- duration = %i", bitRate);  
+                    }
+                break;
+                }
             case EMetaDataOriginalArtist:  // fall through
             case EMetaDataVendor:          // fall through
             case EMetaDataRating:          // fall through