harvester/harvesterplugins/AudioPlugin/src/harvesteraudiopluginutils.cpp
changeset 60 79f826a55db2
parent 40 910a23996aa0
equal deleted inserted replaced
58:fe894bb075c2 60:79f826a55db2
    33 _LIT( KMimeTypeRng,    "application/vnd.nokia.ringing-tone" );
    33 _LIT( KMimeTypeRng,    "application/vnd.nokia.ringing-tone" );
    34 _LIT( KMimeTypeMxmf,   "audio/vnd.nokia.mobile-xmf" );
    34 _LIT( KMimeTypeMxmf,   "audio/vnd.nokia.mobile-xmf" );
    35 _LIT( KMimeTypeWav,    "audio/wav" );
    35 _LIT( KMimeTypeWav,    "audio/wav" );
    36 _LIT( KMimeTypeAu,     "audio/au" );
    36 _LIT( KMimeTypeAu,     "audio/au" );
    37 _LIT( KMimeTypeAudioMatroska, "audio/x-matroska");
    37 _LIT( KMimeTypeAudioMatroska, "audio/x-matroska");
       
    38 _LIT( KMimeTypeAudioMp4,  "audio/mp4" );
    38 
    39 
    39 _LIT( KExtensionMp3,    "mp3" );
    40 _LIT( KExtensionMp3,    "mp3" );
    40 _LIT( KExtensionAac,    "aac" );
    41 _LIT( KExtensionAac,    "aac" );
    41 _LIT( KExtensionAmr,    "amr" );
    42 _LIT( KExtensionAmr,    "amr" );
    42 _LIT( KExtensionAwb,    "awb" );
    43 _LIT( KExtensionAwb,    "awb" );
    47 _LIT( KExtensionMxmf,   "mxmf" );
    48 _LIT( KExtensionMxmf,   "mxmf" );
    48 _LIT( KExtensionWav,    "wav" );
    49 _LIT( KExtensionWav,    "wav" );
    49 _LIT( KExtensionAu,     "au" );
    50 _LIT( KExtensionAu,     "au" );
    50 _LIT( KExtensionNrt,    "nrt" );
    51 _LIT( KExtensionNrt,    "nrt" );
    51 _LIT( KExtensionMka,    "mka" );
    52 _LIT( KExtensionMka,    "mka" );
       
    53 _LIT( KExtensionM4a,    "m4a" );
    52 
    54 
    53 // -----------------------------------------------------------------------------
    55 // -----------------------------------------------------------------------------
    54 // CAudioMDParser::NewL
    56 // CAudioMDParser::NewL
    55 // 
    57 // 
    56 // -----------------------------------------------------------------------------
    58 // -----------------------------------------------------------------------------
   111     iWantedMetadataFields.AppendL( EMetaDataAlbumTrack );
   113     iWantedMetadataFields.AppendL( EMetaDataAlbumTrack );
   112     iWantedMetadataFields.AppendL( EMetaDataOriginalArtist );
   114     iWantedMetadataFields.AppendL( EMetaDataOriginalArtist );
   113     iWantedMetadataFields.AppendL( EMetaDataDuration );
   115     iWantedMetadataFields.AppendL( EMetaDataDuration );
   114     iWantedMetadataFields.AppendL( EMetaDataCopyright );
   116     iWantedMetadataFields.AppendL( EMetaDataCopyright );
   115     iWantedMetadataFields.AppendL( EMetaDataDate );
   117     iWantedMetadataFields.AppendL( EMetaDataDate );
       
   118     iWantedMetadataFields.AppendL( EMetaDataProtected );
       
   119     iWantedMetadataFields.AppendL( EMetaDataSampleRate );
       
   120     iWantedMetadataFields.AppendL( EMetaDataBitRate );
       
   121     iWantedMetadataFields.AppendL( EMetaDataAlbumArtist );
   116     
   122     
   117     if( aAlbumArt )
   123     if( aAlbumArt )
   118         {
   124         {
   119         iWantedMetadataFields.AppendL( EMetaDataJpeg );
   125         iWantedMetadataFields.AppendL( EMetaDataJpeg );
   120         }
   126         }
   135     		KExtensionAwb(), KMimeTypeAwb(), 
   141     		KExtensionAwb(), KMimeTypeAwb(), 
   136     		EMetaDataUtilityHandling ), cmp ) );
   142     		EMetaDataUtilityHandling ), cmp ) );
   137     User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping<TAudioMetadataHandling>(
   143     User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping<TAudioMetadataHandling>(
   138         	KExtensionWma(), KMimeTypeWma(), 
   144         	KExtensionWma(), KMimeTypeWma(), 
   139         	EMetaDataUtilityHandling ), cmp ) );
   145         	EMetaDataUtilityHandling ), cmp ) );
   140 
       
   141     User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping<TAudioMetadataHandling>(
   146     User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping<TAudioMetadataHandling>(
   142     		KExtensionMid(), KMimeTypeMidi(), 
   147     		KExtensionMid(), KMimeTypeMidi(), 
   143     		EFileSystemHandling ), cmp ) );
   148     		EFileSystemHandling ), cmp ) );
   144     User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping<TAudioMetadataHandling>(
   149     User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping<TAudioMetadataHandling>(
   145     		KExtensionMidi(), KMimeTypeMidi(), 
   150     		KExtensionMidi(), KMimeTypeMidi(), 
   163     		KExtensionNrt(), KMimeTypeRng(), 
   168     		KExtensionNrt(), KMimeTypeRng(), 
   164     		EFileSystemHandling ), cmp ) );
   169     		EFileSystemHandling ), cmp ) );
   165     User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping<TAudioMetadataHandling>(
   170     User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping<TAudioMetadataHandling>(
   166             KExtensionMka(), KMimeTypeAudioMatroska(), 
   171             KExtensionMka(), KMimeTypeAudioMatroska(), 
   167             EMetaDataUtilityHandling ), cmp ) );
   172             EMetaDataUtilityHandling ), cmp ) );
   168 
   173     User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping<TAudioMetadataHandling>(
       
   174             KExtensionM4a(), KMimeTypeAudioMp4(), 
       
   175             EMetaDataUtilityHandling ), cmp ) );
   169     }
   176     }
   170 
   177 
   171 
   178 
   172 // -----------------------------------------------------------------------------
   179 // -----------------------------------------------------------------------------
   173 // CAudioMDParser::ParseMimeType
   180 // CAudioMDParser::ParseMimeType
   318         case EAudioMDFieldJpeg:
   325         case EAudioMDFieldJpeg:
   319             {
   326             {
   320             id = EMetaDataJpeg;
   327             id = EMetaDataJpeg;
   321             break;
   328             break;
   322             }
   329             }
   323 
   330         case EAudioMDFieldProtected:
       
   331             {
       
   332             id = EMetaDataProtected;
       
   333             break;
       
   334             }
       
   335         case EAudioMDFieldSampleRate:
       
   336             {
       
   337             id = EMetaDataSampleRate;
       
   338             break;
       
   339             }
       
   340         case EAudioMDFieldBitRate:
       
   341             {
       
   342             id = EMetaDataBitRate;
       
   343             break;
       
   344             }
       
   345         case EAudioMDFieldAlbumArtist:
       
   346             {
       
   347             id = EMetaDataAlbumArtist;
       
   348             break;
       
   349             }
   324         default:
   350         default:
   325             {
   351             {
   326 #ifdef _DEBUG
   352 #ifdef _DEBUG
   327             _LIT( KPanicCategory,"HarvesterAudioPlugin" );
   353             _LIT( KPanicCategory,"HarvesterAudioPlugin" );
   328             __ASSERT_DEBUG( EFalse, User::Panic( KPanicCategory,  KErrArgument ) );
   354             __ASSERT_DEBUG( EFalse, User::Panic( KPanicCategory,  KErrArgument ) );