mmserv/metadatautility/Src/MetaDataParserID3v2.cpp
branchRCL_3
changeset 30 ab526b8cacfb
parent 0 71ca22bcf22a
child 43 9894ed580e4a
--- a/mmserv/metadatautility/Src/MetaDataParserID3v2.cpp	Wed Jun 09 10:15:38 2010 +0300
+++ b/mmserv/metadatautility/Src/MetaDataParserID3v2.cpp	Mon Jun 21 16:15:34 2010 +0300
@@ -77,10 +77,21 @@
 CMetaDataParserID3v2* CMetaDataParserID3v2::CreateID3v2ParserL(
 	CMetaDataSource& aSource )
     {
+    return CreateID3v2ParserL( aSource, 0 );
+    }
+
+// -----------------------------------------------------------------------------
+// CMetaDataParserID3v2::CreateID3v2ParserL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CMetaDataParserID3v2* CMetaDataParserID3v2::CreateID3v2ParserL(
+	CMetaDataSource& aSource, TUint aOffset )
+    {
 #ifdef _DEBUG
 	RDebug::Print(_L("CMetaDataParserID3v2::CreateID3v2ParserL"));
 #endif
-	TInt version = VersionL(aSource);
+	TInt version = VersionL(aSource, aOffset);
 
 	CMetaDataParserID3v2* parser = NULL;
 	switch ( version )
@@ -97,6 +108,12 @@
 		default:	// KErrNotFound
 			break;
 		}
+	
+	if( parser )
+	    {
+	    parser->SetID32Offset( aOffset );
+	    }
+	
 	return parser;
     }
 
@@ -160,7 +177,7 @@
 		{
 		iTag = HBufC8::NewL(iFrameDataSize);
 		TPtr8 des( iTag->Des() );
-		iSource->ReadL(0, des);
+		iSource->ReadL(iID32Offset, des);
 		
 		iSourceDes = CMetaDataSourceDescriptor::NewL(des);
 		iSource = iSourceDes;
@@ -522,7 +539,7 @@
 // -----------------------------------------------------------------------------
 //
 TInt CMetaDataParserID3v2::VersionL(
-	CMetaDataSource& aSource )
+	CMetaDataSource& aSource, TUint aOffset )
 	{
 	TInt size = 0;
 	aSource.Size( size );
@@ -533,7 +550,7 @@
 		}
 
 	TBuf8<KID3v2HeaderLength> header;
-	aSource.ReadL( header );
+	aSource.ReadL( aOffset, header );
 	// ID3v2 header consists of following parts:
     // - identifier "ID3", 3 bytes
     // - version, 2 bytes